Files
Imhotep/packages/imhotep-dsl
John Dvorak 6f82849b4f refactor: convert validator to use predicate spec table
Replace 5 static Sets/maps (SPATIAL_RELATIONS, SIZE_RELATIONS,
VALID_OPTIONS, QUANTIFIER_COMPATIBLE, UNARY_RELATIONS) with
derivation from the unified PredicateSpec table:
  - collectSpatialPredicateNames / collectSizePredicateNames
    for category sets
  - getPredicateValidOptions for option validation
  - collectQuantifierCompatiblePredicateNames for quantifier checks
  - isUnaryPredicate for unary detection

Local override map retained for fluent API dotted size variants
('size.atLeast' etc.) and 'aspectRatioBetween' DSL keyword, which
are input conventions, not distinct predicates.

595 SDK + 57 E2E tests pass.
2026-05-22 12:46:41 -07:00
..

imhotep-dsl

Domain-specific language for Imhotep assertions. Provides a fluent assertion API, a dense string-based DSL parser, FOL compilation/validation, canonical lowering, and property-run builders.

Key Exports

Export Description
expect(subject) Fluent assertion builder
spec(src) Dense DSL parser (parseSpec alias)
compile(source) Compile DSL to assertion nodes
compileDenseFOLToFormula(src) Compile dense FOL to solver-ready AST
validateAssertion(node) Pre-flight validation without extraction
lowerToCanonical(nodes) Canonical lowering for IR equivalence
component, enumerate Property-run fluent builders
forAll, exists, predicate, domain FOL fluent builders