Skip to main content

Module assertions

Module assertions 

Source
Expand description

Debug-only structural assertions for AST/model integrity.

The assertions in this module validate a few key invariants:

  • Root exists exactly once, at the top-level model root, and nowhere else.
  • all referenced names resolve to declarations present in reachable symbol tables.
  • a combined model well-formedness check that applies all assertions.

Functions§

debug_assert_all_names_resolved
Debug-assert that all names referenced by expressions/domains resolve to declared symbols.
debug_assert_model_well_formed
Debug-assert that a model is well-formed by applying all AST assertions in this module.
debug_assert_root_at_top_level_only
Debug-assert that there is exactly one Root expression, and it is the model’s top-level root.