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.
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.
Structs§
- Axiom
Block - A
## Axiomblock: a named first-order axiom in formal notation. - Categorical
Data - Aristotelian categorical proposition data.
- Definition
Block - A
## Defineblock:<definiendum>(params) if and only if <definiens>. - Match
Arm - Match arm for pattern matching in Inspect statements.
- Modal
Vector - Modal operator parameters for Kripke semantics (Kratzer-style).
- NeoEvent
Data - Neo-Davidsonian event structure with thematic roles.
- Noun
Phrase - Parsed noun phrase structure for compositional interpretation.
- Relation
Data - Simple subject-verb-object relation data.
- Secure
Pad - The
with pad "<path>" as <role>binding on aConnect/Listen— activate the PNP one-time-pad session over the pad file atpad, with this peer takingrole. - Theorem
Block - A theorem block containing premises, goal, and proof strategy.
- Theory
Block - A
## Theoryblock: a named development that groups the axioms and theorems that follow it (## Theory Tarski). Its body is the formal development text — a sequence ofAxiom …andTheorem …declarations parsed downstream.
Enums§
- Aspect
Operator - Grammatical aspect operators for event structure.
- Binary
OpKind - Binary operation kinds for imperative expressions.
- Binary
Temporal Op - Binary temporal operators (LTL).
- Comparison
Relation - Degree-comparison relation for
LogicExpr::Comparative. - Compression
Codec - The wire compression codec a
Send compressed [with <codec>]selects. The transpiler maps this to the runtime’s wire codec; barecompressed=Deflate. - Dimension
- Physical dimension for degree semantics and unit tracking.
- Expr
- Shared expression type for pure computations (LOGOS §15.0.0).
- Literal
- Literal values in LOGOS.
- Logic
Expr - First-order logic expression with modal, temporal, and event extensions.
- Logical
Type - Montague semantic types for compositional interpretation.
- Modal
Domain - Modal logic domain classification.
- Modal
Flavor - Modal flavor affecting scope interpretation.
- Number
Kind - Numeric literal representation for degree semantics.
- Proof
Strategy - Proof strategies for theorem verification.
- Quantifier
Kind - Quantifier types for first-order and generalized quantifiers.
- Secure
Role - Imperative statement AST (LOGOS §15.0.0).
- Send
Layout - The wire LAYOUT a
Sendmodifier picks — the size↔speed dial the sender chooses for their link. The transpiler maps this to the runtime’s numeric codec. The sender knows their use case; this lets them express it in one word. - Stmt
- Temporal
Operator - Temporal logic operators.
- Term
- First-order logic term representing entities or values.
- Thematic
Role - Neo-Davidsonian thematic roles for event semantics.
- Type
Expr - Type expression for explicit type annotations.
- Unary
OpKind - Unary logical operators.
- Voice
Operator - Grammatical voice operators.
Type Aliases§
- Block
- Block is a sequence of statements.