README 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. This directory produces a peculiar issue when the file
  2. UntypedLambda.agda
  3. is loaded, as per this message on the Agda mailing
  4. list:
  5. Hi folks
  6. First, thanks for the aquamacs tips. Whatever it was,
  7. it's now in colour and going well. (Peculiarly, before
  8. I copied .emacs stuff from Ulf, I had *one* file
  9. which suddenly started appearing in colour for no
  10. obvious reason, when the rest stayed stubbornly
  11. monochrome. Hmm.)
  12. So yes, I've been messing about with enough stuff to
  13. need more than one file. And I've hit a distinctly
  14. bizarre happening. Maybe I'm not using modules in the
  15. right way, but I don't think it's falling over as
  16. gracefully as it might. I know these things take time,
  17. and I expect I can work around the issue.
  18. Er, um, I'm afraid I've (tried and) failed to condense
  19. the problem to a toy example, so I'll summarize. If
  20. you want a tar of the files, just ask.
  21. Here goes. I developed a library of stuff in short
  22. files, not entirely linearly. I wanted to build a
  23. wrapper so I could import in one go.
  24. {--- begin Syntacticosmos.agda ----------------------}
  25. module Syntacticosmos (Gnd : Set)(U : Set)(El : U -> Set) where
  26. open import Basics
  27. open import Pr
  28. open import Nom
  29. import Kind
  30. open module KindGUEl = Kind Gnd U El public
  31. import Cxt
  32. open module CxtK = Cxt Kind public
  33. import Loc
  34. open module LocK = Loc Kind public
  35. import Term
  36. open module TermGUEl = Term Gnd U El public
  37. import Shift
  38. open module ShiftGUEl = Shift Gnd U El public
  39. import Eta
  40. open module EtaGUEl = Eta Gnd U El public
  41. import Inst
  42. open module InstGUEl = Inst Gnd U El public
  43. import Subst
  44. open module SubstGUEl = Subst Gnd U El public
  45. {--- end Syntacticosmos.agda ----------------------}
  46. The file loads fine. So far so good. Then I tried to
  47. use it...
  48. {--- begin UntypedLambda.agda -----------------------}
  49. module UntypedLambda where
  50. open import Basics
  51. open import Pr
  52. open import Nom
  53. import Syntacticosmos
  54. data Tag : Set where
  55. lamT : Tag
  56. appT : Tag
  57. open module ULam = Syntacticosmos TT TT (\_ -> Tag)
  58. LAM : Kind
  59. LAM = Ty _
  60. SigLAM : Kind
  61. SigLAM = Pi _ conk where
  62. conk : Tag -> Kind
  63. conk lamT = (LAM |> LAM) |> LAM
  64. conk appT = LAM |> LAM |> LAM
  65. Lam : Cxt -> Set
  66. Lam G = G [! SigLAM !]- LAM
  67. lam : {G : Cxt}(x : Nom){Gx : [| G Hasn't x |]} ->
  68. Lam ((G [ x - LAM ]) {Gx}) -> Lam G
  69. lam x {Gx} b = G[ lamT G^ G\\ (bind x {Gx} b) G& Gnil ]
  70. app : {G : Cxt} -> Lam G -> Lam G -> Lam G
  71. app f s = G[ appT G^ f G& s G& Gnil ]
  72. moo : Lam EC
  73. moo = lam Ze (lam (Su Ze) (var Ze))
  74. noo : Lam EC
  75. noo = lam (Su Ze) (lam Ze (var (Su Ze)))
  76. coo : Id moo noo
  77. coo = refl
  78. {--- end UntypedLambda.agda ----------------------------}
  79. When I try to load UntypedLambda.agda, it fails at
  80. import Syntacticosmos with the following error:
  81. /Users/ctm/Desktop/Syntacticosmos/UntypedLambda.agda:6,1-22
  82. /Users/ctm/Desktop/Syntacticosmos/Syntacticosmos.agdai:
  83. getModificationTime: does not exist (No such file or directory)
  84. Moreover, by the joy of Finder, I watched the directory
  85. as this ran. The file Syntacticosmos.agdai appeared and
  86. then disappeared in the course of the failed load.
  87. My attempts to mimic the pattern of files with similar
  88. structure but less distraction have not reproduced the
  89. problem. I hope you enjoy the distraction...
  90. Does this ring any bells with any one? How should I be
  91. organizing the library modules, anyway?
  92. I'm sorry it's all a bit sick. On the upside, I'm really
  93. pleased at the way the engines are taking what I'm
  94. throwing at them (a universe of globally named, locally
  95. nameless syntaxes with binding). I probably shouldn't
  96. be allowed this much fun, but it's the weekend and I'm
  97. not so well at the moment, hence hacking therapy.
  98. Anyhow, I thought I'd share this peculiar happening.
  99. I don't even know how to begin speculating about the
  100. problem.
  101. All the best
  102. Conor
  103. _______________________________________________
  104. Agda mailing list
  105. Agda@lists.chalmers.se
  106. https://lists.chalmers.se/mailman/listinfo/agda