1 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
2 xmlns:m="http://www.w3.org/1998/Math/MathML">
4 <xsl:include href="nuprl_proof.xsl"/>
5 <xsl:include href="nuprl_abstract.xsl"/>
6 <xsl:include href="nuprl_rules.xsl"/>
9 <xsl:template match="var">
11 <xsl:value-of select="@val"/>
16 <xsl:template match="function">
18 <xsl:when test="type_of">
20 <xsl:when test="type_of/@var=""">
22 <m:csymbol>arrow</m:csymbol>
23 <xsl:apply-templates select="type_of/*"/>
24 <xsl:apply-templates select="*[2]"/>
29 <m:csymbol>prod</m:csymbol>
32 <xsl:value-of select="type_of/@var"/>
35 <xsl:apply-templates select="type_of/*"/>
38 <xsl:apply-templates select="*[2]"/>
45 <m:csymbol>arrow</m:csymbol>
46 <xsl:apply-templates select="*[1]"/>
47 <xsl:apply-templates select="*[2]"/>
54 <xsl:template match="lambda">
58 <xsl:value-of select="@binder"/>
61 <xsl:apply-templates/>
66 <xsl:template match="apply">
68 <m:csymbol>app</m:csymbol>
69 <xsl:apply-templates select="*[1]"/>
70 <xsl:apply-templates select="*[2]"/>
75 <xsl:template match="product">
78 <xsl:when test="type_of">
80 <xsl:when test="type_of/@var=""">
81 <m:csymbol>product_ind</m:csymbol>
83 <xsl:apply-templates select="type_of/*"/>
87 <m:csymbol>product</m:csymbol>
90 <xsl:value-of select="type_of/@var"/>
93 <xsl:apply-templates select="type_of/*"/>
100 <m:csymbol>product_ind</m:csymbol>
102 <xsl:apply-templates select="*[1]"/>
106 <xsl:apply-templates select="*[2]"/>
111 <xsl:template match="pair">
113 <m:csymbol>pair</m:csymbol>
114 <xsl:apply-templates select="*[1]"/>
115 <xsl:apply-templates select="*[2]"/>
120 <xsl:template match="spread">
122 <m:csymbol>mutcase</m:csymbol>
123 <m:csymbol>NONE</m:csymbol>
124 <xsl:apply-templates select="*[1]"/>
127 <xsl:apply-templates select="*[4]"/>
129 <m:csymbol>pair</m:csymbol>
130 <xsl:apply-templates select="binder[1]"/>
131 <xsl:apply-templates select="binder[2]"/>
139 <xsl:template match="union">
141 <m:csymbol>union</m:csymbol>
142 <xsl:apply-templates select="*[1]"/>
143 <xsl:apply-templates select="*[2]"/>
148 <xsl:template match="inl">
150 <m:csymbol>inl</m:csymbol>
151 <xsl:apply-templates select="*[1]"/>
156 <xsl:template match="inr">
158 <m:csymbol>inr</m:csymbol>
159 <xsl:apply-templates select="*[1]"/>
164 <xsl:template match="decide">
166 <m:csymbol>mutcase</m:csymbol>
167 <m:csymbol>NONE</m:csymbol>
168 <xsl:apply-templates select="*[1]"/>
171 <xsl:apply-templates select="*[3]"/>
173 <m:csymbol>inl</m:csymbol>
174 <xsl:apply-templates select="binder[1]"/>
178 <xsl:apply-templates select="*[5]"/>
180 <m:csymbol>inr</m:csymbol>
181 <xsl:apply-templates select="binder[2]"/>
189 <xsl:template match="universe">
191 <m:csymbol>universe</m:csymbol>
193 <xsl:value-of select="@level"/>
199 <xsl:template match="equal">
201 <m:csymbol>equal</m:csymbol>
202 <xsl:apply-templates select="*[1]"/>
203 <xsl:apply-templates select="*[2]"/>
204 <xsl:apply-templates select="*[3]"/>
209 <xsl:template match="axiom">
211 <m:csymbol>Ax</m:csymbol>
216 <xsl:template match="void">
218 <m:csymbol>void</m:csymbol>
223 <xsl:template match="any">
225 <m:csymbol>mutcase</m:csymbol>
226 <m:csymbol>NONE</m:csymbol>
227 <xsl:apply-templates select="*[1]"/>
232 <xsl:template match="atom">
234 <m:csymbol>atom</m:csymbol>
239 <xsl:template match="token">
241 <m:csymbol>token</m:csymbol>
243 <xsl:value-of select="@val"/>
249 <xsl:template match="atom_eq">
251 <m:csymbol>if_then_else</m:csymbol>
252 <m:where>atom_eq</m:where>
253 <xsl:apply-templates select="*[1]"/>
254 <xsl:apply-templates select="*[2]"/>
255 <xsl:apply-templates select="*[3]"/>
256 <xsl:apply-templates select="*[4]"/>
261 <xsl:template match="int">
266 <xsl:template match="natural_number">
268 <xsl:value-of select="@val"/>
273 <xsl:template match="minus">
276 <xsl:apply-templates select="*[1]"/>
281 <xsl:template match="add">
284 <xsl:apply-templates select="*[1]"/>
285 <xsl:apply-templates select="*[2]"/>
290 <xsl:template match="subtract">
293 <xsl:apply-templates select="*[1]"/>
294 <xsl:apply-templates select="*[2]"/>
299 <xsl:template match="multiply">
302 <xsl:apply-templates select="*[1]"/>
303 <xsl:apply-templates select="*[2]"/>
308 <xsl:template match="divide">
311 <xsl:apply-templates select="*[1]"/>
312 <xsl:apply-templates select="*[2]"/>
317 <xsl:template match="remainder">
320 <xsl:apply-templates select="*[1]"/>
321 <xsl:apply-templates select="*[2]"/>
326 <xsl:template match="int_eq">
328 <m:csymbol>if_then_else</m:csymbol>
329 <m:where>int_eq</m:where>
330 <xsl:apply-templates select="*[1]"/>
331 <xsl:apply-templates select="*[2]"/>
332 <xsl:apply-templates select="*[3]"/>
333 <xsl:apply-templates select="*[4]"/>
338 <xsl:template match="less">
340 <m:csymbol>if_then_else</m:csymbol>
341 <m:where>less</m:where>
342 <xsl:apply-templates select="*[1]"/>
343 <xsl:apply-templates select="*[2]"/>
344 <xsl:apply-templates select="*[3]"/>
345 <xsl:apply-templates select="*[4]"/>
350 <xsl:template match="ind">
352 <m:csymbol>by_induction</m:csymbol>
354 <m:csymbol>NONE</m:csymbol>
355 <m:apply> <!-- CASO BASE -->
356 <m:csymbol>inductive_case</m:csymbol>
358 <m:csymbol>case_lhs</m:csymbol>
362 <m:csymbol>induction_hypothesis</m:csymbol>
364 <xsl:apply-templates select="*[5]"/>
367 <m:apply> <!--CASO INDUTTIVO PER I NUMERI POSITIVI-->
368 <m:csymbol>inductive_case</m:csymbol>
370 <m:csymbol>case_lhs</m:csymbol>
373 <xsl:apply-templates select="*[6]"/> <!-- u -->
378 <m:csymbol>induction_hypothesis</m:csymbol>
379 <xsl:apply-templates select="*[7]"/> <!-- v -->
381 <xsl:apply-templates select="*[8]"/> <!-- t -->
384 <m:apply> <!--CASO INDUTTIVO PER I NUMERI NEGATIVI-->
385 <m:csymbol>inductive_case</m:csymbol>
387 <m:csymbol>case_lhs</m:csymbol>
390 <xsl:apply-templates select="*[2]"/> <!-- x -->
395 <m:csymbol>induction_hypothesis</m:csymbol>
396 <xsl:apply-templates select="*[3]"/> <!-- y -->
398 <xsl:apply-templates select="*[4]"/>
401 <m:csymbol>extra_args</m:csymbol>
402 <xsl:apply-templates select="*[1]"/> <!-- a -->
408 <xsl:template match="less_than">
411 <xsl:apply-templates select="*[1]"/>
412 <xsl:apply-templates select="*[2]"/>
417 <xsl:template match="list">
422 <xsl:template match="nil">
424 <m:csymbol>nil</m:csymbol>
429 <xsl:template match="cons">
431 <m:csymbol>cons</m:csymbol>
432 <xsl:apply-templates select="*[1]"/>
433 <xsl:apply-templates select="*[2]"/>
438 <xsl:template match="list_ind">
440 <m:csymbol>by_induction</m:csymbol>
441 <m:ci>list_ind</m:ci>
442 <m:csymbol>NONE</m:csymbol>
444 <m:csymbol>inductive_case</m:csymbol>
446 <m:csymbol>case_lhs</m:csymbol>
450 <m:csymbol>induction_hypothesis</m:csymbol>
452 <xsl:apply-templates select="*[2]"/> <!-- base -->
455 <m:csymbol>inductive_case</m:csymbol>
457 <m:csymbol>case_lhs</m:csymbol>
460 <xsl:apply-templates select="*[3]"/> <!-- x -->
464 <xsl:apply-templates select="*[4]"/> <!-- l -->
469 <m:csymbol>induction_hypothesis</m:csymbol>
470 <xsl:apply-templates select="*[5]"/> <!-- Fxl -->
472 <xsl:apply-templates select="*[6]"/> <!-- t -->
475 <m:csymbol>extra_args</m:csymbol>
476 <xsl:apply-templates select="*[1]"/> <!-- s -->
482 <xsl:template match="rec">
484 <m:csymbol>rec</m:csymbol>
485 <xsl:apply-templates select="*[1]"/>
486 <xsl:apply-templates select="*[2]"/>
491 <xsl:template match="rec_ind">
493 <m:csymbol>app</m:csymbol>
495 <m:csymbol>fix</m:csymbol>
497 <xsl:apply-templates select="*[2]"/>
501 <xsl:apply-templates select="*[2]"/>
507 <xsl:apply-templates select="*[3]"/>
509 <xsl:apply-templates select="*[4]"/>
512 <xsl:apply-templates select="*[1]"/>
517 <xsl:template match="set">
519 <m:csymbol>t_set</m:csymbol>
522 <xsl:when test="type_of">
524 <xsl:value-of select="type_of/@var"/>
527 <xsl:apply-templates select="type_of/*"/>
532 <xsl:apply-templates select="*[1]"/>
537 <xsl:apply-templates select="*[2]"/>
542 <xsl:template match="isect">
544 <m:csymbol>isect</m:csymbol>
547 <xsl:value-of select="type_of/@var"/>
550 <xsl:apply-templates select="type_of/*"/>
553 <xsl:apply-templates select="*[1]"/>
558 <xsl:template match="quotient">
560 <m:csymbol>quotient</m:csymbol>
561 <xsl:apply-templates select="*[1]"/>
563 <xsl:value-of select="binder[1]/@var"/>
566 <xsl:value-of select="binder[2]/@var"/>
568 <xsl:apply-templates select="*[4]"/>
573 <xsl:template match="type_of">
575 <m:csymbol>type_of</m:csymbol>
577 <xsl:value-of select="@var"/>
579 <xsl:apply-templates select="*[1]"/>
583 <xsl:template match="prop">
585 <m:csymbol>prop</m:csymbol>
587 <xsl:value-of select="@level"/>
592 <xsl:template match="binder">
594 <xsl:value-of select="@var"/>