Skip to main content

Module analyzer

Module analyzer 

Source
Expand description

Predicate analyzer entry point — comprehension_forms.md §10.9.2.

Single public function: analyze. Takes a predicate string + a coord set, dispatches through the §10.9.5 pattern recognizers, and returns a PredicateInfo.

The analyzer’s correctness contract per §10.9.4:

  1. Sound. Every assertion in the returned PredicateInfo is true of the predicate.
  2. Conservatively incomplete. Unrecognized patterns → Opaque(UnknownPattern); missing an optimization is acceptable, false assertions are not.
  3. Total. Every well-formed boolean expression produces a PredicateInfo. The trivial bundle (everything None / Opaque) is the worst case but never a failure.
  4. Deterministic. Same (predicate, coords) always produces the same PredicateInfo.
  5. Constant-time per node. Single walk through the predicate text; no SMT, no fixed-point iteration.

Functions§

analyze
Analyze a predicate string in the context of a coordinate set. Returns a structured PredicateInfo, which the optimizer’s R5 reads.