summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/bussproofs/testbp2.tex
blob: 3dd30d98bd5f4afebda6be5ad92a9bfa8c788405 (plain)
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321



\documentclass[12pt]{article}
\usepackage{bussproofs}
\usepackage{amssymb}
\usepackage{latexsym}

% This is the "centered" symbol
\def\fCenter{{\mbox{\Large$\rightarrow$}}}

% Optional to turn on the short abbreviations
\EnableBpAbbreviations

% \alwaysRootAtTop  % makes proofs upside down
% \alwaysRootAtBottom % -- this is the default setting

\begin{document}
\thispagestyle{empty}

When the {\tt bussproofs.sty} code was first written, the
only documention for the {\tt bussproofs} style was in the
comments at the beginning of the style file {\tt bussproofs.sty}.
But recently (July 2004), Peter Smith has written an excellent
exposition of {\tt bussproofs.sty}, presently available
at
\begin{center}
\tt
http://www.phil.cam.ac.uk/teaching\_staff/Smith/LaTeX/nd.html
\end{center}

The present document is
a sample \LaTeX{} file that was created for testing
purposes while writing the {\tt bussproofs} code and you might
find that it useful as an example of how to
use special features of the style.

Author: Sam Buss \hspace*{1in} Email: {\tt sbuss@ucsd.edu}.
\vspace*{0.25in}

