pub struct CompletedModel {
pub assignments: FxHashMap<TermId, TermId>,
pub function_interps: FxHashMap<Spur, FunctionInterpretation>,
pub universes: FxHashMap<SortId, Vec<TermId>>,
pub defaults: FxHashMap<SortId, TermId>,
pub generation: u32,
}Expand description
A completed model that assigns values to all relevant terms
Fields§
§assignments: FxHashMap<TermId, TermId>Term assignments (term -> value)
function_interps: FxHashMap<Spur, FunctionInterpretation>Function interpretations
universes: FxHashMap<SortId, Vec<TermId>>Universes for uninterpreted sorts (sort -> finite set of values)
defaults: FxHashMap<SortId, TermId>Default values for each sort
generation: u32Generation number
Implementations§
Source§impl CompletedModel
impl CompletedModel
Sourcepub fn add_to_universe(&mut self, sort: SortId, value: TermId)
pub fn add_to_universe(&mut self, sort: SortId, value: TermId)
Add a value to a sort’s universe
Sourcepub fn default_value(&self, sort: SortId) -> Option<TermId>
pub fn default_value(&self, sort: SortId) -> Option<TermId>
Get the default value for a sort
Sourcepub fn set_default(&mut self, sort: SortId, value: TermId)
pub fn set_default(&mut self, sort: SortId, value: TermId)
Set the default value for a sort
Sourcepub fn has_uninterpreted_sort(&self, sort: SortId) -> bool
pub fn has_uninterpreted_sort(&self, sort: SortId) -> bool
Check if a sort has an uninterpreted universe
Sourcepub fn eval_apply(
&self,
func: Spur,
evaluated_args: &[TermId],
) -> Option<TermId>
pub fn eval_apply( &self, func: Spur, evaluated_args: &[TermId], ) -> Option<TermId>
Evaluate a function application f(v1, …, vn) under this model.
First evaluates each argument to its model value, then looks up the function interpretation table. Falls back to else_value or sort default.
Sourcepub fn collect_universes_from_model(
&mut self,
quantifiers: &[QuantifiedFormula],
manager: &TermManager,
)
pub fn collect_universes_from_model( &mut self, quantifiers: &[QuantifiedFormula], manager: &TermManager, )
Collect the finite universe for each sort appearing in bound variables of the given quantifiers, by scanning ground terms in the current model.
For interpreted sorts (Int, Real, Bool, BV), collects values that actually appear in the model assignments. For uninterpreted sorts, uses existing universe or creates one from model values.
Sourcepub fn complete_function_interpretations(&mut self)
pub fn complete_function_interpretations(&mut self)
Complete all function interpretations by ensuring they have an else_value.
For each function f: S1 x … x Sn -> S that appears in the model:
- If it has explicit entries but no else_value, set else_value to the most common result value (or the sort default).
- If it has no entries at all, set else_value to the sort default.
IMPORTANT: For functions with EXPLICIT entries (finite interpretation from ground assertions), do NOT set else_value. Using “most common result” as else_value is unsound: it makes f(v) evaluate to a wrong value when v is not in the explicit entries, causing MBQI to generate a spurious False evaluation and add an empty SAT clause.
Only set else_value for completely uninterpreted functions (no entries).
Trait Implementations§
Source§impl Clone for CompletedModel
impl Clone for CompletedModel
Source§fn clone(&self) -> CompletedModel
fn clone(&self) -> CompletedModel
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CompletedModel
impl Debug for CompletedModel
Auto Trait Implementations§
impl Freeze for CompletedModel
impl RefUnwindSafe for CompletedModel
impl Send for CompletedModel
impl Sync for CompletedModel
impl Unpin for CompletedModel
impl UnsafeUnpin for CompletedModel
impl UnwindSafe for CompletedModel
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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