pub struct SemanticCompiler {
pub interner: Rodeo,
pub var_counter: usize,
pub errors: Vec<String>,
/* private fields */
}Expand description
Stateful compiler that transforms flat AST buffers into FOL logic forms.
Maintains a string interner, fresh variable counter, and context state for
relative clauses, ka-abstractions, and ma query variables. Accumulated
errors are checked after compilation.
Fields§
§interner: RodeoString interner for relation names and variable names.
var_counter: usizeMonotonically increasing counter for generating fresh variable names.
errors: Vec<String>Accumulated semantic errors (e.g., ambiguous inject_variable). Checked after compilation; if non-empty, compile_buffer returns error.
Implementations§
Source§impl SemanticCompiler
impl SemanticCompiler
Sourcepub fn compile_proposition(
&mut self,
proposition: &Proposition,
predicates: &[Predicate],
arguments: &[Argument],
sentences: &[Sentence],
) -> IrForm
pub fn compile_proposition( &mut self, proposition: &Proposition, predicates: &[Predicate], arguments: &[Argument], sentences: &[Sentence], ) -> IrForm
Compiles a proposition (predication) into FOL with quantifier scoping and tense wrapping.
Auto Trait Implementations§
impl Freeze for SemanticCompiler
impl RefUnwindSafe for SemanticCompiler
impl Send for SemanticCompiler
impl Sync for SemanticCompiler
impl Unpin for SemanticCompiler
impl UnsafeUnpin for SemanticCompiler
impl UnwindSafe for SemanticCompiler
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