Here is some text.
\begin{center}
\Axiom$\Gamma^\prime\fCenter\Delta,A,A$
\LeftLabel{Weakening}\RightLabel{}
\UnaryInf$\lnot A,\Gamma^\prime \fCenter \Delta, A$
\LeftLabel{.}\RightLabel{\small $\lor$:right}
\UnaryInf$\lnot A,\lnot A,\Gamma^\prime \fCenter \Delta$
\LeftLabel{eigenvariable $x$}\RightLabel{$\forall$:right}
\UnaryInf$\Gamma \fCenter \Delta$
\DisplayProof
\end{center}
Here is more text.
\begin{prooftree}
\alwaysDashedLine
\alwaysDoubleLine
\Axiom$\Delta\fCenter\Pi$
\Axiom$\Gamma^\prime\fCenter\Delta,A$
\dottedLine
\singleLine
\UnaryInf$\lnot A,\Gamma^\prime \fCenter \Delta$
\UnaryInf$\lnot A,\lnot A,\Gamma^\prime \fCenter \Delta$
\singleLine
\UnaryInf$\Gamma \fCenter \Delta$
\BinaryInf$\Gamma,\Pi,A \fCenter \Delta, \Delta,B$
\Axiom$\fCenter\mbox{\rm Hi there}$
\singleLine
\BinaryInf$\Gamma\fCenter\Delta$
\end{prooftree}
\begin{center}
\alwaysDoubleLine
\AX$\Delta\fCenter\Pi$
\AX$\Gamma^\prime\fCenter\Delta,A$
\singleLine
\UI$\lnot A,\Gamma^\prime \fCenter \Delta$
\UI$\lnot A,\lnot A,\Gamma^\prime \fCenter \Delta$
\singleLine
\UI$\Gamma \fCenter \Delta$
\LL{.}\RightLabel{$\lor$:left}
\BI$\Gamma,\Pi,A \fCenter \Delta, \Delta,B$
\AXC{Hi there}
\singleLine
\BI$\Gamma\fCenter\Delta$
\DisplayProof
\end{center}
The above examples show `displayed' proofs.
On the other hand,
for putting proofs inline instead of displayed,
it is also permissable to put proofs into text rather than into
centered environments.  For example, one can write a proof right
here:
\centerAlignProof  %Which ever one of these is LAST sets the vertical alignment
\bottomAlignProof  %Try commenting out all but one of these three lines.
\normalAlignProof
\Axiom$\Gamma^\prime\fCenter\Delta,A$
\doubleLine
\UnaryInf$\lnot A,\Gamma^\prime \fCenter \Delta$
\UnaryInf$\lnot A,\lnot A,\Gamma^\prime \fCenter \Delta$
\doubleLine
\UnaryInf$\Gamma \fCenter \Delta$
\Axiom$\Delta\fCenter\Pi$
\kernHyps{-.5in}\insertBetweenHyps{\hskip-.25in}
\BinaryInf$\Gamma,\Pi,A \fCenter \Delta, \Delta,B$
\Axiom$\fCenter\mbox{\rm Hi there}$
\doubleLine
\BinaryInf$\Gamma\fCenter\Delta$
\DisplayProof{}         %% NOTE THE USE OF "{}"
although of course the proof is quite big compared to the text.
There is no reason you could not add \verb+\subscriptstyle+ or \verb+\small+
commands to the lines of the proofs to shrink things down.
The previous proof looks strange because it is illustrated the usage
of \verb+\kernHyps+ and \verb+\insertBetweenHyps+.  Finally
a 3-ary inference with a usage of \verb+\noLine+ is:
\begin{prooftree}
\AxiomC{$A\lor B$}
\AxiomC{$[A]$}
\noLine
\UnaryInfC{$C$}
\AxiomC{$[B]$}
\noLine
\UnaryInfC{$C$}
\TrinaryInfC{$C$}
\end{prooftree}


Two more examples:
\begin{center}
\AxiomC{A,B} \AxiomC{C} \BIC{A-B-C}
\AXC{good} \AXC{bad} \BIC{$\frac{good}{bad}$A}
\BIC{done}
\DP
\end{center}

\begin{center}
\Axiom$\fCenter A,B$ \Axiom$\fCenter C$ \BI$\fCenter A-B-C$
\AX$\fCenter good$ \AX$\fCenter bad$ \BI$\fCenter\frac{good}{bad}A$
\BI$\fCenter done$
\DP
\end{center}


Small labels can be created as in the third proof below:
\[
\AxiomC{A}
\RightLabel{1}
\UnaryInfC{$\bot$}
\DisplayProof
\quad
\AxiomC{A}
\RightLabel{(2)}
\UnaryInfC{$\bot$}
\DisplayProof
\quad
\AxiomC{A}
\RightLabel{\scriptsize(3)}
\UnaryInfC{$\bot$}
\DisplayProof
\quad
\AxiomC{A}
\LeftLabel{(4)}
\UnaryInfC{$\bot$}
\DisplayProof
\]
Arnold's example of inline proof: The figure
\AxiomC{$\dots\Gamma_\iota\dots(\iota\in I)$}
\RightLabel{$I$}
\UnaryInfC{$\Gamma$}
\DisplayProof{}
is called ...
%% NOTE THE USE OF "{}" after \DisplayProof to keep LaTeX from eating subsequent spaces!

\bigskip

\noindent{\bf Upside down proofs}
Proofs can be rendered upside down.  For instance the proof above with 
a 3-ary inference can be made upside down by giving the command
\verb+\rootAtTop+.   This is useful if you want your proof trees to have
their root at the top.

\alwaysRootAtTop    % Henceforth puts the root at the top

\begin{prooftree}
\AxiomC{$A\lor B$}
\AxiomC{$[A]$}
\noLine
\UnaryInfC{$C$}
\AxiomC{$[B]$}
\noLine
\UnaryInfC{$C$}
\TrinaryInfC{$C$}
\end{prooftree}

To make the change permanent for the rest of your document, use the
command  \verb+\alwaysRootAtTop+

\bigskip

\noindent
Another upside-down example, from Alex Hertel:
\bigskip

\hbox{\kern-2cm%
\tiny
\rootAtTop
\AxiomC{$= 1$}
\noLine
\UnaryInfC{$( ( (1 \wedge 1) \vee 0 ) \vee ( (0 \wedge 0) \vee 0 ) )$}
\AxiomC{$= 1$}
\noLine
\UnaryInfC{$( ( (1 \wedge 1) \vee 1 ) \vee ( (0 \wedge 0) \vee 1 ) )$}
\LeftLabel{$[0/z]$}
\RightLabel{$[1/z]$}
\BinaryInfC{$\forall z ( ( (1 \wedge 1) \vee z ) \vee ( (0 \wedge 0) \vee z ) )$}
\RightLabel{$[0/y]$}
\UnaryInfC{$\exists y \forall z ( ( (1 \wedge \neg y) \vee z ) \vee ( (0 \wedge y) \vee z ) )$}
\RightLabel{$[0/y]$}
\UnaryInfC{$\exists y \forall z ( ( (1 \wedge \neg y) \vee z ) \vee ( (0 \wedge y) \vee z ) )$}

\AxiomC{$= 1$}
\noLine
\UnaryInfC{$( ( (0 \wedge 0) \vee 0 ) \vee ( (1 \wedge 1) \vee 0 ) )$}
\AxiomC{$= 1$}
\noLine
\UnaryInfC{$( ( (0 \wedge 0) \vee 1 ) \vee ( (1 \wedge 1) \vee 1 ) )$}
\LeftLabel{$[0/z]$}
\RightLabel{$[1/z]$}
\BinaryInfC{$\forall z ( ( (0 \wedge 0) \vee z ) \vee ( (1 \wedge 1) \vee z ) )$}
\RightLabel{$[1/y]$}
\UnaryInfC{$\exists y \forall z ( ( (0 \wedge \neg y) \vee z ) \vee ( (1 \wedge y) \vee z ) )$}

\LeftLabel{$[0/x]$}
\RightLabel{$[1/x]$}
\BinaryInfC{$\forall x \exists y \forall z ( ( (\neg x \wedge \neg y) \vee z ) \vee ( (x \wedge y) \vee z ) )$}
\DisplayProof
}  % End of \hbox

\bigskip


\alwaysRootAtBottom
Testing of quaternary and quinary inferences (a bit scrunched due a use of
\verb+\insertBetweenHyps+):
\begin{prooftree}
\insertBetweenHyps{\hskip-1em}
\AxiomC{$A^B$}
\Axiom$A_B\fCenter A_{B_C}$
\Axiom$A^B\fCenter A^{B^C}$
\Axiom$A^{B^C}\fCenter A^{B^{C^D}}$
\Axiom$A^{B^{C^D}}\fCenter A^{B^{C^{D^E}}}A^{B^{C^{D^E}}}$
\QuinaryInf$X\fCenter XXXXX$
\UnaryInf$YYYY\fCenter Y$
\insertBetweenHyps{\hskip-1em}
\Axiom$A^B\fCenter A^{B^C}$
\Axiom$A^{B^C}\fCenter A^{B^{C^D}}$
\Axiom$A^{B^{C^D}}\fCenter A^{B^{C^{D^E}}}A^{B^{C^{D^E}}}$
\QuaternaryInf$X\fCenter XXXXX$
\UnaryInf$YYYY\fCenter Y$
\end{prooftree}

\alwaysRootAtTop
Testing of quaternary and quinary inferences (a bit scrunched due a use of
\verb+\insertBetweenHyps+):
\begin{prooftree}
\insertBetweenHyps{\hskip-1em}
\AxiomC{$A^B$}
\Axiom$A_B\fCenter A_{B_C}$
\Axiom$A^B\fCenter A^{B^C}$
\Axiom$A^{B^C}\fCenter A^{B^{C^D}}$
\Axiom$A^{B^{C^D}}\fCenter A^{B^{C^{D^E}}}A^{B^{C^{D^E}}}$
\QuinaryInf$X\fCenter XXXXX$
\UnaryInf$YYYY\fCenter Y$
\insertBetweenHyps{\hskip-1em}
\Axiom$A^B\fCenter A^{B^C}$
\Axiom$A^{B^C}\fCenter A^{B^{C^D}}$
\Axiom$A^{B^{C^D}}\fCenter A^{B^{C^{D^E}}}A^{B^{C^{D^E}}}$
\QuaternaryInf$X\fCenter XXXXX$
\UnaryInf$YYYY\fCenter Y$
\end{prooftree}

\begin{prooftree}
\insertBetweenHyps{\hskip-1em}
\Axiom$A^B\fCenter A^{B^C}$
\Axiom$A^{B^C}\fCenter A^{B^{C^D}}$
\Axiom$A^{B^{C^D}}\fCenter A^{B^{C^{D^E}}}A^{B^{C^{D^E}}}$
\TrinaryInf$X\fCenter XXXXX$
\end{prooftree}

\newenvironment{proof}{\begin{trivlist}\item[]{\bf Proof\ }}%
{\end{trivlist}}
\newenvironment{proofX}{\noindent{\bf Proof\ }}%
{}

\begin{proofX}
\begin{prooftree}
\Axiom$A^{B^C}\fCenter A^{B^{C^D}}$
\Axiom$A^{B^{C^D}}\fCenter A^{B^{C^{D^E}}}A^{B^{C^{D^E}}}$
\BinaryInf$X\fCenter XXXXX$
\end{prooftree}
\end{proofX}

\newbox\gnBoxA
\newdimen\gnCornerHgt
\setbox\gnBoxA=\hbox{$\ulcorner$}
\global\gnCornerHgt=\ht\gnBoxA
\newdimen\gnArgHgt

\def\Godelnum #1{%
    \setbox\gnBoxA=\hbox{$#1$}%
    \gnArgHgt=\ht\gnBoxA%
    \ifnum \gnArgHgt<\gnCornerHgt
        \gnArgHgt=0pt%
    \else
        \advance \gnArgHgt by -\gnCornerHgt%
    \fi
    \raise\gnArgHgt\hbox{$\ulcorner$} \box\gnBoxA %
        \raise\gnArgHgt\hbox{$\urcorner$}}

This last sentence has nothing to do with proof trees, but shows my
macros for G\"odel number delimeters:
$\Godelnum A, \Godelnum B$
$\Godelnum s$
\end{document}