Expand description
Abstract Syntax Tree types for both logical expressions and imperative statements.
This module defines the core AST types produced by the parser and consumed by the transpiler, interpreter, and verifier. It is split into three submodules:
logic: First-order logic expressions (predicates, quantifiers, connectives)stmt: Imperative statements (let bindings, if/match, loops, function defs)theorem: Theorem and proof blocks for the vernacular proof language
§Logic Expressions (LogicExpr)
The logical fragment includes:
- Predicates with terms:
Predicate { name, args, world } - Quantifiers:
∀x,∃xwith island tracking for scope - Connectives:
∧,∨,→,↔,¬ - Modal operators:
□,◇with Kripke semantics - Lambda terms:
λx.bodyfor compositional semantics - Neo-Davidsonian events:
NeoEventwith thematic roles
§Imperative Statements (Stmt)
The imperative fragment (LOGOS mode) includes:
- Let bindings with optional type annotations
- Control flow: if/else, match, while/for
- Function definitions with refinement types
- Assert/require/ensure for specification
§Arena Allocation
All AST nodes are arena-allocated using bumpalo for efficient memory management.
The 'a lifetime parameter tracks the arena lifetime.
Re-exports§
pub use axiom::AxiomBlock;pub use axiom::TheoryBlock;pub use definition::DefinitionBlock;pub use stmt::Stmt;pub use stmt::Expr;pub use stmt::Literal;pub use stmt::Block;pub use stmt::BinaryOpKind;pub use stmt::CompressionCodec;pub use stmt::SendLayout;pub use stmt::TypeExpr;pub use stmt::MatchArm;pub use stmt::SecurePad;pub use stmt::SecureRole;pub use theorem::TheoremBlock;pub use theorem::ProofStrategy;pub use logic::*;
Modules§
- axiom
- AST nodes for the formal-logic vernacular:
## Axiomand## Theoryblocks. - definition
## Defineblock AST — a vernacular-logic predicate definition (Rung 0a).- logic
- Logic expression AST types for first-order logic with modal and event extensions.
- stmt
- Imperative statement AST types for the LOGOS language.
- theorem
- Theorem and proof block AST types.