Architecture¶
Five passes take a .tree file to a backend artefact.
Parse – TextX applies the grammar in
src/behaverify/data/metamodel/behaverify.tx.Validate –
behaverify.check_grammarperforms static checks (type / scope / reachability).Build IR –
behaverify.node_creatorconstructs the internal node tree.Meta-compile expressions –
behaverify.meta_functionslowers prefix-notation expressions to per-backend expression trees.Generate – a
dsl_to_<mode>.pymodule walks the IR and emits the artefact.
Module map¶
File |
Responsibility |
|---|---|
|
CLI entry point; mode dispatch. |
|
Static validation (types, scope, references). |
|
DSL model → internal node tree. |
|
Expression IR and meta-compilation. |
|
ONNX → expression IR. |
|
SMV generator (fastforwarding + naive encodings). |
|
|
|
BT.CPP-compatible C++ generator. |
|
Pure Haskell generator. |
|
TikZ diagram generator. |
|
Trace rendering. |
API reference¶
The full auto-generated API reference lives under
API Reference (built with sphinx-autoapi).
Dataflow¶
flowchart TD
A[.tree file] --> B[TextX parser]
B --> C[check_grammar.validate_model]
C --> D[node_creator.build_model]
D --> E[meta_functions lowering]
E --> F1[dsl_to_nuxmv]
E --> F2[dsl_to_python]
E --> F3[dsl_to_cpp]
E --> F4[dsl_to_haskell]
E --> F5[dsl_to_latex]
F1 --> G1[.smv model]
F2 --> G2[py_trees .py]
F3 --> G3[BT.CPP .cpp/.h]
F4 --> G4[Haskell .hs]
F5 --> G5[TikZ .tex]
Every backend receives the same IR, so adding a mode does not require changes to the parser or the IR builder – see Adding a Generation Mode.