Advertisement
Guest User

Untitled

a guest
Oct 16th, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. - + Errors (5)
  2. |-- z.idr line 12 col 10:
  3. | When checking type of Main.getExpr:
  4. | No such variable Expr
  5. |-- z.idr line 15 col 9:
  6. | When checking type of Main.betaEq:
  7. | No such variable Expr
  8. |-- z.idr line 13 col 2:
  9. | No type declaration for Main.getExpr
  10. |-- z.idr line 16 col 2:
  11. | No type declaration for Main.betaEq
  12. `-- z.idr line 28 col 17:
  13. When checking type of Main.App:
  14. No such variable getExpr
  15.  
  16. --------------------- code below ------------------------
  17. import Data.Vect
  18.  
  19. ||| Constant Types
  20. data ANTConst = I Int | BI Integer | Fl Double | Ch Char | Str String
  21.  
  22. mutual
  23. ||| Context
  24. ||| @n total number of vars
  25. data ANTContext : {n : Nat} -> Type where
  26. AddVar : (ctx : ANTContext {n}) -> Expr ctx -> ANTContext {n=(S n)}
  27.  
  28. getExpr : ANTContext -> Fin n -> Expr ctx
  29. getExpr ctx n = ?getExpr_rhs
  30.  
  31. betaEq : Expr ctx -> Expr ctx -> Type
  32. betaEq = ?x
  33.  
  34. ||| This represents when a context implies something. It is laid out
  35. ||| as the basic rules of the type theory system
  36. ||| Taken from https://eb.host.cs.st-andrews.ac.uk/drafts/impldtp.pdf page 11
  37. data Expr : ANTContext -> Type where
  38. ||| G |- f : (x : S) -> T G |- s : S
  39. ||| App ----------------------------------
  40. ||| G |- f s : T[s/x]
  41. App : (ctx : ANTContext {n})
  42. -> (fInd : Fin n)
  43. -> (sInd : Fin n)
  44. -> ?betaEq (getExpr ctx fInd) (getExpr ctx sInd)
  45. -> Expr ctx
  46. ||| G;\x:S |- e : T G |- (x : S) -> T : Type(n)
  47. ||| Lam ---------------------------------------------
  48. ||| G |- \x:S.e : (x : S) -> T
  49. ||| Given a context, an arg type within that context, and an expression
  50. ||| that uses that var, returns a Lam (variable name not specified
  51. ||| since we are using DeBrujin indexes)
  52. Lam : (ctx : ANTContext) -> (argType : Expr ctx)
  53. -> Expr (AddVar ctx argType) -> Expr ctx
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement