Expand description
Debug display utilities for AST types with interner access.
This module provides the DisplayWith trait for formatting AST types that
contain interned symbols. Since symbols are just integer IDs, displaying them
requires access to the interner to resolve the actual strings.
Use the .with(interner) method to create a displayable wrapper:
use logicaffeine_base::Interner;
use logicaffeine_language::ast::{LogicExpr, Term};
use logicaffeine_language::debug::DisplayWith;
let mut interner = Interner::new();
let mortal = interner.intern("Mortal");
let socrates = interner.intern("Socrates");
let args = [Term::Constant(socrates)];
let expr = LogicExpr::Predicate { name: mortal, args: &args, world: None };
assert_eq!(expr.with(&interner).to_string(), "Mortal(Socrates)");Structs§
Traits§
- Display
With - Trait for formatting types that require an interner for symbol resolution.
Functions§
- aspect_
symbol - An aspect operator.
- binary_
temporal_ symbol - A binary temporal operator: until, release, weak until.
- connective_
symbol - A connective’s symbol, from the one mapping every printer shares (
Connective::of). - focus_
symbol - A focus particle.
- modal_
symbol - A modal’s operator. The boundary must match the formatter (formatter.rs) and the Kripke lowering (semantics/kripke.rs): force == 0.5 (ability/epistemic can/could/may) is the weak/possibility side (◇), not necessity.
- quantifier_
symbol - A quantifier’s symbol, with its count for the numeric ones (
∃=2,∃≥3). - temporal_
symbol - A tense operator:
Ppast,Ffuture or eventually,Galways,Xnext. - voice_
symbol - A voice operator.