pub struct FunctionInterpretation {
pub name: Spur,
pub arity: usize,
pub domain: SmallVec<[SortId; 4]>,
pub range: SortId,
pub entries: Vec<FunctionEntry>,
pub else_value: Option<TermId>,
pub projections: Vec<Option<ProjectionFunctionDef>>,
}Expand description
A function interpretation (finite representation of function mapping)
Fields§
§name: SpurFunction name
arity: usizeArity
domain: SmallVec<[SortId; 4]>Domain sorts
range: SortIdRange sort
entries: Vec<FunctionEntry>Explicit entries (args -> result)
else_value: Option<TermId>Default/else value (for arguments not in entries)
projections: Vec<Option<ProjectionFunctionDef>>Projection functions for arguments (if any)
Implementations§
Source§impl FunctionInterpretation
impl FunctionInterpretation
Sourcepub fn new(name: Spur, domain: SmallVec<[SortId; 4]>, range: SortId) -> Self
pub fn new(name: Spur, domain: SmallVec<[SortId; 4]>, range: SortId) -> Self
Create a new function interpretation
Sourcepub fn add_entry(&mut self, args: Vec<TermId>, result: TermId)
pub fn add_entry(&mut self, args: Vec<TermId>, result: TermId)
Add an entry to the function table
Sourcepub fn is_constant(&self) -> bool
pub fn is_constant(&self) -> bool
Check if this is a constant function
Sourcepub fn is_partial(&self) -> bool
pub fn is_partial(&self) -> bool
Check if the interpretation is partial (missing else value or entries)
Sourcepub fn max_occurrence_result(&self) -> Option<TermId>
pub fn max_occurrence_result(&self) -> Option<TermId>
Get the most common result value
Trait Implementations§
Source§impl Clone for FunctionInterpretation
impl Clone for FunctionInterpretation
Source§fn clone(&self) -> FunctionInterpretation
fn clone(&self) -> FunctionInterpretation
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for FunctionInterpretation
impl RefUnwindSafe for FunctionInterpretation
impl Send for FunctionInterpretation
impl Sync for FunctionInterpretation
impl Unpin for FunctionInterpretation
impl UnwindSafe for FunctionInterpretation
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
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>
Converts
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>
Converts
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