[−][src]Struct smt2::typing::TypeChecker
Implementations
impl<S: Sort> TypeChecker<S>
[src]
pub fn new() -> TypeChecker<S>
[src]
pub fn new_type_variable(&mut self, span: Span) -> TypeRef<S>
[src]
pub fn new_attached_type_variable(
&mut self,
span: Span,
pointer: *mut Option<GroundSort<S>>
) -> TypeRef<S>
[src]
&mut self,
span: Span,
pointer: *mut Option<GroundSort<S>>
) -> TypeRef<S>
pub fn assert_equal<A: Into<TypeRef<S>>, B: Into<TypeRef<S>>>(
&mut self,
expected: A,
given: B
)
[src]
&mut self,
expected: A,
given: B
)
Add a new constraint to the type checker.
Even of the system is not satisfiable, this function never fail.
Type errors are detected with the TypeChecker::resolve
method.
pub fn var(&self, index: usize) -> &TypeRef<S>
[src]
pub fn push<T: Into<TypeRef<S>>>(&mut self, ty: T)
[src]
pub fn pop(&mut self, len: usize)
[src]
pub fn enter(&mut self, span: Span)
[src]
pub fn leave(&mut self)
[src]
pub fn location(&self) -> Span
[src]
pub fn representant(&self, id: usize) -> (usize, TypeRef<S>)
[src]
pub fn redirected(&self, ty: &TypeRef<S>) -> TypeRef<S>
[src]
pub fn unify(
&self,
expected: TypeRef<S>,
given: TypeRef<S>,
root: bool,
span: Span
) -> Result<(TypeRef<S>, Vec<Constraint<S>>), SortMissmatch<S>>
[src]
&self,
expected: TypeRef<S>,
given: TypeRef<S>,
root: bool,
span: Span
) -> Result<(TypeRef<S>, Vec<Constraint<S>>), SortMissmatch<S>>
pub fn resolve(&mut self) -> Result<(), S>
[src]
Resolve all the constraints.
pub unsafe fn apply(&self) -> Result<(), S>
[src]
Apply the resolved types.
Auto Trait Implementations
impl<S> RefUnwindSafe for TypeChecker<S> where
S: RefUnwindSafe,
S: RefUnwindSafe,
impl<S> !Send for TypeChecker<S>
impl<S> !Sync for TypeChecker<S>
impl<S> Unpin for TypeChecker<S> where
S: Unpin,
S: Unpin,
impl<S> UnwindSafe for TypeChecker<S> where
S: RefUnwindSafe + UnwindSafe,
S: RefUnwindSafe + UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,