report 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. Pattern matching
  2. ----------------
  3. - equations instead of case
  4. - completeness:
  5. IsZero 0 = One
  6. IsZero (S n) = Zero
  7. f : (n : Nat) -> IsZero n -> X
  8. What is a complete set of equations?
  9. IsZero 0 = One
  10. IsZero (S 0) = Zero
  11. IsZero (S (S n)) = Zero
  12. Pattern matching on inductive families
  13. --------------------------------------
  14. - We know how to do it (and recover alf-style pattern matching)
  15. - We don't know how to translate to core.
  16. - Conclusion: no pattern matching on inductive families (yet).
  17. El and different kinds of arrows
  18. --------------------------------
  19. We can infer El. We also know how to infer app and lam.
  20. Problem: we don't have eta equality on the small pi
  21. lam (app f) != f
  22. Conclusion: stick with what's in core.
  23. -- Not allowed
  24. Rel : Set -> Set1
  25. Rel A = A -> A -> Prop
  26. -- Allowed
  27. data Rel (A : Set) : Set1
  28. relI : (A -> A -> Prop) -> Rel A
  29. relE : (A : Set) -> Rel A -> (A -> A -> Prop)
  30. relE A (relI R) = R
  31. Universe hierarchy:
  32. Prop <= Set1
  33. Set <= Set1 <= Set2, ..
  34. Note that we DON'T have
  35. Set : Set1
  36. Mutually (inductive) recursive definitions
  37. ------------------------------------------
  38. Definitions only visible in later defs. For types definition =
  39. constructors.
  40. Modules
  41. -------
  42. Principle: modules should be simple, static entities.
  43. - Each file is a module with the same name as the file
  44. - Modules can be parameterised
  45. - Modules can be nested
  46. - Example:
  47. --- [ example/A/Foo.agda ] ---
  48. module Foo (A:Set)(op : A -> A -> A) where
  49. f : A -> A
  50. f x = op x x
  51. module Bar (e : A) where
  52. ...
  53. ------------------------------
  54. - You can (only) import files
  55. --- [ example/A/Foo.agda ] ---
  56. module Foo where
  57. import .Baz -- look for 'example/A/Baz.agda'
  58. import B.Baz -- look for '${include_dirs}/B/Baz.agda'
  59. ------------------------------
  60. - Modules vs. name spaces
  61. You can refer to things in a name space using the dot notation:
  62. X.f -- f from the name space X
  63. X.Y.g -- g from the name space X.Y
  64. f -- f from the current name space
  65. A module is not a name space, but for each non-parameterised module
  66. there is a corresponing name space.
  67. Not ok: (Foo Nat (+)).f
  68. Creating name spaces:
  69. open H as X -- H is something containing names
  70. -- (module/name space/struct)
  71. -- X is the name of a new name space.
  72. open H as X (f,g) -- only import the names f and g from H
  73. -- into X
  74. open H (f,g) -- importing into the current name space
  75. open H -- import everything into the current name space
  76. Open is a definition.
  77. Example:
  78. let open Foo Nat (+) as FooNat
  79. open FooNat.Bar 0
  80. in FooNat.f 3
  81. Clashes? Complain at use site rather than import site.
  82. Abstract and private
  83. private: you can't say the name
  84. abstract: you don't know the definition
  85. abstract is a block thing:
  86. abstract
  87. Stack : Set
  88. Stack = List
  89. empty : Stack
  90. empty = []
  91. ...
  92. Meta variables
  93. --------------
  94. Two kinds of meta variables: ? and _
  95. ? is used for interaction
  96. _ is used for hidden arguments
  97. Requirement: _ should be solvable locally
  98. (block of mutually recursive defs)
  99. Syntax for hidden arguments
  100. ---------------------------
  101. {x:A} -> B
  102. {x,y : A} -> B
  103. {A} -> B
  104. \{x:A} -> t
  105. \{x} y -> t
  106. e {e}
  107. Telescopes in definitions
  108. -------------------------
  109. Open question. Suggestion: don't allow.
  110. Issue: what's the scope.
  111. Error messages
  112. --------------
  113. Idea: Have type checker return proof objects.
  114. Vision: Interactive/navigatable error messages.
  115. Issue: How to represent a failed derivation.
  116. The Plan
  117. --------
  118. Jeff leaves AIST beginning of November.
  119. By then we plan to have a running system (minus emacs interface).
  120. Notes from the presentation
  121. ---------------------------
  122. Opening modules:
  123. Don't allow opening (into the current name space) and instantiation at
  124. the same time. Because: how would you print private/non-imported names
  125. from that module.
  126. It might be a good idea to separate instantiation and opening. Issue:
  127. you might want to give explicit import lists when instantiating. This
  128. is also true for imports (which acts as instantiation for
  129. non-parameterised modules).
  130. Top level modules (corresponding to files) should have fully qualified
  131. names:
  132. module A.Foo where
  133. module B where
  134. The reason for this is that there is no context that explains where the
  135. module is in the hierarchy, so we should write it down explicitly. For
  136. the local module it's clear that its full name is A.Foo.B.
  137. The principle is to make a module hierarchy independant of the actual
  138. file system (the only place we need to know about the file system is
  139. when we do import chasing, and then only for technical reasons).
  140. vim: sts=2 sw=2 tw=75