Issue1062.tex 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380
  1. \nonstopmode
  2. \documentclass{article}
  3. \usepackage{agda}
  4. \begin{document}
  5. \begin{code}%
  6. \>[0]\<%
  7. \\
  8. \>[0]\AgdaSymbol{\{-\#}\AgdaSpace{}%
  9. \AgdaKeyword{OPTIONS}\AgdaSpace{}%
  10. \AgdaPragma{--copatterns}\AgdaSpace{}%
  11. \AgdaPragma{--sized-types}\AgdaSpace{}%
  12. \AgdaSymbol{\#-\}}\<%
  13. \\
  14. %
  15. \\[\AgdaEmptyExtraSkip]%
  16. \>[0]\AgdaSymbol{\{-\#}\AgdaSpace{}%
  17. \AgdaKeyword{BUILTIN}\AgdaSpace{}%
  18. \AgdaKeyword{SIZE}%
  19. \>[20]\AgdaPostulate{Size}%
  20. \>[27]\AgdaSymbol{\#-\}}\<%
  21. \\
  22. \>[0]\AgdaSymbol{\{-\#}\AgdaSpace{}%
  23. \AgdaKeyword{BUILTIN}\AgdaSpace{}%
  24. \AgdaKeyword{SIZELT}%
  25. \>[20]\AgdaOperator{\AgdaPostulate{Size<\AgdaUnderscore{}}}\AgdaSpace{}%
  26. \AgdaSymbol{\#-\}}\<%
  27. \\
  28. \>[0]\AgdaSymbol{\{-\#}\AgdaSpace{}%
  29. \AgdaKeyword{BUILTIN}\AgdaSpace{}%
  30. \AgdaKeyword{SIZESUC}\AgdaSpace{}%
  31. \AgdaOperator{\AgdaPostulate{↑\AgdaUnderscore{}}}%
  32. \>[27]\AgdaSymbol{\#-\}}\<%
  33. \\
  34. \>[0]\AgdaSymbol{\{-\#}\AgdaSpace{}%
  35. \AgdaKeyword{BUILTIN}\AgdaSpace{}%
  36. \AgdaKeyword{SIZEINF}\AgdaSpace{}%
  37. \AgdaPostulate{∞}%
  38. \>[27]\AgdaSymbol{\#-\}}\<%
  39. \\
  40. %
  41. \\[\AgdaEmptyExtraSkip]%
  42. \>[0]\AgdaKeyword{data}\AgdaSpace{}%
  43. \AgdaDatatype{List}\AgdaSpace{}%
  44. \AgdaSymbol{(}\AgdaBound{A}\AgdaSpace{}%
  45. \AgdaSymbol{:}\AgdaSpace{}%
  46. \AgdaPrimitive{Set}\AgdaSymbol{)}\AgdaSpace{}%
  47. \AgdaSymbol{:}\AgdaSpace{}%
  48. \AgdaPrimitive{Set}\AgdaSpace{}%
  49. \AgdaKeyword{where}\<%
  50. \\
  51. \>[0][@{}l@{\AgdaIndent{0}}]%
  52. \>[2]\AgdaInductiveConstructor{[]}\AgdaSpace{}%
  53. \AgdaSymbol{:}\AgdaSpace{}%
  54. \AgdaDatatype{List}\AgdaSpace{}%
  55. \AgdaBound{A}\<%
  56. \\
  57. %
  58. \>[2]\AgdaOperator{\AgdaInductiveConstructor{\AgdaUnderscore{}∷\AgdaUnderscore{}}}\AgdaSpace{}%
  59. \AgdaSymbol{:}\AgdaSpace{}%
  60. \AgdaSymbol{(}\AgdaBound{x}\AgdaSpace{}%
  61. \AgdaSymbol{:}\AgdaSpace{}%
  62. \AgdaBound{A}\AgdaSymbol{)}\AgdaSpace{}%
  63. \AgdaSymbol{(}\AgdaBound{xs}\AgdaSpace{}%
  64. \AgdaSymbol{:}\AgdaSpace{}%
  65. \AgdaDatatype{List}\AgdaSpace{}%
  66. \AgdaBound{A}\AgdaSymbol{)}\AgdaSpace{}%
  67. \AgdaSymbol{->}\AgdaSpace{}%
  68. \AgdaDatatype{List}\AgdaSpace{}%
  69. \AgdaBound{A}\<%
  70. \\
  71. %
  72. \\[\AgdaEmptyExtraSkip]%
  73. \>[0]\AgdaKeyword{record}\AgdaSpace{}%
  74. \AgdaOperator{\AgdaRecord{\AgdaUnderscore{}×\AgdaUnderscore{}}}\AgdaSpace{}%
  75. \AgdaSymbol{(}\AgdaBound{A}\AgdaSpace{}%
  76. \AgdaBound{B}\AgdaSpace{}%
  77. \AgdaSymbol{:}\AgdaSpace{}%
  78. \AgdaPrimitive{Set}\AgdaSymbol{)}\AgdaSpace{}%
  79. \AgdaSymbol{:}\AgdaSpace{}%
  80. \AgdaPrimitive{Set}\AgdaSpace{}%
  81. \AgdaKeyword{where}\<%
  82. \\
  83. \>[0][@{}l@{\AgdaIndent{0}}]%
  84. \>[2]\AgdaKeyword{constructor}\AgdaSpace{}%
  85. \AgdaOperator{\AgdaInductiveConstructor{\AgdaUnderscore{},\AgdaUnderscore{}}}\<%
  86. \\
  87. %
  88. \>[2]\AgdaKeyword{field}\<%
  89. \\
  90. \>[2][@{}l@{\AgdaIndent{0}}]%
  91. \>[4]\AgdaField{fst}\AgdaSpace{}%
  92. \AgdaSymbol{:}\AgdaSpace{}%
  93. \AgdaBound{A}\<%
  94. \\
  95. %
  96. \>[4]\AgdaField{snd}\AgdaSpace{}%
  97. \AgdaSymbol{:}\AgdaSpace{}%
  98. \AgdaBound{B}\<%
  99. \\
  100. \>[0]\AgdaKeyword{open}\AgdaSpace{}%
  101. \AgdaOperator{\AgdaModule{\AgdaUnderscore{}×\AgdaUnderscore{}}}\<%
  102. \\
  103. %
  104. \\[\AgdaEmptyExtraSkip]%
  105. \>[0]\AgdaComment{--\ Sized\ streams\ via\ head/tail.}\<%
  106. \\
  107. %
  108. \\[\AgdaEmptyExtraSkip]%
  109. \>[0]\AgdaKeyword{record}\AgdaSpace{}%
  110. \AgdaRecord{Stream}\AgdaSpace{}%
  111. \AgdaSymbol{\{}\AgdaBound{i}\AgdaSpace{}%
  112. \AgdaSymbol{:}\AgdaSpace{}%
  113. \AgdaPostulate{Size}\AgdaSymbol{\}}\AgdaSpace{}%
  114. \AgdaSymbol{(}\AgdaBound{A}\AgdaSpace{}%
  115. \AgdaSymbol{:}\AgdaSpace{}%
  116. \AgdaPrimitive{Set}\AgdaSymbol{)}\AgdaSpace{}%
  117. \AgdaSymbol{:}\AgdaSpace{}%
  118. \AgdaPrimitive{Set}\AgdaSpace{}%
  119. \AgdaKeyword{where}\<%
  120. \\
  121. \>[0][@{}l@{\AgdaIndent{0}}]%
  122. \>[2]\AgdaKeyword{coinductive}\AgdaSymbol{;}\AgdaSpace{}%
  123. \AgdaKeyword{constructor}\AgdaSpace{}%
  124. \AgdaOperator{\AgdaCoinductiveConstructor{\AgdaUnderscore{}∷\AgdaUnderscore{}}}\<%
  125. \\
  126. %
  127. \>[2]\AgdaKeyword{field}\<%
  128. \\
  129. \>[2][@{}l@{\AgdaIndent{0}}]%
  130. \>[4]\AgdaField{head}%
  131. \>[10]\AgdaSymbol{:}\AgdaSpace{}%
  132. \AgdaBound{A}\<%
  133. \\
  134. %
  135. \>[4]\AgdaField{tail}%
  136. \>[10]\AgdaSymbol{:}\AgdaSpace{}%
  137. \AgdaSymbol{∀}\AgdaSpace{}%
  138. \AgdaSymbol{\{}\AgdaBound{j}\AgdaSpace{}%
  139. \AgdaSymbol{:}\AgdaSpace{}%
  140. \AgdaOperator{\AgdaPostulate{Size<}}\AgdaSpace{}%
  141. \AgdaBound{i}\AgdaSymbol{\}}\AgdaSpace{}%
  142. \AgdaSymbol{→}\AgdaSpace{}%
  143. \AgdaRecord{Stream}\AgdaSpace{}%
  144. \AgdaSymbol{\{}\AgdaBound{j}\AgdaSymbol{\}}\AgdaSpace{}%
  145. \AgdaBound{A}\<%
  146. \\
  147. \>[0]\AgdaKeyword{open}\AgdaSpace{}%
  148. \AgdaModule{Stream}\AgdaSpace{}%
  149. \AgdaKeyword{public}\<%
  150. \\
  151. %
  152. \\[\AgdaEmptyExtraSkip]%
  153. \>[0]\AgdaOperator{\AgdaFunction{\AgdaUnderscore{}∷ˢ\AgdaUnderscore{}}}\AgdaSpace{}%
  154. \AgdaSymbol{:}\AgdaSpace{}%
  155. \AgdaSymbol{∀}\AgdaSpace{}%
  156. \AgdaSymbol{\{}\AgdaBound{i}\AgdaSpace{}%
  157. \AgdaBound{A}\AgdaSymbol{\}}\AgdaSpace{}%
  158. \AgdaSymbol{→}\AgdaSpace{}%
  159. \AgdaBound{A}\AgdaSpace{}%
  160. \AgdaSymbol{→}\AgdaSpace{}%
  161. \AgdaRecord{Stream}\AgdaSpace{}%
  162. \AgdaSymbol{\{}\AgdaBound{i}\AgdaSymbol{\}}\AgdaSpace{}%
  163. \AgdaBound{A}\AgdaSpace{}%
  164. \AgdaSymbol{→}\AgdaSpace{}%
  165. \AgdaRecord{Stream}\AgdaSpace{}%
  166. \AgdaSymbol{\{}\AgdaOperator{\AgdaPostulate{↑}}\AgdaSpace{}%
  167. \AgdaBound{i}\AgdaSymbol{\}}\AgdaSpace{}%
  168. \AgdaBound{A}\<%
  169. \\
  170. \>[0]\AgdaField{head}%
  171. \>[6]\AgdaSymbol{(}\AgdaBound{a}\AgdaSpace{}%
  172. \AgdaOperator{\AgdaFunction{∷ˢ}}\AgdaSpace{}%
  173. \AgdaBound{as}\AgdaSymbol{)}\AgdaSpace{}%
  174. \AgdaSymbol{=}\AgdaSpace{}%
  175. \AgdaBound{a}\<%
  176. \\
  177. \>[0]\AgdaField{tail}%
  178. \>[6]\AgdaSymbol{(}\AgdaBound{a}\AgdaSpace{}%
  179. \AgdaOperator{\AgdaFunction{∷ˢ}}\AgdaSpace{}%
  180. \AgdaBound{as}\AgdaSymbol{)}\AgdaSpace{}%
  181. \AgdaSymbol{=}\AgdaSpace{}%
  182. \AgdaBound{as}\<%
  183. \\
  184. %
  185. \\[\AgdaEmptyExtraSkip]%
  186. \>[0]\AgdaComment{--\ Streams\ and\ lists.}\<%
  187. \\
  188. %
  189. \\[\AgdaEmptyExtraSkip]%
  190. \>[0]\AgdaComment{--\ Prepending\ a\ list\ to\ a\ stream.}\<%
  191. \\
  192. %
  193. \\[\AgdaEmptyExtraSkip]%
  194. \>[0]\AgdaOperator{\AgdaFunction{\AgdaUnderscore{}++ˢ\AgdaUnderscore{}}}\AgdaSpace{}%
  195. \AgdaSymbol{:}\AgdaSpace{}%
  196. \AgdaSymbol{∀}\AgdaSpace{}%
  197. \AgdaSymbol{\{}\AgdaBound{i}\AgdaSpace{}%
  198. \AgdaBound{A}\AgdaSymbol{\}}\AgdaSpace{}%
  199. \AgdaSymbol{→}\AgdaSpace{}%
  200. \AgdaDatatype{List}\AgdaSpace{}%
  201. \AgdaBound{A}\AgdaSpace{}%
  202. \AgdaSymbol{→}\AgdaSpace{}%
  203. \AgdaRecord{Stream}\AgdaSpace{}%
  204. \AgdaSymbol{\{}\AgdaBound{i}\AgdaSymbol{\}}\AgdaSpace{}%
  205. \AgdaBound{A}\AgdaSpace{}%
  206. \AgdaSymbol{→}\AgdaSpace{}%
  207. \AgdaRecord{Stream}\AgdaSpace{}%
  208. \AgdaSymbol{\{}\AgdaBound{i}\AgdaSymbol{\}}\AgdaSpace{}%
  209. \AgdaBound{A}\<%
  210. \\
  211. \>[0]\AgdaInductiveConstructor{[]}%
  212. \>[10]\AgdaOperator{\AgdaFunction{++ˢ}}\AgdaSpace{}%
  213. \AgdaBound{s}\AgdaSpace{}%
  214. \AgdaSymbol{=}\AgdaSpace{}%
  215. \AgdaBound{s}\<%
  216. \\
  217. \>[0]\AgdaSymbol{(}\AgdaBound{a}\AgdaSpace{}%
  218. \AgdaOperator{\AgdaInductiveConstructor{∷}}\AgdaSpace{}%
  219. \AgdaBound{as}\AgdaSymbol{)}%
  220. \>[10]\AgdaOperator{\AgdaFunction{++ˢ}}\AgdaSpace{}%
  221. \AgdaBound{s}\AgdaSpace{}%
  222. \AgdaSymbol{=}\AgdaSpace{}%
  223. \AgdaBound{a}\AgdaSpace{}%
  224. \AgdaOperator{\AgdaFunction{∷ˢ}}\AgdaSpace{}%
  225. \AgdaSymbol{(}\AgdaBound{as}\AgdaSpace{}%
  226. \AgdaOperator{\AgdaFunction{++ˢ}}\AgdaSpace{}%
  227. \AgdaBound{s}\AgdaSymbol{)}\<%
  228. \\
  229. %
  230. \\[\AgdaEmptyExtraSkip]%
  231. \>[0]\AgdaComment{--\ Unfold\ which\ produces\ several\ outputs\ at\ one\ step}\<%
  232. \\
  233. %
  234. \\[\AgdaEmptyExtraSkip]%
  235. \>[0]\AgdaKeyword{record}\AgdaSpace{}%
  236. \AgdaRecord{List1}\AgdaSpace{}%
  237. \AgdaSymbol{(}\AgdaBound{A}\AgdaSpace{}%
  238. \AgdaSymbol{:}\AgdaSpace{}%
  239. \AgdaPrimitive{Set}\AgdaSymbol{)}\AgdaSpace{}%
  240. \AgdaSymbol{:}\AgdaSpace{}%
  241. \AgdaPrimitive{Set}\AgdaSpace{}%
  242. \AgdaKeyword{where}\<%
  243. \\
  244. \>[0][@{}l@{\AgdaIndent{0}}]%
  245. \>[2]\AgdaKeyword{constructor}\AgdaSpace{}%
  246. \AgdaOperator{\AgdaInductiveConstructor{\AgdaUnderscore{}∷\AgdaUnderscore{}}}\<%
  247. \\
  248. %
  249. \>[2]\AgdaKeyword{field}\<%
  250. \\
  251. \>[2][@{}l@{\AgdaIndent{0}}]%
  252. \>[4]\AgdaField{head}%
  253. \>[10]\AgdaSymbol{:}\AgdaSpace{}%
  254. \AgdaBound{A}\<%
  255. \\
  256. %
  257. \>[4]\AgdaField{tail}%
  258. \>[10]\AgdaSymbol{:}\AgdaSpace{}%
  259. \AgdaDatatype{List}\AgdaSpace{}%
  260. \AgdaBound{A}\<%
  261. \\
  262. \>[0]\AgdaKeyword{open}\AgdaSpace{}%
  263. \AgdaModule{List1}\AgdaSpace{}%
  264. \AgdaKeyword{using}\AgdaSpace{}%
  265. \AgdaSymbol{(}\AgdaField{head}\AgdaSymbol{;}\AgdaSpace{}%
  266. \AgdaField{tail}\AgdaSymbol{)}\<%
  267. \\
  268. %
  269. \\[\AgdaEmptyExtraSkip]%
  270. \>[0]\AgdaKeyword{record}\AgdaSpace{}%
  271. \AgdaRecord{⊤}\AgdaSpace{}%
  272. \AgdaSymbol{:}\AgdaSpace{}%
  273. \AgdaPrimitive{Set}\AgdaSpace{}%
  274. \AgdaKeyword{where}\AgdaSpace{}%
  275. \AgdaKeyword{constructor}\AgdaSpace{}%
  276. \AgdaInductiveConstructor{trivial}\<%
  277. \\
  278. \>[0]\AgdaKeyword{open}\AgdaSpace{}%
  279. \AgdaModule{List1}\AgdaSpace{}%
  280. \AgdaSymbol{(}\AgdaInductiveConstructor{trivial}\AgdaSpace{}%
  281. \AgdaOperator{\AgdaInductiveConstructor{∷}}\AgdaSpace{}%
  282. \AgdaInductiveConstructor{[]}\AgdaSymbol{)}\AgdaSpace{}%
  283. \AgdaKeyword{using}\AgdaSpace{}%
  284. \AgdaSymbol{(}\AgdaField{head}\AgdaSymbol{;}\AgdaSpace{}%
  285. \AgdaField{tail}\AgdaSymbol{)}\AgdaSpace{}%
  286. \AgdaComment{--\ problem:\ imports\ not\ colored}\<%
  287. \\
  288. %
  289. \\[\AgdaEmptyExtraSkip]%
  290. \>[0]\AgdaFunction{unfold⁺}\AgdaSpace{}%
  291. \AgdaSymbol{:}\AgdaSpace{}%
  292. \AgdaSymbol{∀}\AgdaSpace{}%
  293. \AgdaSymbol{\{}\AgdaBound{S}\AgdaSpace{}%
  294. \AgdaSymbol{:}\AgdaSpace{}%
  295. \AgdaPostulate{Size}\AgdaSpace{}%
  296. \AgdaSymbol{→}\AgdaSpace{}%
  297. \AgdaPrimitive{Set}\AgdaSymbol{\}}\AgdaSpace{}%
  298. \AgdaSymbol{\{}\AgdaBound{A}\AgdaSpace{}%
  299. \AgdaSymbol{:}\AgdaSpace{}%
  300. \AgdaPrimitive{Set}\AgdaSymbol{\}}\<%
  301. \\
  302. %
  303. \\[\AgdaEmptyExtraSkip]%
  304. \>[0][@{}l@{\AgdaIndent{0}}]%
  305. \>[2]\AgdaSymbol{(}\AgdaBound{step}\AgdaSpace{}%
  306. \AgdaSymbol{:}\AgdaSpace{}%
  307. \AgdaSymbol{∀}\AgdaSpace{}%
  308. \AgdaSymbol{\{}\AgdaBound{i}\AgdaSymbol{\}}\AgdaSpace{}%
  309. \AgdaSymbol{→}\AgdaSpace{}%
  310. \AgdaBound{S}\AgdaSpace{}%
  311. \AgdaBound{i}\AgdaSpace{}%
  312. \AgdaSymbol{→}\AgdaSpace{}%
  313. \AgdaRecord{List1}\AgdaSpace{}%
  314. \AgdaBound{A}\AgdaSpace{}%
  315. \AgdaOperator{\AgdaRecord{×}}\AgdaSpace{}%
  316. \AgdaSymbol{(∀}\AgdaSpace{}%
  317. \AgdaSymbol{\{}\AgdaBound{j}\AgdaSpace{}%
  318. \AgdaSymbol{:}\AgdaSpace{}%
  319. \AgdaOperator{\AgdaPostulate{Size<}}\AgdaSpace{}%
  320. \AgdaBound{i}\AgdaSymbol{\}}\AgdaSpace{}%
  321. \AgdaSymbol{→}\AgdaSpace{}%
  322. \AgdaBound{S}\AgdaSpace{}%
  323. \AgdaBound{j}\AgdaSymbol{))}\AgdaSpace{}%
  324. \AgdaSymbol{→}\<%
  325. \\
  326. %
  327. \\[\AgdaEmptyExtraSkip]%
  328. %
  329. \>[2]\AgdaSymbol{∀}\AgdaSpace{}%
  330. \AgdaSymbol{\{}\AgdaBound{i}\AgdaSymbol{\}}\AgdaSpace{}%
  331. \AgdaSymbol{→}\AgdaSpace{}%
  332. \AgdaSymbol{(}\AgdaBound{s}\AgdaSpace{}%
  333. \AgdaSymbol{:}\AgdaSpace{}%
  334. \AgdaBound{S}\AgdaSpace{}%
  335. \AgdaBound{i}\AgdaSymbol{)}\AgdaSpace{}%
  336. \AgdaSymbol{→}\AgdaSpace{}%
  337. \AgdaRecord{Stream}\AgdaSpace{}%
  338. \AgdaSymbol{\{}\AgdaBound{i}\AgdaSymbol{\}}\AgdaSpace{}%
  339. \AgdaBound{A}\<%
  340. \\
  341. %
  342. \\[\AgdaEmptyExtraSkip]%
  343. \>[0]\AgdaField{head}%
  344. \>[6]\AgdaSymbol{(}\AgdaFunction{unfold⁺}\AgdaSpace{}%
  345. \AgdaBound{step}\AgdaSpace{}%
  346. \AgdaBound{s}\AgdaSymbol{)}\AgdaSpace{}%
  347. \AgdaSymbol{=}%
  348. \>[26]\AgdaField{head}\AgdaSpace{}%
  349. \AgdaSymbol{(}\AgdaField{fst}\AgdaSpace{}%
  350. \AgdaSymbol{(}\AgdaBound{step}\AgdaSpace{}%
  351. \AgdaBound{s}\AgdaSymbol{))}\<%
  352. \\
  353. \>[0]\AgdaField{tail}%
  354. \>[6]\AgdaSymbol{(}\AgdaFunction{unfold⁺}\AgdaSpace{}%
  355. \AgdaBound{step}\AgdaSpace{}%
  356. \AgdaBound{s}\AgdaSymbol{)}\AgdaSpace{}%
  357. \AgdaSymbol{=}%
  358. \>[26]\AgdaKeyword{let}%
  359. \>[31]\AgdaSymbol{((\AgdaUnderscore{}}\AgdaSpace{}%
  360. \AgdaOperator{\AgdaInductiveConstructor{∷}}\AgdaSpace{}%
  361. \AgdaBound{l}\AgdaSymbol{)}\AgdaSpace{}%
  362. \AgdaOperator{\AgdaInductiveConstructor{,}}\AgdaSpace{}%
  363. \AgdaBound{s′}\AgdaSymbol{)}\AgdaSpace{}%
  364. \AgdaSymbol{=}\AgdaSpace{}%
  365. \AgdaBound{step}\AgdaSpace{}%
  366. \AgdaBound{s}\<%
  367. \\
  368. %
  369. \>[26]\AgdaKeyword{in}%
  370. \>[31]\AgdaBound{l}\AgdaSpace{}%
  371. \AgdaOperator{\AgdaFunction{++ˢ}}\AgdaSpace{}%
  372. \AgdaFunction{unfold⁺}\AgdaSpace{}%
  373. \AgdaBound{step}\AgdaSpace{}%
  374. \AgdaBound{s′}\<%
  375. \end{code}
  376. Problem: The ∷ in the last let statement is not colored with constructor color.
  377. \end{document}