pub struct RustFormatter;Expand description
Formatter that produces Rust boolean expressions for runtime assertions. Used by codegen to convert LogicExpr into debug_assert!() compatible code.
Trait Implementations§
Source§impl LogicFormatter for RustFormatter
impl LogicFormatter for RustFormatter
fn and(&self) -> &'static str
fn or(&self) -> &'static str
fn not(&self) -> &'static str
fn implies(&self) -> &'static str
fn iff(&self) -> &'static str
fn identity(&self) -> &'static str
fn wrap_identity(&self) -> bool
fn use_full_names(&self) -> bool
fn preserve_case(&self) -> bool
fn universal(&self) -> String
fn existential(&self) -> String
fn cardinal(&self, n: u32) -> String
fn at_least(&self, n: u32) -> String
fn at_most(&self, n: u32) -> String
fn necessity(&self) -> &'static str
fn possibility(&self) -> &'static str
fn past(&self) -> &'static str
fn future(&self) -> &'static str
fn progressive(&self) -> &'static str
fn perfect(&self) -> &'static str
fn habitual(&self) -> &'static str
fn iterative(&self) -> &'static str
fn passive(&self) -> &'static str
fn categorical_all(&self) -> &'static str
fn categorical_no(&self) -> &'static str
fn categorical_some(&self) -> &'static str
fn categorical_not(&self) -> &'static str
fn lambda(&self, var: &str, body: &str) -> String
fn counterfactual(&self, a: &str, c: &str) -> String
fn superlative(&self, _: &str, _: &str, _: &str) -> String
Source§fn write_comparative<W: Write>(
&self,
w: &mut W,
adjective: &str,
subject: &str,
object: &str,
_difference: Option<&str>,
) -> Result
fn write_comparative<W: Write>( &self, w: &mut W, adjective: &str, subject: &str, object: &str, _difference: Option<&str>, ) -> Result
Hook for customizing how comparatives are rendered.
Default implementation uses standard logic notation: tallER(subj, obj) or tallER(subj, obj, diff)
fn unary_op(&self, op: &TokenType, operand: &str) -> String
fn binary_op(&self, op: &TokenType, left: &str, right: &str) -> String
Source§fn write_predicate<W: Write>(
&self,
w: &mut W,
name: &str,
args: &[Term<'_>],
_registry: &mut SymbolRegistry,
interner: &Interner,
) -> Result
fn write_predicate<W: Write>( &self, w: &mut W, name: &str, args: &[Term<'_>], _registry: &mut SymbolRegistry, interner: &Interner, ) -> Result
Hook for customizing how predicates are rendered.
Default implementation uses standard logic notation: Name(Arg1, Arg2)
fn quantifier(&self, kind: &QuantifierKind, var: &str, body: &str) -> String
fn modal(&self, domain: ModalDomain, force: f32, body: &str) -> String
fn temporal(&self, op: &TemporalOperator, body: &str) -> String
fn aspectual(&self, op: &AspectOperator, body: &str) -> String
fn voice(&self, op: &VoiceOperator, body: &str) -> String
fn event_quantifier(&self, pred: &str, adverbs: &[String]) -> String
fn sanitize(&self, s: &str) -> String
fn use_simple_events(&self) -> bool
fn include_world_arguments(&self) -> bool
Auto Trait Implementations§
impl Freeze for RustFormatter
impl RefUnwindSafe for RustFormatter
impl Send for RustFormatter
impl Sync for RustFormatter
impl Unpin for RustFormatter
impl UnwindSafe for RustFormatter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more