[][src]Enum poi::Expr

pub enum Expr {
    Sym(Symbol),
    Ret(Value),
    Op(OpBox<Expr>, Box<Expr>),
    Tup(Vec<Expr>),
    List(Vec<Expr>),
}

Function expression.

Variants

Sym(Symbol)

A symbol that is used together with symbolic knowledge.

Ret(Value)

Some function that returns a value, ignoring the argument.

This can also be used to store values, since zero arguments is a value.

Op(OpBox<Expr>, Box<Expr>)

A binary operation on functions.

Tup(Vec<Expr>)

A tuple for more than one argument.

List(Vec<Expr>)

A list.

Implementations

impl Expr[src]

pub fn equivalences(&self, knowledge: &[Knowledge]) -> Vec<(Expr, usize)>[src]

Returns available equivalences of the expression, using a knowledge base.

pub fn eval(&self, knowledge: &[Knowledge]) -> Result<Expr, Error>[src]

Evaluate an expression using a knowledge base.

This combines reductions and inlining of all symbols.

pub fn reduce_all(&self, knowledge: &[Knowledge]) -> Expr[src]

Reduces an expression using a knowledge base, until it can not be reduces further.

pub fn reduce(&self, knowledge: &[Knowledge]) -> Result<(Expr, usize), Error>[src]

Reduces expression one step using a knowledge base.

pub fn inline_all(&self, knowledge: &[Knowledge]) -> Result<Expr, Error>[src]

Inlines all symbols using a knowledge base.

Ignores missing definitions in domain constraints.

pub fn inline(
    &self,
    sym: &Symbol,
    knowledge: &[Knowledge]
) -> Result<Expr, Error>
[src]

Inline a symbol using a knowledge base.

pub fn has_constraint(&self, arity_level: usize) -> bool[src]

Returns true if has constraints.

Trait Implementations

impl Clone for Expr[src]

impl Debug for Expr[src]

impl Display for Expr[src]

impl Into<Expr> for bool[src]

impl Into<Expr> for f64[src]

impl<T, U> Into<Expr> for (T, U) where
    T: Into<Expr>,
    U: Into<Expr>, 
[src]

impl<T0, T1, T2> Into<Expr> for (T0, T1, T2) where
    T0: Into<Expr>,
    T1: Into<Expr>,
    T2: Into<Expr>, 
[src]

impl Into<Expr> for Symbol[src]

impl Into<Expr> for &'static str[src]

impl PartialEq<Expr> for Expr[src]

impl StructuralPartialEq for Expr[src]

Auto Trait Implementations

impl RefUnwindSafe for Expr

impl Send for Expr

impl Sync for Expr

impl Unpin for Expr

impl UnwindSafe for Expr

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[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.