implicitt/lib/Core/Value.ml

40 lines
783 B
OCaml
Raw Normal View History

2022-08-25 20:29:55 +02:00
module T = Term
2023-01-31 19:51:46 +01:00
module C = Common
2022-08-25 20:29:55 +02:00
2023-01-31 19:51:46 +01:00
type lvl = Lvl of int
2022-08-25 20:29:55 +02:00
2022-08-30 16:12:47 +02:00
type closure = C of env * T.term
and closure2 = C2 of env * T.term (* 2 variables missing *)
2022-08-25 20:29:55 +02:00
2023-02-04 16:58:16 +01:00
(* tr , icit, ty *)
and spine = (value * C.icit * value) list
2022-08-25 20:29:55 +02:00
and env = value list
and value
= Type
| T0
| T1
| T1vl
| TNat
| Suc of value
| Zero
| TBool
| True
| False
2023-02-04 16:58:16 +01:00
| 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 *)
2022-08-25 20:29:55 +02:00
and stuck
= Var of lvl
2023-01-31 19:51:46 +01:00
| Meta of C.meta
2022-08-25 20:29:55 +02:00
| Ind0 of closure * stuck
2022-08-30 16:12:47 +02:00
| IndN of closure * value * closure2 * stuck
2022-08-25 20:29:55 +02:00
| IndB of closure * value * value * stuck
2023-02-04 16:58:16 +01:00
| App of stuck * spine (* fn; vals; type of fn *)
2022-08-25 20:29:55 +02:00
| Fst of stuck
| Snd of stuck