pub struct NelsonOppenCombiner { /* private fields */ }Expand description
Nelson-Oppen theory combination engine.
Implementations§
Source§impl NelsonOppenCombiner
impl NelsonOppenCombiner
Register a shared term between theories.
Sourcepub fn assert_equality(&mut self, lhs: TermId, rhs: TermId) -> Result<(), ()>
pub fn assert_equality(&mut self, lhs: TermId, rhs: TermId) -> Result<(), ()>
Assert an equality between shared terms.
Returns Ok(()) if consistent, Err(()) if conflict detected.
Sourcepub fn purify_term(
&mut self,
term_id: TermId,
tm: &mut TermManager,
) -> Result<TermId, String>
pub fn purify_term( &mut self, term_id: TermId, tm: &mut TermManager, ) -> Result<TermId, String>
Purify a term by introducing fresh variables for sub-terms.
Purification ensures each theory sees only its own symbols. When a subterm belongs to a different theory than the parent application, it is replaced by a fresh shared variable, and an equality constraint is recorded between the fresh variable and the original subterm.
Sourcepub fn get_pending_equalities(&mut self) -> Vec<(TermId, TermId)>
pub fn get_pending_equalities(&mut self) -> Vec<(TermId, TermId)>
Get pending equalities to propagate to theories.
Sourcepub fn are_equal(&self, lhs: TermId, rhs: TermId) -> bool
pub fn are_equal(&self, lhs: TermId, rhs: TermId) -> bool
Check if two terms are in the same equivalence class.
Sourcepub fn get_equivalence_class(&self, term_id: TermId) -> Vec<TermId>
pub fn get_equivalence_class(&self, term_id: TermId) -> Vec<TermId>
Get all terms in the equivalence class of a term.
Sourcepub fn convexity_closure(&mut self) -> Vec<(TermId, TermId)>
pub fn convexity_closure(&mut self) -> Vec<(TermId, TermId)>
Convexity closure: generate implied equalities.
For convex theories, if we have equalities in each class, we must propagate all pairwise equalities. Only returns equalities that have NOT already been propagated.
Sourcepub fn stats(&self) -> &NelsonOppenStats
pub fn stats(&self) -> &NelsonOppenStats
Get statistics.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NelsonOppenCombiner
impl RefUnwindSafe for NelsonOppenCombiner
impl Send for NelsonOppenCombiner
impl Sync for NelsonOppenCombiner
impl Unpin for NelsonOppenCombiner
impl UnsafeUnpin for NelsonOppenCombiner
impl UnwindSafe for NelsonOppenCombiner
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more