pub enum Symbol {
Show 144 variants
Custom(Arc<String>),
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>),
NotInVarName(Arc<String>, 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>),
NoSubstVar(Arc<String>),
Dup,
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,
ArgMax,
ArgMin,
SoftMax,
SoftMin,
SoftArgMax,
SoftArgMin,
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,
Pariv,
If,
Ex,
Triv,
AnyType,
RetType,
VecType,
Rty,
VecOp,
VecUop,
Arity,
Pi,
Tau,
Eps,
Imag,
Imag2,
Imag3,
TypeOf,
BoolType,
F64Type,
QuatType,
Inf,
Both,
Neither,
Subst,
}
Expand description
Contains symbols and operators on symbols.
Variants§
Custom(Arc<String>)
A custom symbol.
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.
NotInVarName(Arc<String>, Arc<String>)
Binds to left variable name that does not occur in expression bound to the right 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.
NoSubstVar(Arc<String>)
A variable that is not substitution.
Dup
dup
duplicate argument \(x) = (x, x)
.
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
.
ArgMax
arg_max
.
ArgMin
arg_min
.
SoftMax
soft_max
.
SoftMin
soft_min
.
SoftArgMax
soft_arg_max
.
SoftArgMin
soft_arg_min
.
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.
Pariv
Partial derivative.
If
if
.
This is used in Boolean functions.
Ex
Existential path ∃
.
Triv
Trivial path ∀
.
AnyType
any
, any type.
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).
Both
both
(indeterminate).
Neither
neither
(uninhabited).
Subst
subst
(substitution).
Implementations§
source§impl Symbol
impl Symbol
sourcepub fn precedence(&self) -> Option<u8>
pub fn precedence(&self) -> Option<u8>
Returns the operator presedence of symbol.
Trait Implementations§
source§impl PartialEq for Symbol
impl PartialEq for Symbol
source§impl PartialOrd for Symbol
impl PartialOrd for Symbol
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more