meeting_050905 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. Pattern matching revisited
  2. --------------------------
  3. Don't allow
  4. f A 0 (nil A)
  5. But still allow
  6. f (s m) (cons m x xs)
  7. Always bind to the first m.
  8. Decision: don't implement this at first. No pattern matching at all on
  9. inductive families.
  10. Meta variables
  11. --------------
  12. Do not identify communication points and meta variables.
  13. El and universes
  14. ----------------
  15. Abstract syntax for values
  16. data Value = ...
  17. data Type = El Value Sort
  18. | Pi Type Type
  19. data Sort = Prop | Set Nat
  20. Rules for the subtyping with coercions:
  21. Γ, x:V ⊢ x : V ≤ El A --> v' Γ, x:V ⊢ app v v' : El (B v') ≤ W --> w
  22. ----------------------------------------------------------------------
  23. Γ ⊢ v : El (πAB) ≤ ∏x:A.B --> λx. w
  24. Γ, x:El A ⊢ x : El A ≤ V --> v' Γ, x:El A ⊢ v v' : W ≤ El (B v') --> w
  25. ------------------------------------------------------------------------
  26. Γ ⊢ v : ∏x:A.B ≤ El (πAB) --> lam (λx. w)
  27. The problem: We don't have eta.
  28. app (lam f) == f, but
  29. lam (app f) != f
  30. Thierry says this might not be easy to get.
  31. Decision: Stick to what we know we can get.
  32. Type level definitions only with datatypes:
  33. data Ref (R : El A -> El A -> Set) : Set where
  34. mkRef : ((x : El A) -> R x x) -> Ref R
  35. data Rel (A : Set) : Set_1 where
  36. mkRel : (El A -> El A -> Set) -> Rel A
  37. Wrapping and unwrapping have to be done explicitly. This is slightly
  38. better than the alternative definition of Rel (with the small pi) since
  39. we only have to unwrap once instead of unwrapping each application.
  40. Core type judgement
  41. M : Set_i
  42. -------------
  43. El_i M type_i
  44. A type_i B type_i [x:A]
  45. --------------------------
  46. (x:A) -> B type_i
  47. A type_j j < i
  48. ----------------
  49. A type_i
  50. --------------
  51. Set_i type_i+1
  52. Mutual inductive recursive definitions
  53. --------------------------------------
  54. Definitions:
  55. x1 : A1 = M1
  56. .
  57. .
  58. .
  59. xn : An = Mn
  60. Type check
  61. (x1:A1)...(xn:An), and then
  62. M1:A1
  63. M2:A2 (x1=M1)
  64. ...
  65. Mn:An (x1=M1, x2=M2, ..)
  66. For datatypes, constructors are only visible in the rhs of the other
  67. definitions (not in the types). In other words we treat the constructors
  68. as the _definition_ of the datatype.
  69. vim: sts=2 sw=2 tw=75