2
Syntax - concrete, internal and values
3
--------------------------------------
5
Nice syntax for hidden arguments:
13
{x, y : A, b : B} -> A
15
Scope of telescope is only the right of the colon:
21
id {A : Set}(x : A) : A
27
| App Value Value Hidden
28
| Lam Type (Abs Value)
32
data Type = El Value Sort
36
data Sort = Prop | Set Nat
38
data Abs a = Abs Name a
40
Everything also has an explanation on it.
41
Note: No sorts on metas.
43
data Expl = InYourCode Range
44
| DefinedAt Range -- for variables/names
50
Have type checker return proof objects:
52
inferType : Term -> TCM InferenceDerivation
55
- give better error messages
58
- allow the user to explore the derivation to find an error
60
First (bad) approximation:
62
data InferenceDerivation = Inferred Value Type
64
Add constructor (functions) for each judgement in the type system.
68
A, e ::= x | e e | e {e} | λ αs -> e | λ Δ -> e
69
| {A} -> A | A -> A | Δ -> A | Set | Prop | Seti
70
| let Locals in e | e es of Bs | c | lit | ? | _
74
Δ ::= ε | (xs:A,..,xs:A)Δ | {xs:A,..,xs:A}Δ
76
D ::= Local | Module | postulate xΔ:A .. xΔ:A | Prefix D
77
Prefix ::= abstract | private
79
Local ::= Def | Data | mutual Locals
81
Data ::= data x Δ : A where
93
Module ::= package x Δ where
99
? means hole and _ means implicit argument style meta variable.
100
No ? implies no _ in top level def (D). In other words _ in top level
101
definitions should be solved locally. This means that when we do have
102
open holes in a definition we should still take care to not make the _
103
depend on things defined later on.
104
Solution: if we get a constraint involving an _ from a previous
105
definition, we report an error.
108
The State and Environment
109
-------------------------
112
- Meta variable stuff
119
- def -> type, def, fixity
120
- data -> type, constructors, fixity
127
data MetaInfo = InstantiatedV Value
129
| Underscore [ConstraintId]
130
| QuestionmarkV Context Type [ConstraintId]
131
| QuestionmarkT Context (Maybe Sort) [ConstraintId]
133
- the stuff in the questionmarks correspond to the following
136
Γ ⊢ ? type^i -- sometimes we care (? in type of constructor)
137
Γ ⊢ ? type -- and sometimes we don't (? in type of definition)
144
also need Σ everywhere.
149
* Abstract over uninstantiated questionmarks (without constraints).
150
* Select things (names?) and do things
151
- pattern match on pattern variable
152
x + y = e --{expand y}--> x + 0 = e[0/y]
155
- where's my definition/declaration
157
* Hide and unhide arguments.
159
vim: sts=2 sw=2 tw=75