polydat_core/iteration/comprehension/predicate/mod.rs
1// Copyright 2024-2026 Jonathan Shook
2// SPDX-License-Identifier: Apache-2.0
3
4//! Predicate analyzer — spec §10.9.
5//!
6//! Structured analysis of Polydat boolean expressions used as
7//! `filter` predicates. Output is [`PredicateInfo`] —
8//! consumed by the optimizer's R5 (per-axis filter pushdown)
9//! and the deferred R8 / R9 / R10 rules.
10//!
11//! The analyzer operates on the predicate **string** (the form
12//! carried by [`crate::iteration::comprehension::ast::Comprehension::Filter`]).
13//! A future revision may take a pre-parsed `PolydatExpr`; for the
14//! initial implementation, recognizers walk the source text
15//! and match the §10.9.5 pattern catalog.
16//!
17//! ## Module layout
18//!
19//! - [`info`] — `PredicateInfo` and supporting enums.
20//! - [`coordset`] — `CoordSet` carrying per-coord discrete /
21//! continuous classification.
22//! - [`recognizers`] — the §10.9.5 pattern catalog.
23//! - [`analyzer`] — entry point + dispatch.
24
25pub mod analyzer;
26pub mod coordset;
27pub mod info;
28pub mod recognizers;
29
30pub use analyzer::analyze;
31pub use coordset::{CoordInfo, CoordKind, CoordSet};
32pub use info::{
33 Determinism, Factorization, Monotonicity, OpaqueReason, PerAxisMap, PredicateInfo,
34 RangeConstraint,
35};