[][src]Struct kontroli::Signature

pub struct Signature<Sym, Pat, Tm> {
    pub types: HashMap<Sym, Tm, FnvBuildHasher>,
    pub rules: HashMap<Sym, Vec<Rule<String, Application<Sym, Pat>, Tm>>, FnvBuildHasher>,
    pub eta: bool,
}

Map from symbols to their associated types and rewrite rules.

Furthermore, set whether convertibility should be checked modulo eta.

Fields

types: HashMap<Sym, Tm, FnvBuildHasher>rules: HashMap<Sym, Vec<Rule<String, Application<Sym, Pat>, Tm>>, FnvBuildHasher>eta: bool

Implementations

impl<Sym: Clone + Eq + Hash, Pat: Clone, Tm: Clone> Signature<Sym, Pat, Tm>[src]

pub fn new() -> Self[src]

Construct an empty signature without eta modularity.

let sig = Signature::new();
assert!(sig.eta == false);

pub fn add_rule(
    &mut self,
    rule: Rule<String, Application<Sym, Pat>, Tm>
) -> Result<(), Error>
[src]

Add a rewrite rule to an existing symbol.

pub fn add_rules<I>(&mut self, rules: I) -> Result<(), Error> where
    I: Iterator<Item = Rule<String, Application<Sym, Pat>, Tm>>, 
[src]

Add several rewrite rules.

pub fn insert(&mut self, sym: Sym, typing: Typing<Tm>) -> Result<(), Error>[src]

Introduce a new symbol with given typing.

Trait Implementations

impl<Sym: Clone, Pat: Clone, Tm: Clone> Clone for Signature<Sym, Pat, Tm>[src]

impl<Sym, Pat, Tm> Default for Signature<Sym, Pat, Tm>[src]

Auto Trait Implementations

impl<Sym, Pat, Tm> RefUnwindSafe for Signature<Sym, Pat, Tm> where
    Pat: RefUnwindSafe,
    Sym: RefUnwindSafe,
    Tm: RefUnwindSafe

impl<Sym, Pat, Tm> Send for Signature<Sym, Pat, Tm> where
    Pat: Send + Sync,
    Sym: Send + Sync,
    Tm: Send + Sync

impl<Sym, Pat, Tm> Sync for Signature<Sym, Pat, Tm> where
    Pat: Send + Sync,
    Sym: Send + Sync,
    Tm: Send + Sync

impl<Sym, Pat, Tm> Unpin for Signature<Sym, Pat, Tm> where
    Pat: Unpin,
    Sym: Unpin,
    Tm: Unpin

impl<Sym, Pat, Tm> UnwindSafe for Signature<Sym, Pat, Tm> where
    Pat: RefUnwindSafe + UnwindSafe,
    Sym: RefUnwindSafe + UnwindSafe,
    Tm: 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> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.