implicitt/lib/Core/Value.ml

40 lines
783 B
OCaml

module T = Term
module C = Common
type lvl = Lvl of int
type closure = C of env * T.term
and closure2 = C2 of env * T.term (* 2 variables missing *)
(* tr , icit, ty *)
and spine = (value * C.icit * value) list
and env = value list
and value
= Type
| T0
| T1
| T1vl
| TNat
| Suc of value
| Zero
| TBool
| True
| False
| Pi of C.icit * value * closure
| Lam of C.icit * closure
| Sg of value * closure
| Pair of value * value
| Stuck of stuck * value (* second arg is type *)
and stuck
= Var of lvl
| Meta of C.meta
| Ind0 of closure * stuck
| IndN of closure * value * closure2 * stuck
| IndB of closure * value * value * stuck
| App of stuck * spine (* fn; vals; type of fn *)
| Fst of stuck
| Snd of stuck