[][src]Enum poi::Symbol

pub enum Symbol {
    Any,
    Var(Arc<String>),
    ArityVar(Arc<String>, usize),
    ListVar(Arc<String>),
    Singleton(Arc<String>),
    HeadTailTup(Box<Expr>, Box<Expr>),
    HeadTailList(Box<Expr>, Box<Expr>),
    RetVar(Arc<String>),
    RetIntVar(Arc<String>),
    RetPosVar(Arc<String>),
    RetStrictPosVar(Arc<String>),
    RetNegVar(Arc<String>),
    NotRetVar(Arc<String>),
    BinopRetVar(Arc<String>, Arc<String>, Box<Symbol>),
    TernopRetVar(Arc<String>, 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,
    Abs,
    Lt,
    Rlt,
    Le,
    Rle,
    Gt,
    Rgt,
    Ge,
    Rge,
    Neg,
    Inc,
    Reci,
    Conj,
    Norm,
    Sqnorm,
    Add,
    Sub,
    Rsub,
    Mul,
    Mulc,
    Div,
    Rdiv,
    Rem,
    Pow,
    Rpow,
    Sqrt,
    Ln,
    Log2,
    Log10,
    Exp,
    Len,
    Concat,
    Sum,
    Min2,
    Max2,
    Min,
    Max,
    Range,
    Rangel,
    Ranger,
    Rangem,
    Prob,
    Probl,
    Probr,
    Probm,
    MulMat,
    Col,
    Det,
    Dim,
    Transpose,
    IsSquareMat,
    Base,
    Fst,
    Snd,
    Sin,
    Asin,
    Cos,
    Acos,
    Tan,
    Atan,
    Atan2,
    Dot,
    Push,
    PushFront,
    Item,
    El,
    Re,
    Im,
    Id,
    Eq,
    Neq,
    Inv,
    Deriv,
    Integ,
    If,
    Ex,
    Triv,
    RetType,
    VecType,
    Rty,
    VecOp,
    VecUop,
    Arity,
    Pi,
    Tau,
    Eps,
    Imag,
    Imag2,
    Imag3,
    TypeOf,
    BoolType,
    F64Type,
    QuatType,
    Inf,
}

Contains symbols and operators on symbols.

Variants

Any

The wildcard symbol _.

Var(Arc<String>)

A variable bound from context.

This can be anything.

ArityVar(Arc<String>, usize)

A function variable with specified arity (number of arguments).

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.

RetIntVar(Arc<String>)

A value variable that is an integer.

RetPosVar(Arc<String>)

A value variable that is positive or zero.

RetStrictPosVar(Arc<String>)

A value that is strictly positive (non-zero).

RetNegVar(Arc<String>)

A value variable that is negative and non-zero.

Binds to its positive value.

NotRetVar(Arc<String>)

A variable that is not a value variable.

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.

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

Compute a ternary function.

This is used when the right side of the rule computes something from three 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.

Abs

abs.

Lt

lt.

Rlt

(< _)(_).

Le

le.

Rle

(<= _)(_).

Gt

gt.

Rgt

(> _)(_).

Ge

ge.

Rge

(>= _)(_).

Neg

neg.

Inc

inc.

Reci

reci (reciprocal).

Conj

conj (complex conjugate).

Norm

norm (vector norm).

Sqnorm

sqnorm (vector square norm).

Add

add.

Sub

sub.

Rsub

(- _)(_)

Mul

mul.

Mulc

mulc (complex multiplication).

Div

div.

Rdiv

(/ _)(_)

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.

Range

range [a, b].

Rangel

rangel [a, b).

Ranger

ranger (a, b].

Rangem

rangem (a, b).

Prob

prob [0, 1].

Probl

probl [0, 1).

Probr

probr (0, 1].

Probm

probm (0, 1).

MulMat

mul_mat.

Col

col (index, matrix).

Looks up column vector by index in a matrix.

Det

det.

Dim

dim.

Transpose

transpose.

IsSquareMat

is_square_mat,

Base

base (len, index).

Constructs a list with zeroes of specified length, but with 1 at the index.

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.

Item

item (index, list).

El

el.

Re

re.

Im

im.

Id

Generic id.

Eq

Generic eq.

Neq

Generic neq.

Inv

Function inverse inv.

Deriv

Derivative.

Integ

Integral.

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

vec_op.

Applies a binary function component-wise to lists.

VecUop

vec_uop.

Applies a unary function component-wise to lists.

Arity

arity.

Pi

pi or π.

Tau

tau or τ.

Eps

eps or ε.

Imag

imag (complex imaginary base).

Imag2

imag2 (second complex imaginary base for quaternions).

Imag3

imag3 (third complex imaginary base for quaternions).

TypeOf

type_of.

BoolType

bool.

F64Type

f64.

QuatType

quat (type of quaternions).

Inf

inf (infinity).

Implementations

impl Symbol[src]

pub fn precedence(&self) -> Option<u8>[src]

Returns the operator presedence of symbol.

impl Symbol[src]

pub fn display(&self, w: &mut Formatter<'_>, rule: bool) -> Result<(), Error>[src]

Used to display format with additional options.

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 From<Arc<String>> for Symbol[src]

impl Into<Expr> for Symbol[src]

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

impl PartialEq<Symbol> for Symbol[src]

impl PartialOrd<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.