Files
Imhotep/packages/imhotep-dsl
John Dvorak 2e27693278 refactor: convert DSL compiler relationCodes and unary check to spec table
Replace 19-entry relationCodes string-to-integer map with
getPredicateRelationCode() from PredicateSpec. Keep only
aspectRatioBetween (15) as local DSL-keyword override.

Replace string-based unary detection ('atLeast'||'atMost') in
compileSimpleAssertionToFormula with isUnaryPredicate() from spec.

595 SDK + 57 E2E tests pass.
2026-05-22 12:48:39 -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