logicaffeine_language/ast/mod.rs
1//! Abstract Syntax Tree types for both logical expressions and imperative statements.
2//!
3//! This module defines the core AST types produced by the parser and consumed by
4//! the transpiler, interpreter, and verifier. It is split into three submodules:
5//!
6//! - [`logic`]: First-order logic expressions (predicates, quantifiers, connectives)
7//! - [`stmt`]: Imperative statements (let bindings, if/match, loops, function defs)
8//! - [`theorem`]: Theorem and proof blocks for the vernacular proof language
9//!
10//! # Logic Expressions ([`LogicExpr`])
11//!
12//! The logical fragment includes:
13//! - Predicates with terms: `Predicate { name, args, world }`
14//! - Quantifiers: `∀x`, `∃x` with island tracking for scope
15//! - Connectives: `∧`, `∨`, `→`, `↔`, `¬`
16//! - Modal operators: `□`, `◇` with Kripke semantics
17//! - Lambda terms: `λx.body` for compositional semantics
18//! - Neo-Davidsonian events: `NeoEvent` with thematic roles
19//!
20//! # Imperative Statements ([`Stmt`])
21//!
22//! The imperative fragment (LOGOS mode) includes:
23//! - Let bindings with optional type annotations
24//! - Control flow: if/else, match, while/for
25//! - Function definitions with refinement types
26//! - Assert/require/ensure for specification
27//!
28//! # Arena Allocation
29//!
30//! All AST nodes are arena-allocated using `bumpalo` for efficient memory management.
31//! The `'a` lifetime parameter tracks the arena lifetime.
32
33pub mod logic;
34pub mod stmt;
35pub mod theorem;
36
37pub use logic::*;
38pub use stmt::{Stmt, Expr, Literal, Block, BinaryOpKind, TypeExpr, MatchArm};
39pub use theorem::{TheoremBlock, ProofStrategy};