[][src]Enum poi::Symbol

pub enum Symbol {
    Any,
    Var(Arc<String>),
    ListVar(Arc<String>),
    Singleton(Arc<String>),
    HeadTailTup(Box<Expr>, Box<Expr>),
    HeadTailList(Box<Expr>, Box<Expr>),
    RetVar(Arc<String>),
    BinopRetVar(Arc<String>, Arc<String>, Box<Symbol>),
    UnopRetVar(Arc<String>, Box<Symbol>),
    NoConstrVar(Arc<String>),
    False1,
    Not,
    Idb,
    True1,
    False2,
    True2,
    And,
    Or,
    Eqb,
    Xor,
    Nand,
    Nor,
    Exc,
    Imply,
    Fstb,
    Sndb,
    Even,
    Odd,
    Lt,
    Le,
    Gt,
    Ge,
    Neg,
    Add,
    Sub,
    Mul,
    Div,
    Rem,
    Pow,
    Rpow,
    Sqrt,
    Ln,
    Log2,
    Log10,
    Exp,
    Len,
    Concat,
    Sum,
    Min2,
    Max2,
    Min,
    Max,
    MulMat,
    Det,
    Dim,
    Fst,
    Snd,
    Sin,
    Asin,
    Cos,
    Acos,
    Tan,
    Atan,
    Atan2,
    Dot,
    Push,
    PushFront,
    El,
    Id,
    Eq,
    Neq,
    If,
    Ex,
    Triv,
    RetType,
    VecType,
    Rty,
    VecOp,
}

Contains symbols and operators on symbols.

Variants

Any

The wildcard symbol _.

Var(Arc<String>)

A variable bound from context.

This can be anything.

ListVar(Arc<String>)

A list variable.

Singleton(Arc<String>)

A list variable of length 1.

Lifts the value out of the list at binding.

HeadTailTup(Box<Expr>, Box<Expr>)

A head-tail pattern match on a tuple.

This requires the tuple to have at least length 2. It is to avoid cycles between reductions.

HeadTailList(Box<Expr>, Box<Expr>)

A head-tail pattern match on a list.

This requires the list to have at least length 2. It is to avoid cycles between reductions.

RetVar(Arc<String>)

A value variable.

This requires the expression to be Ret variant. It is used in special rules such as (\k)(x) => \k.

BinopRetVar(Arc<String>, Arc<String>, Box<Symbol>)

Compute a binary function.

This is used when the right side of the rule computes something from two left side expressions.

UnopRetVar(Arc<String>, Box<Symbol>)

Compute a unary function.

This is used when the right side of the rule computes something from a left side expression.

NoConstrVar(Arc<String>)

A function without domain constraints.

False1

\false for one argument.

Not

not.

Idb

id for booleans.

True1

\true for one argument.

False2

\false for two arguments.

True2

\true for two arguments.

And

and.

Or

or.

Eqb

eq for booleans.

Xor

xor.

Nand

nand.

Nor

nor.

Exc

exc.

Imply

imply.

Fstb

fst for booleans.

Sndb

snd for booleans.

Even

even.

Odd

odd.

Lt

lt.

Le

le.

Gt

gt.

Ge

ge.

Neg

neg.

Add

add.

Sub

sub.

Mul

mul.

Div

div.

Rem

rem.

Pow

pow.

Rpow

rpow.

Sqrt

sqrt.

Ln

ln.

Log2

log2.

Log10

log10.

Exp

exp.

Len

len.

Concat

concat.

Sum

sum.

Min2

min2.

Max2

max2.

Min

min.

Max

max.

MulMat

mul_mat.

Det

det.

Dim

dim.

Fst

fst.

Snd

snd.

Sin

sin.

Asin

asin.

Cos

cos.

Acos

acos.

Tan

tan.

Atan

atan.

Atan2

atan2.

Dot

dot.

Push

push.

PushFront

push_front.

El

el.

Id

Generic id.

Eq

Generic eq.

Neq

Generic neq.

If

if.

This is used in Boolean functions.

Ex

Existential path .

Triv

Trivial path .

RetType

\, the type of \x.

VecType

The type of lists.

Rty

The judgement (: a)(b).

VecOp

Applies a function component-wise to lists.

Implementations

impl Symbol[src]

pub fn arity(&self) -> Option<usize>[src]

Returns the arity of a symbol.

Trait Implementations

impl Clone for Symbol[src]

impl Debug for Symbol[src]

impl Display for Symbol[src]

impl Into<Expr> for Symbol[src]

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

impl PartialEq<Symbol> for Symbol[src]

impl StructuralPartialEq for Symbol[src]

Auto Trait Implementations

impl RefUnwindSafe for Symbol

impl Send for Symbol

impl Sync for Symbol

impl Unpin for Symbol

impl UnwindSafe for Symbol

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.