[][src]Struct smt2::typing::TypeChecker

pub struct TypeChecker<S: Sort> { /* fields omitted */ }

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]

pub fn assert_equal<A: Into<TypeRef<S>>, B: Into<TypeRef<S>>>(
    &mut self,
    expected: A,
    given: B
)
[src]

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]

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

impl<S> !Send for TypeChecker<S>

impl<S> !Sync for TypeChecker<S>

impl<S> Unpin for TypeChecker<S> where
    S: Unpin

impl<S> UnwindSafe for TypeChecker<S> where
    S: RefUnwindSafe + UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.