pub enum TermKind {
Show 33 variants
Omega,
Level,
LevelZero,
LevelSucc {
pred: Term,
},
LevelMax {
a: Term,
b: Term,
},
Type {
level: Term,
},
Var(usize),
FuncType {
arg_type: Term,
res_type: Term,
},
FuncTerm {
body: Term,
},
FuncApp {
func: Term,
arg: Term,
arg_type: Term,
res_type: Term,
},
UnitType,
UnitTerm,
PairType {
head_type: Term,
tail_type: Term,
},
PairTerm {
head: Term,
tail: Term,
},
PairElim {
pair: Term,
res: Term,
head_type: Term,
tail_type: Term,
},
NeverType,
NeverElim {
never: Term,
},
EitherType {
left_type: Term,
right_type: Term,
},
EitherLeft {
val: Term,
},
EitherRight {
val: Term,
},
EitherElim {
arg: Term,
arg_type: Term,
res_type: Term,
on_left: Term,
on_right: Term,
},
IdentType {
term_type: Term,
a: Term,
b: Term,
},
IdentTerm,
IdentElim {
term_type: Term,
a: Term,
b: Term,
path: Term,
context: Term,
proof: Term,
},
RecType {
rec_type: Term,
},
RecTerm {
rec_term: Term,
},
WorldType,
WorldTerm,
WorldElim {
intrinsic: &'static str,
world_in: Term,
arg: Term,
expr: Term,
},
UmType,
UmTerm {
val: u64,
},
UmSucc {
pred: Term,
},
UmElim {
arg: Term,
res_type: Term,
on_zero: Term,
on_succ: Term,
},
}Expand description
The different kinds of term that can appear in the AST.
Variants§
Omega
The type of all types, and levels, which does not itself have a type.
Level
The type of universe levels.
LevelZero
Universe level zero.
LevelSucc
Universe level (pred + 1).
LevelMax
Universe level max(a, b)
Type
The type of types, indexed by levels.
Var(usize)
A variable.
FuncType
The type of functions. (ie pi types)
FuncTerm
Functions.
FuncApp
Function application.
UnitType
The unit type.
UnitTerm
The unit term.
PairType
A dependent pair type (ie. sigma type)
PairTerm
A pair term.
PairElim
Dependent pair elimination.
NeverType
The canonical empty type, (ie. bottom).
NeverElim
Never type elimintator
EitherType
Disjoint union, sum type.
EitherLeft
Inject left.
EitherRight
Inject right.
EitherElim
Case match on a sum type.
IdentType
The type of identifications (a == b)
IdentTerm
Reflexivity,
IdentElim
J-elimination for identities.
RecType
A recursive type. rec_type is under a context where Var(0) refers back to the type.
RecTerm
A recursive term. Used to mark rec_term as a member of a recursive type.
WorldType
The type for interacting with the outside world through intrinsics.
WorldTerm
The term used to represent a fully-normalised world ready to perform IO on.
WorldElim
Performs an intrinsic call.
Fields
UmType
Unsigned, memory-sized integers.
UmTerm
An intger literal.
UmSucc
An integer literal equal to 1 + pred
UmElim
Case match on a Um.