pub struct TypeInfo { /* private fields */ }Expand description
Stores resolved typechecking information.
Implementations§
Source§impl TypeInfo
impl TypeInfo
Sourcepub fn add_presort<S: Presort>(&mut self, span: Span) -> Result<(), TypeError>
pub fn add_presort<S: Presort>(&mut self, span: Span) -> Result<(), TypeError>
Adds a sort constructor to the typechecker’s known set of types.
Sourcepub fn get_sorts_by<S: Sort>(
&self,
pred: impl Fn(&Arc<S>) -> bool,
) -> Vec<Arc<S>>
pub fn get_sorts_by<S: Sort>( &self, pred: impl Fn(&Arc<S>) -> bool, ) -> Vec<Arc<S>>
Returns all sorts that satisfy the type and predicate.
Sourcepub fn get_sort_by<S: Sort>(&self, pred: impl Fn(&Arc<S>) -> bool) -> Arc<S>
pub fn get_sort_by<S: Sort>(&self, pred: impl Fn(&Arc<S>) -> bool) -> Arc<S>
Returns a sort that satisfies the type and predicate.
Sourcepub fn get_arcsorts_by(&self, f: impl Fn(&ArcSort) -> bool) -> Vec<ArcSort> ⓘ
pub fn get_arcsorts_by(&self, f: impl Fn(&ArcSort) -> bool) -> Vec<ArcSort> ⓘ
Returns all sorts that satisfy the predicate.
Sourcepub fn get_arcsort_by(&self, f: impl Fn(&ArcSort) -> bool) -> ArcSort
pub fn get_arcsort_by(&self, f: impl Fn(&ArcSort) -> bool) -> ArcSort
Returns a sort based on the predicate.
Sourcepub fn get_arcsort_for_value_type<T: 'static>(&self) -> ArcSort
pub fn get_arcsort_for_value_type<T: 'static>(&self) -> ArcSort
Returns the unique sort whose runtime values have Rust type T.
Sourcepub fn is_sort_unionable(&self, sort: &ArcSort) -> bool
pub fn is_sort_unionable(&self, sort: &ArcSort) -> bool
Check if a sort allows union operations.
A sort is unionable if it’s an eq_sort and not marked as non-unionable
(e.g., from (sort Foo :no-union) or relation desugaring).
pub fn typecheck_facts( &self, symbol_gen: &mut SymbolGen, facts: &[Fact], ) -> Result<Vec<ResolvedFact>, TypeError>
pub fn get_sort_by_name(&self, sym: &str) -> Option<&ArcSort>
pub fn get_prims(&self, sym: &str) -> Option<&[PrimitiveWithId]>
pub fn is_primitive(&self, sym: &str) -> bool
pub fn primitive_has_validator(&self, id: ExternalFunctionId) -> bool
Sourcepub fn get_func_type(&self, sym: &str) -> Option<&Arc<FuncType>>
pub fn get_func_type(&self, sym: &str) -> Option<&Arc<FuncType>>
The shared signature declared for sym, or None if no function with
that name is declared. Clone it to keep it past the borrow.
pub fn is_constructor(&self, sym: &str) -> bool
pub fn get_global_sort(&self, sym: &str) -> Option<&ArcSort>
pub fn is_global(&self, sym: &str) -> bool
Sourcepub fn expr_has_function_lookup(&self, expr: &ResolvedExpr) -> Option<Span>
pub fn expr_has_function_lookup(&self, expr: &ResolvedExpr) -> Option<Span>
Check if an expression contains non-global function lookups (FunctionSubtype::Custom calls). Global function calls are allowed since they get desugared to constructors. Returns Some(span) if a lookup is found, None otherwise.