[−][src]Enum poi::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.
A binary operation on functions.
A tuple for more than one argument.
A list.
Implementations
impl Expr
[src]
pub fn arity(&self) -> Option<usize>
[src]
Returns the arity of an expression.
Unfinished: This function requires analysis and unit testing.
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 contains_nan(&self) -> bool
[src]
Returns true
if expressions contains NaN (not a number).
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_eval_all(&self, knowledge: &[Knowledge], eval: bool) -> 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 reduce_eval(
&self,
knowledge: &[Knowledge],
eval: bool
) -> Result<(Expr, usize), Error>
[src]
&self,
knowledge: &[Knowledge],
eval: bool
) -> Result<(Expr, usize), Error>
Reduces expression one step using a knowledge base.
When eval
is set to true
, the EqvEval
variants are reduced.
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]
&self,
sym: &Symbol,
knowledge: &[Knowledge]
) -> Result<Expr, Error>
Inline a symbol using a knowledge base.
pub fn has_constraint(&self, arity_args: usize) -> bool
[src]
Returns true
if a function has any constraints, false
if there are none constraints.
This is used in the following rules in the standard library, using no_constr
:
∀(f:!{}) => \true
f:!{}([x..]) => f{(: vec)}(x)
f:!{}(a)(a) <=> f{eq}(a)(a)
For example, to detect whether it is safe to insert a new constraint. This check is important because a constraint refers to one or more arguments. By introducing a new constraint that refers incorrectly to its argument, it leads to unsoundness.
A function has none constraints if it is applied enough times to cover existing constraints. This means the total arity of constraints is less or equal than the total arity of arguments.
To avoid unsoundness under uncertain edge cases, this function should return true
.
This is because the no_constr
check fails to pattern match, which is safe,
since inactive rules do not introduce unsoundness.
Unfinished: This function requires analysis and unit testing.
pub fn has_type_judgement(&self) -> bool
[src]
Returns true
if expression has type judgement.
Trait Implementations
impl Add<Expr> for Expr
[src]
type Output = Expr
The resulting type after applying the +
operator.
fn add(self, other: Expr) -> Expr
[src]
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]
T: Into<Expr>,
U: Into<Expr>,
impl<T0, T1, T2> Into<Expr> for (T0, T1, T2) where
T0: Into<Expr>,
T1: Into<Expr>,
T2: Into<Expr>,
[src]
T0: Into<Expr>,
T1: Into<Expr>,
T2: Into<Expr>,
impl Into<Expr> for Symbol
[src]
impl Into<Expr> for &'static str
[src]
impl Mul<Expr> for Expr
[src]
type Output = Expr
The resulting type after applying the *
operator.
fn mul(self, other: Expr) -> Expr
[src]
impl PartialEq<Expr> for Expr
[src]
impl StructuralPartialEq for Expr
[src]
impl Sub<Expr> 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]
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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>,