- menhir
- Do
make depend
andmake
. You'll getpbci
.- Or, do
omake
.
- Or, do
- Not maintained right now: If you have BER MetaOCaml, do
make meta
instead ofmake
.
- Uppercase IDs for type variables.
- Lowercase IDs for term variables.
- Types:
int
,bool
,?
(for type dynamic),S->T
,All X.T
.- Nested
All
can be abbreviated, e.g.,All X Y.T
forAll X. All Y. T
.
- Nested
- Constants: integers,
true
,false
- Usual constructs such as:
let x = e1 in e2
,if e1 then e2 else e3
,+
,*
,<
- Abstraction:
fun (x : T) -> e
- Type abstraction:
fun X -> e
- Type application:
e [T]
- Recursion:
let rec f (x:S) : T = e in e
- The return type annotation
: T
is mandatory.
- The return type annotation
- Ascription:
(e : T)
(parentheses always required) - Cast:
(e : S => T)
(parentheses always required) - Lists:
[@T]
(empty list ofT list
),e::e
- Omitting
@T
makes? list
[e; ...; e; @T]
(where "; @T
" can be omitted) is supported
- Omitting
- Case analysis on lists:
match e with [] -> e | x :: y -> e
- Top-level input:
e;;
,let x : T = e;;
,let f (x:T1) : T = e
, orlet rec f (x:T1) : T = e;;
.- Type annotation
:T
is optional in non-recursive definitions.
- Type annotation
- A list of parameters allowed for
let
(let rec
) andfun
, as infun X (x:X) -> x
orlet id X (x:X) : X = x;;
let rec
takes the formlet rec f X1 ... Xn (x:S) ... : T = e in e
but type abstractions byXi
(preceding the first term variable) are done outside of recursion.- In other words, this is not polymorphic recursion; the type of
f
isS -> T
for fixedXi
.)
- In other words, this is not polymorphic recursion; the type of
- Add more test inputs in test.gtf
- Data structures: pairs
- Implement reduction (not evaluation) for assist proofs
- pretty printer for Fg- ad Fc-terms
print_type
doesn't handle variable names declared twice properly.