Skip to main content

Module template

Module template 

Source
Expand description

Template expansion engine (REQ-100, REQ-101).

Mirrors TemplateExpansion.lean from the Lean 4 proof library.

Supports the following template forms:

  • Plain expressions: substitute bindings into the expression
  • (literal expr): substitute bindings and return the inner expression
  • (cond (test body) ... (else body)): conditional branching
  • (= var value): equality predicate
  • (member var (values...)): membership predicate
  • (type? var type-name): type predicate (number, string, agent)
  • Sequence templates: outer list of template forms producing multiple outputs

Enums§

ExpandedTemplate
Result of template expansion: either a single expression or a sequence.

Functions§

eval_type_predicate
Evaluate a type predicate: (type? var type-name).
expand_template
Expand a template with argument substitutions (REQ-100).
expand_template_with_bindings
Expand a template with named bindings (REQ-100).

Type Aliases§

Bindings
Named bindings for template expansion: symbol name → value.