blob: 4fa6bc72543ff657484ffba6d52d316d33c2ded1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# toytt
this is an attempt of mine to implement a typechecker for a minimal dependent
type theory in the style of martin-löf. at the time of writing this, it has the
following features:
- type of booleans w/ dependent eliminator
- pi and sigma connectives
- universe that contains itself (lol)
- that's it
it probably has lots of bugs as well.
## example
the file `test/bool.toytt` defines some elementary functions on booleans.
```
toytt> not false
true : bool
toytt> and false
\y -> false : bool -> bool
toytt> xor true false
true : bool
toytt> or true bool
→ error[E302]
1 | or true bool
^ type mismatch:
expected: bool
found: type
```
## todo list (in descending order of importance and/or realizability)
- [x] figure out how to recover variable names in pretty-printing so we don't
have to print de bruijn indices all the time
- [x] build a better repl
- [x] improve error messages
- [x] implement top-level definitions
- [x] implement less aggrevating syntax for non-dependent function & pair types
- [ ] add a type of natural numbers
- [ ] replace type-in-type with a proper (cumulative?) hierarchy of universes
-> maybe use the mugen library or figure out typical ambiguity?
- [ ] implement inductive types/families
- [ ] implement axioms (probably easy)
- [ ] do HoTT stuff (maybe implement a form of cubical type theory? or stick with
book HoTT, which is probably much easier)
- ...
|