LaTeX-succeed.tex 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403
  1. \documentclass{article}
  2. \usepackage{agda}
  3. \begin{document}
  4. \AgdaHide{
  5. \begin{code}%
  6. \>[0]\AgdaKeyword{module}\AgdaSpace{}%
  7. \AgdaModule{LaTeX-succeed}\AgdaSpace{}%
  8. \AgdaKeyword{where}\<%
  9. \end{code}
  10. }
  11. \begin{code}%
  12. \>[0]\AgdaKeyword{data}\AgdaSpace{}%
  13. \AgdaDatatype{Bool}\AgdaSpace{}%
  14. \AgdaSymbol{:}\AgdaSpace{}%
  15. \AgdaPrimitive{Set}\AgdaSpace{}%
  16. \AgdaKeyword{where}\<%
  17. \\
  18. \>[0][@{}l@{\AgdaIndent{0}}]%
  19. \>[2]\AgdaInductiveConstructor{true}%
  20. \>[9]\AgdaSymbol{:}\AgdaSpace{}%
  21. \AgdaDatatype{Bool}\<%
  22. \\
  23. %
  24. \>[2]\AgdaInductiveConstructor{false}%
  25. \>[9]\AgdaSymbol{:}\AgdaSpace{}%
  26. \AgdaDatatype{Bool}\<%
  27. \\
  28. %
  29. \\[\AgdaEmptyExtraSkip]%
  30. \>[0]\AgdaOperator{\AgdaFunction{if\AgdaUnderscore{}then\AgdaUnderscore{}else\AgdaUnderscore{}}}\AgdaSpace{}%
  31. \AgdaSymbol{:}\AgdaSpace{}%
  32. \AgdaSymbol{\{}\AgdaBound{A}\AgdaSpace{}%
  33. \AgdaSymbol{:}\AgdaSpace{}%
  34. \AgdaPrimitive{Set}\AgdaSymbol{\}}\AgdaSpace{}%
  35. \AgdaSymbol{→}\AgdaSpace{}%
  36. \AgdaDatatype{Bool}\AgdaSpace{}%
  37. \AgdaSymbol{→}\AgdaSpace{}%
  38. \AgdaBound{A}\AgdaSpace{}%
  39. \AgdaSymbol{→}\AgdaSpace{}%
  40. \AgdaBound{A}\AgdaSpace{}%
  41. \AgdaSymbol{→}\AgdaSpace{}%
  42. \AgdaBound{A}\<%
  43. \\
  44. \>[0]\AgdaOperator{\AgdaFunction{if}}\AgdaSpace{}%
  45. \AgdaInductiveConstructor{true}%
  46. \>[10]\AgdaOperator{\AgdaFunction{then}}\AgdaSpace{}%
  47. \AgdaBound{t}\AgdaSpace{}%
  48. \AgdaOperator{\AgdaFunction{else}}\AgdaSpace{}%
  49. \AgdaBound{f}\AgdaSpace{}%
  50. \AgdaSymbol{=}\AgdaSpace{}%
  51. \AgdaBound{t}\<%
  52. \\
  53. \>[0]\AgdaOperator{\AgdaFunction{if}}\AgdaSpace{}%
  54. \AgdaInductiveConstructor{false}%
  55. \>[10]\AgdaOperator{\AgdaFunction{then}}\AgdaSpace{}%
  56. \AgdaBound{t}\AgdaSpace{}%
  57. \AgdaOperator{\AgdaFunction{else}}\AgdaSpace{}%
  58. \AgdaBound{f}\AgdaSpace{}%
  59. \AgdaSymbol{=}\AgdaSpace{}%
  60. \AgdaBound{f}\<%
  61. \\
  62. %
  63. \\[\AgdaEmptyExtraSkip]%
  64. \>[0]\AgdaKeyword{data}\AgdaSpace{}%
  65. \AgdaDatatype{ℕ}\AgdaSpace{}%
  66. \AgdaSymbol{:}\AgdaSpace{}%
  67. \AgdaPrimitive{Set}\AgdaSpace{}%
  68. \AgdaKeyword{where}\<%
  69. \\
  70. \>[0][@{}l@{\AgdaIndent{0}}]%
  71. \>[2]\AgdaInductiveConstructor{zero}%
  72. \>[8]\AgdaSymbol{:}\AgdaSpace{}%
  73. \AgdaDatatype{ℕ}\<%
  74. \\
  75. %
  76. \>[2]\AgdaInductiveConstructor{suc}%
  77. \>[8]\AgdaSymbol{:}\AgdaSpace{}%
  78. \AgdaDatatype{ℕ}\AgdaSpace{}%
  79. \AgdaSymbol{→}\AgdaSpace{}%
  80. \AgdaDatatype{ℕ}\<%
  81. \\
  82. %
  83. \\[\AgdaEmptyExtraSkip]%
  84. \>[0]\AgdaOperator{\AgdaFunction{\AgdaUnderscore{}+\AgdaUnderscore{}}}\AgdaSpace{}%
  85. \AgdaSymbol{:}\AgdaSpace{}%
  86. \AgdaDatatype{ℕ}\AgdaSpace{}%
  87. \AgdaSymbol{→}\AgdaSpace{}%
  88. \AgdaDatatype{ℕ}\AgdaSpace{}%
  89. \AgdaSymbol{→}\AgdaSpace{}%
  90. \AgdaDatatype{ℕ}\<%
  91. \\
  92. \>[0]\AgdaInductiveConstructor{zero}%
  93. \>[17]\AgdaOperator{\AgdaFunction{+}}\AgdaSpace{}%
  94. \AgdaBound{n}\AgdaSpace{}%
  95. \AgdaSymbol{=}\AgdaSpace{}%
  96. \AgdaBound{n}\<%
  97. \\
  98. \>[0]\AgdaInductiveConstructor{suc}\AgdaSpace{}%
  99. \AgdaBound{m}\AgdaSpace{}%
  100. \AgdaComment{\{-\ ugh\ -\}}%
  101. \>[17]\AgdaOperator{\AgdaFunction{+}}\AgdaSpace{}%
  102. \AgdaBound{n}\AgdaSpace{}%
  103. \AgdaSymbol{=}\AgdaSpace{}%
  104. \AgdaInductiveConstructor{suc}\AgdaSpace{}%
  105. \AgdaSymbol{(}\AgdaBound{m}\AgdaSpace{}%
  106. \AgdaOperator{\AgdaFunction{+}}\AgdaSpace{}%
  107. \AgdaBound{n}\AgdaSymbol{)}\<%
  108. \\
  109. %
  110. \\[\AgdaEmptyExtraSkip]%
  111. \>[0]\AgdaSymbol{\{-\#}\AgdaSpace{}%
  112. \AgdaKeyword{BUILTIN}\AgdaSpace{}%
  113. \AgdaKeyword{NATURAL}\AgdaSpace{}%
  114. \AgdaDatatype{ℕ}\AgdaSpace{}%
  115. \AgdaSymbol{\#-\}}\<%
  116. \\
  117. %
  118. \\[\AgdaEmptyExtraSkip]%
  119. \>[0]\AgdaFunction{alignment}\AgdaSpace{}%
  120. \AgdaSymbol{:}\AgdaSpace{}%
  121. \AgdaSymbol{(}\AgdaBound{m}\AgdaSpace{}%
  122. \AgdaBound{n}\AgdaSpace{}%
  123. \AgdaBound{o}\AgdaSpace{}%
  124. \AgdaBound{p}\AgdaSpace{}%
  125. \AgdaSymbol{:}\AgdaSpace{}%
  126. \AgdaDatatype{ℕ}\AgdaSymbol{)}\AgdaSpace{}%
  127. \AgdaSymbol{→}\AgdaSpace{}%
  128. \AgdaDatatype{ℕ}\<%
  129. \\
  130. \>[0]\AgdaFunction{alignment}%
  131. \>[11]\AgdaNumber{0}%
  132. \>[14]\AgdaNumber{1}%
  133. \>[20]\AgdaNumber{2}%
  134. \>[23]\AgdaNumber{3}%
  135. \>[29]\AgdaSymbol{=}%
  136. \>[32]\AgdaNumber{4}\<%
  137. \\
  138. \>[0]\AgdaFunction{alignment}%
  139. \>[14]\AgdaNumber{1}%
  140. \>[17]\AgdaNumber{2}%
  141. \>[20]\AgdaNumber{3}%
  142. \>[23]\AgdaNumber{4}%
  143. \>[26]\AgdaSymbol{=}%
  144. \>[29]\AgdaNumber{5}\<%
  145. \\
  146. \>[0]\AgdaFunction{alignment}%
  147. \>[17]\AgdaNumber{2}%
  148. \>[20]\AgdaNumber{3}%
  149. \>[23]\AgdaNumber{4}%
  150. \>[26]\AgdaNumber{5}%
  151. \>[32]\AgdaSymbol{=}\AgdaSpace{}%
  152. \AgdaNumber{6}\<%
  153. \\
  154. \>[0]\AgdaCatchallClause{\AgdaFunction{alignment}}%
  155. \>[20]\AgdaCatchallClause{\AgdaSymbol{\AgdaUnderscore{}}}%
  156. \>[23]\AgdaCatchallClause{\AgdaSymbol{\AgdaUnderscore{}}}%
  157. \>[26]\AgdaCatchallClause{\AgdaSymbol{\AgdaUnderscore{}}}%
  158. \>[29]\AgdaCatchallClause{\AgdaSymbol{\AgdaUnderscore{}}}%
  159. \>[32]\AgdaSymbol{=}\AgdaSpace{}%
  160. \AgdaNumber{0}\<%
  161. \end{code}
  162. \begin{code}%
  163. \>[0]\AgdaKeyword{data}\AgdaSpace{}%
  164. \AgdaDatatype{⊥}\AgdaSpace{}%
  165. \AgdaSymbol{:}\AgdaSpace{}%
  166. \AgdaPrimitive{Set}\AgdaSpace{}%
  167. \AgdaKeyword{where}\<%
  168. \\
  169. %
  170. \\[\AgdaEmptyExtraSkip]%
  171. \>[0]\AgdaKeyword{record}\AgdaSpace{}%
  172. \AgdaRecord{R}\AgdaSpace{}%
  173. \AgdaSymbol{:}\AgdaSpace{}%
  174. \AgdaPrimitive{Set₁}\AgdaSpace{}%
  175. \AgdaKeyword{where}\<%
  176. \\
  177. \>[0][@{}l@{\AgdaIndent{0}}]%
  178. \>[2]\AgdaKeyword{field}\<%
  179. \\
  180. \>[2][@{}l@{\AgdaIndent{0}}]%
  181. \>[4]\AgdaField{f}%
  182. \>[7]\AgdaSymbol{:}\AgdaSpace{}%
  183. \AgdaPrimitive{Set}\<%
  184. \\
  185. %
  186. \>[4]\AgdaField{g}%
  187. \>[7]\AgdaSymbol{:}\AgdaSpace{}%
  188. \AgdaPrimitive{Set}\<%
  189. \\
  190. %
  191. \\[\AgdaEmptyExtraSkip]%
  192. \>[0]\AgdaKeyword{record}\AgdaSpace{}%
  193. \AgdaRecord{R′}\AgdaSpace{}%
  194. \AgdaSymbol{(}\AgdaBound{A}\AgdaSpace{}%
  195. \AgdaBound{B}\AgdaSpace{}%
  196. \AgdaSymbol{:}\AgdaSpace{}%
  197. \AgdaPrimitive{Set}\AgdaSymbol{)}\AgdaSpace{}%
  198. \AgdaSymbol{:}\AgdaSpace{}%
  199. \AgdaPrimitive{Set₁}\AgdaSpace{}%
  200. \AgdaKeyword{where}\<%
  201. \\
  202. \>[0][@{}l@{\AgdaIndent{0}}]%
  203. \>[2]\AgdaKeyword{field}\<%
  204. \\
  205. \>[2][@{}l@{\AgdaIndent{0}}]%
  206. \>[4]\AgdaField{h}%
  207. \>[7]\AgdaSymbol{:}\AgdaSpace{}%
  208. \AgdaPrimitive{Set}\<%
  209. \\
  210. %
  211. \>[4]\AgdaField{j}%
  212. \>[7]\AgdaSymbol{:}\AgdaSpace{}%
  213. \AgdaPrimitive{Set}\<%
  214. \\
  215. %
  216. \>[4]\AgdaField{r}%
  217. \>[7]\AgdaSymbol{:}\AgdaSpace{}%
  218. \AgdaRecord{R}\<%
  219. \end{code}
  220. \begin{code}%
  221. \>[0]\AgdaKeyword{module}\AgdaSpace{}%
  222. \AgdaModule{M}\AgdaSpace{}%
  223. \AgdaKeyword{where}\<%
  224. \\
  225. \>[0][@{}l@{\AgdaIndent{0}}]%
  226. \>[2]\AgdaFunction{r′}\AgdaSpace{}%
  227. \AgdaSymbol{:}\AgdaSpace{}%
  228. \AgdaSymbol{∀}\AgdaSpace{}%
  229. \AgdaSymbol{\{}\AgdaBound{A}\AgdaSpace{}%
  230. \AgdaBound{B}\AgdaSpace{}%
  231. \AgdaSymbol{:}\AgdaSpace{}%
  232. \AgdaPrimitive{Set}\AgdaSymbol{\}}\AgdaSpace{}%
  233. \AgdaSymbol{→}\AgdaSpace{}%
  234. \AgdaRecord{R′}\AgdaSpace{}%
  235. \AgdaBound{A}\AgdaSpace{}%
  236. \AgdaBound{B}\<%
  237. \\
  238. %
  239. \>[2]\AgdaFunction{r′}\AgdaSpace{}%
  240. \AgdaSymbol{=}\AgdaSpace{}%
  241. \AgdaKeyword{record}\<%
  242. \\
  243. \>[2][@{}l@{\AgdaIndent{0}}]%
  244. \>[4]\AgdaSymbol{\{}\AgdaSpace{}%
  245. \AgdaField{h}%
  246. \>[9]\AgdaSymbol{=}\AgdaSpace{}%
  247. \AgdaDatatype{⊥}\<%
  248. \\
  249. %
  250. \>[4]\AgdaSymbol{;}\AgdaSpace{}%
  251. \AgdaField{j}%
  252. \>[9]\AgdaSymbol{=}\AgdaSpace{}%
  253. \AgdaDatatype{⊥}\<%
  254. \\
  255. %
  256. \>[4]\AgdaSymbol{;}\AgdaSpace{}%
  257. \AgdaField{r}%
  258. \>[112I]\AgdaSymbol{=}\AgdaSpace{}%
  259. \AgdaKeyword{record}\<%
  260. \\
  261. \>[.][@{}l@{}]\<[112I]%
  262. \>[8]\AgdaSymbol{\{}\AgdaSpace{}%
  263. \AgdaField{f}%
  264. \>[13]\AgdaSymbol{=}\AgdaSpace{}%
  265. \AgdaDatatype{⊥}\<%
  266. \\
  267. %
  268. \>[8]\AgdaSymbol{;}\AgdaSpace{}%
  269. \AgdaField{g}%
  270. \>[13]\AgdaSymbol{=}\AgdaSpace{}%
  271. \AgdaDatatype{⊥}\<%
  272. \\
  273. %
  274. \>[8]\AgdaSymbol{\}}\<%
  275. \\
  276. %
  277. \>[4]\AgdaSymbol{\}}\<%
  278. \end{code}
  279. Andreas, 2018-04-03: The following two modules test the highlighting of projection patterns.
  280. \begin{code}%
  281. \>[0]\AgdaKeyword{module}\AgdaSpace{}%
  282. \AgdaModule{QualifiedProjectionPatterns}\AgdaSpace{}%
  283. \AgdaKeyword{where}\<%
  284. \\
  285. %
  286. \\[\AgdaEmptyExtraSkip]%
  287. \>[0][@{}l@{\AgdaIndent{0}}]%
  288. \>[2]\AgdaFunction{r}\AgdaSpace{}%
  289. \AgdaSymbol{:}\AgdaSpace{}%
  290. \AgdaRecord{R}\<%
  291. \\
  292. %
  293. \>[2]\AgdaFunction{r}\AgdaSpace{}%
  294. \AgdaSymbol{.}\AgdaField{R.f}\AgdaSpace{}%
  295. \AgdaSymbol{=}\AgdaSpace{}%
  296. \AgdaDatatype{Bool}\<%
  297. \\
  298. %
  299. \>[2]\AgdaFunction{r}\AgdaSpace{}%
  300. \AgdaSymbol{.}\AgdaField{R.g}\AgdaSpace{}%
  301. \AgdaSymbol{=}\AgdaSpace{}%
  302. \AgdaDatatype{⊥}\<%
  303. \\
  304. %
  305. \\[\AgdaEmptyExtraSkip]%
  306. %
  307. \>[2]\AgdaFunction{r′}\AgdaSpace{}%
  308. \AgdaSymbol{:}\AgdaSpace{}%
  309. \AgdaRecord{R′}\AgdaSpace{}%
  310. \AgdaDatatype{Bool}\AgdaSpace{}%
  311. \AgdaDatatype{⊥}\<%
  312. \\
  313. %
  314. \>[2]\AgdaField{R′.h}\AgdaSpace{}%
  315. \AgdaFunction{r′}\AgdaSpace{}%
  316. \AgdaSymbol{=}\AgdaSpace{}%
  317. \AgdaDatatype{⊥}\<%
  318. \\
  319. %
  320. \>[2]\AgdaField{R′.j}\AgdaSpace{}%
  321. \AgdaFunction{r′}\AgdaSpace{}%
  322. \AgdaSymbol{=}\AgdaSpace{}%
  323. \AgdaDatatype{Bool}\AgdaSpace{}%
  324. \AgdaSymbol{→}\AgdaSpace{}%
  325. \AgdaDatatype{Bool}\<%
  326. \\
  327. %
  328. \>[2]\AgdaField{R′.r}\AgdaSpace{}%
  329. \AgdaFunction{r′}\AgdaSpace{}%
  330. \AgdaSymbol{=}\AgdaSpace{}%
  331. \AgdaFunction{r}\<%
  332. \end{code}
  333. \begin{code}%
  334. \>[0]\AgdaKeyword{module}\AgdaSpace{}%
  335. \AgdaModule{UnqualifiedProjectionPatterns}\AgdaSpace{}%
  336. \AgdaKeyword{where}\<%
  337. \\
  338. \>[0][@{}l@{\AgdaIndent{0}}]%
  339. \>[2]\AgdaKeyword{open}\AgdaSpace{}%
  340. \AgdaModule{R}\AgdaSymbol{;}\AgdaSpace{}%
  341. \AgdaKeyword{open}\AgdaSpace{}%
  342. \AgdaModule{R′}\<%
  343. \\
  344. %
  345. \\[\AgdaEmptyExtraSkip]%
  346. %
  347. \>[2]\AgdaFunction{r₀}\AgdaSpace{}%
  348. \AgdaSymbol{:}\AgdaSpace{}%
  349. \AgdaRecord{R}\<%
  350. \\
  351. %
  352. \>[2]\AgdaFunction{r₀}\AgdaSpace{}%
  353. \AgdaSymbol{.}\AgdaField{f}\AgdaSpace{}%
  354. \AgdaSymbol{=}\AgdaSpace{}%
  355. \AgdaDatatype{Bool}\<%
  356. \\
  357. %
  358. \>[2]\AgdaFunction{r₀}\AgdaSpace{}%
  359. \AgdaSymbol{.}\AgdaField{g}\AgdaSpace{}%
  360. \AgdaSymbol{=}\AgdaSpace{}%
  361. \AgdaDatatype{⊥}\<%
  362. \\
  363. %
  364. \\[\AgdaEmptyExtraSkip]%
  365. %
  366. \>[2]\AgdaFunction{r′}\AgdaSpace{}%
  367. \AgdaSymbol{:}\AgdaSpace{}%
  368. \AgdaRecord{R′}\AgdaSpace{}%
  369. \AgdaDatatype{Bool}\AgdaSpace{}%
  370. \AgdaDatatype{⊥}\<%
  371. \\
  372. %
  373. \>[2]\AgdaField{h}\AgdaSpace{}%
  374. \AgdaFunction{r′}\AgdaSpace{}%
  375. \AgdaSymbol{=}\AgdaSpace{}%
  376. \AgdaDatatype{⊥}\<%
  377. \\
  378. %
  379. \>[2]\AgdaField{j}\AgdaSpace{}%
  380. \AgdaFunction{r′}\AgdaSpace{}%
  381. \AgdaSymbol{=}\AgdaSpace{}%
  382. \AgdaDatatype{Bool}\AgdaSpace{}%
  383. \AgdaSymbol{→}\AgdaSpace{}%
  384. \AgdaDatatype{Bool}\<%
  385. \\
  386. %
  387. \>[2]\AgdaField{r}\AgdaSpace{}%
  388. \AgdaFunction{r′}\AgdaSpace{}%
  389. \AgdaSymbol{=}\AgdaSpace{}%
  390. \AgdaFunction{r₀}\<%
  391. \end{code}
  392. \end{document}