SHOW:
|
|
- or go back to the newest paste.
1 | - | - + Errors (5) |
1 | + | |
2 | - | |-- z.idr line 12 col 10: |
2 | + | |
3 | - | | When checking type of Main.getExpr: |
3 | + | |
4 | - | | No such variable Expr |
4 | + | |
5 | - | |-- z.idr line 15 col 9: |
5 | + | |
6 | - | | When checking type of Main.betaEq: |
6 | + | |
7 | - | | No such variable Expr |
7 | + | |
8 | - | |-- z.idr line 13 col 2: |
8 | + | |
9 | - | | No type declaration for Main.getExpr |
9 | + | |
10 | - | |-- z.idr line 16 col 2: |
10 | + | |
11 | - | | No type declaration for Main.betaEq |
11 | + | |
12 | - | `-- z.idr line 28 col 17: |
12 | + | |
13 | - | When checking type of Main.App: |
13 | + | data Expr : ANTContext -> Type |
14 | - | No such variable getExpr |
14 | + | |
15 | getExpr : ANTContext -> Fin n -> Expr ctx | |
16 | - | --------------------- code below ------------------------ |
16 | + | |
17 | ||
18 | betaEq : Expr ctx -> Expr ctx -> Type | |
19 | betaEq = ?x | |
20 | ||
21 | ||| This represents when a context implies something. It is laid out | |
22 | ||| as the basic rules of the type theory system | |
23 | ||| Taken from https://eb.host.cs.st-andrews.ac.uk/drafts/impldtp.pdf page 11 | |
24 | data Expr : ANTContext -> Type where | |
25 | ||| G |- f : (x : S) -> T G |- s : S | |
26 | ||| App ---------------------------------- | |
27 | - | |
27 | + | |
28 | App : (ctx : ANTContext {n}) | |
29 | -> (fInd : Fin n) | |
30 | -> (sInd : Fin n) | |
31 | -> ?betaEq (getExpr ctx fInd) (getExpr ctx sInd) | |
32 | -> Expr ctx | |
33 | ||| G;\x:S |- e : T G |- (x : S) -> T : Type(n) | |
34 | ||| Lam --------------------------------------------- | |
35 | ||| G |- \x:S.e : (x : S) -> T | |
36 | ||| Given a context, an arg type within that context, and an expression | |
37 | ||| that uses that var, returns a Lam (variable name not specified | |
38 | ||| since we are using DeBrujin indexes) | |
39 | Lam : (ctx : ANTContext) -> (argType : Expr ctx) | |
40 | -> Expr (AddVar ctx argType) -> Expr ctx |