File: proof3.xsl

package info (click to toggle)
prover9-manual 0.0.200902a-2.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 4,272 kB
  • sloc: xml: 212; csh: 144; python: 73; makefile: 42; perl: 10; sh: 1
file content (168 lines) | stat: -rw-r--r-- 3,572 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<!-- ************************ root (proofs) template ***************  -->

<xsl:template match="/">
<html>
<body>

<!-- print each attribute of "proofs"
<xsl:for-each select="proofs/@*">
  <xsl:value-of select="name()" /> = <xsl:value-of select="."/><br/>
</xsl:for-each>
-->

<xsl:if test="proofs/heading">
  <h3>Prover9 Job</h3>
  <blockquote>
  <pre>
  <xsl:value-of select="proofs/heading" />
  </pre>
  </blockquote>
</xsl:if>

<xsl:if test="proofs/source">
  <p />This page was generated from file
	<a href="{proofs/source}">
	<xsl:value-of select="proofs/source" />
	</a>.
</xsl:if>

<xsl:if test="proofs/@number_of_proofs">
  <p />Number of proofs here: 
	<xsl:value-of select="proofs/@number_of_proofs" />.
</xsl:if>

<xsl:apply-templates select="proofs/proof"/> 

</body>
</html>
</xsl:template>

<!-- ************************ proof template ***********************  -->

<xsl:template match="proof">

<hr />
<h3>Proof
<xsl:if test="@number">
     <xsl:value-of select="@number" />
</xsl:if>
</h3>

<xsl:if test="comments">
  <blockquote>
  <pre>
  <xsl:value-of select="comments" />
  </pre>
  </blockquote>
</xsl:if>

<style type="text/css">
td { white-space: nowrap; }
</style>

<table>
<xsl:apply-templates select="clause"/> 
</table>
</xsl:template>

<!-- ************************ clause template ***********************  -->

<xsl:template match="clause">
<tr>

<td>
<font color="red">
<xsl:value-of select="@id"/>
</font>
</td>
<td></td>  <!-- empty column puts a little extra space after the ID -->

<xsl:choose>

<xsl:when test="@type='goal'">
  <td bgcolor="#bfbfbf">
  <font color="red">
  <xsl:value-of select="literal[1]"/>
  <xsl:for-each select="literal[position()>1]">
     |<xsl:value-of select="."/>
  </xsl:for-each>
  </font>
  </td>
</xsl:when>

<xsl:when test="@type='assumption'">
  <td bgcolor="#bfbfbf">
  <xsl:value-of select="literal[1]"/>
  <xsl:for-each select="literal[position()>1]">
     |<xsl:value-of select="."/>
  </xsl:for-each>
  </td>
</xsl:when>

<xsl:when test="@type='deny' or @type='clausify'">
  <td bgcolor="#eaeaea">
  <xsl:value-of select="literal[1]"/>
  <xsl:for-each select="literal[position()>1]">
     |<xsl:value-of select="."/>
  </xsl:for-each>
  </td>
</xsl:when>

<xsl:otherwise>
  <td>
  <xsl:value-of select="literal[1]"/>
  <xsl:for-each select="literal[position()>1]">
    <font color="red"> | </font> <xsl:value-of select="."/>
  </xsl:for-each>
  </td>
</xsl:otherwise>

</xsl:choose>

<td>
<font color="blue">
<xsl:for-each select="attribute">
  # <xsl:value-of select="."/>
</xsl:for-each>
</font>
</td>

<td>
<font color="green">
<xsl:apply-templates select="justification"/>
</font>
</td>

</tr>
</xsl:template>

<!-- ************************ justification template *********************  -->

<xsl:template match="justification">

<!-- <xsl:value-of select="@jstring"/> -->

[
<xsl:value-of select="j1/@rule"/>          <!-- output primary -->
<xsl:text> </xsl:text>                     <!-- to get some whitespace -->
<font color="red">
<xsl:value-of select="j1/@parents"/>       <!-- ok if empty -->
</font>

<xsl:for-each select="j2">                 <!-- output each secondary -->
  <xsl:text>, </xsl:text>
  <xsl:value-of select="@rule"/>
  <xsl:text> </xsl:text>                   <!-- to get some whitespace -->
  <font color="red">
  <xsl:value-of select="@parents"/>        <!-- ok if empty -->
  </font>
</xsl:for-each>
]

</xsl:template>

</xsl:stylesheet>