summaryrefslogtreecommitdiff
path: root/macros/generic/proofs/taylor/prooftree-doc.tex
blob: a4ed2959b4ee46f54eca981ada113f272948b0e3 (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
\documentstyle{article}
\input prooftree
\title{Build proof tree for Natural Deduction, Sequent Calculus, etc.}
\author{Paul Taylor\\
Department of Computing,\\
Imperial College,\\
London SW7 2BZ\\
+44 71 589 5111 {\em ext\/} 5057\\
{\tt<pt@doc.ic.ac.uk>}}
\def\X{x}
\let\imp\Rightarrow
\def\T{{\rm t\!t}}\def\F{{\rm f\!f}}
\def\P#1{p#1}%
\def\Q#1{q#1}%
\def\E#1#2{\exists#2.\X_{#2}={#1}}
\def\A#1#2{\exists#1.\left(\left(\E{#1}{#2}\right)\land\Q{#1}\right)}
\def\B#1#2{\forall#1.\left(\left(\E{#1}{#2}\right)\imp\P{#1}\right)}
\def\C#1#2{\exists#1.\P{#1}\land\left(\left(\left(\E{#1}{#2}\right)\land\Q{#1}\right)\right)}
\overfullrule0pt
\begin{document}
\maketitle
Using my Proof Tree macros, you can produce
{\small
$$\begin{prooftree}
\[ \[ [(\A y n)\land(\B w n)]_\alpha
      \andelim1
      \A y n
   \]
   \kern-26em
   \[ \[ \[ \[ \[ [(\A y n)\land(\B w n)]_\alpha
                  \andelim2 \shiftright60pt
                  \B w n
               \]
               \allelim
               (\E y n)\imp\P y
            \]
            \[
               [(\E y n)\land\Q y]_\beta
               \andelim1
               \E y n   
            \]
            \impelim \shiftright50pt
            \P y
         \]
         \kern-25pt
         [(\E y n)\land\Q y]_\beta
         \andintro
         \P y\land((\E y n)\land\Q y)
      \]
      \existsintro
      \C z n
   \]
   \existselim\beta
   \C z n
\]
\impintro\alpha
(\A yn)\land(\B w n)\imp(\C z n)
\end{prooftree}$$}
using the \TeX\ or \LaTeX\ code
\begin{verbatim}
\input prooftree
$$
\begin{prooftree}
\[ \[ [(\A y n)\land(\B w n)]_\alpha
      \andelim1
      \A y n
   \]
   \kern-26em
   \[ \[ \[ \[ \[ [(\A y n)\land(\B w n)]_\alpha
                  \andelim2 \shiftright60pt
                  \B w n
               \]
               \allelim
               (\E y n)\imp\P y
            \]
            \[
               [(\E y n)\land\Q y]_\beta
               \andelim1
               \E y n   
            \]
            \impelim \shiftright50pt
            \P y
         \]
         \kern-25pt
         [(\E y n)\land\Q y]_\beta
         \andintro
         \P y\land((\E y n)\land\Q y)
      \]
      \existsintro
      \C z n
   \]
   \existselim\beta
   \C z n
\]
\impintro\alpha
(\A yn)\land(\B w n)\imp(\C z n)
\end{prooftree}$$
\end{verbatim}



In fact the commands \verb/\allintro/, {\it etc.,} are not primitive;
the basic form is
\begin{verbatim}
\[
	A\quad
	B
\justifies
	A \land B
\thickness=0.08em
\shiftright 2em
\using
	{\land}{\cal I}
\]
\end{verbatim}
which gives
$$\begin{prooftree}
	A\quad
	B
\justifies
	A \land B
\thickness=0.08em
\shiftright 2em
\using
	{\land}{\cal I}
\end{prooftree}$$
The hypotheses may themselves be proof trees (enclosed in
\verb/\[/\ldots\verb/\]/)
and the purpose of the macros is to adjust
the length of the horizontal ``deduction'' line. When the hypotheses
are proof trees, suitable space is put between them, but of course
this must be supplied by hand for simple formulae. The \verb/\thickness/
and \verb/\shiftright/ commands are, of course, optional; they apply to
the horizontal line and to the positioning of the conclusion relative to
it. For a double line, use \verb/\Justifies/ instead of \verb/\justifies/.

Notice the overloading of the \verb/\[/\ldots\verb/\]/; the outermost proof
tree must be enclosed with \verb/\begin{prooftree}/ and \verb/\end{prooftree}/
or \verb/\prooftree/ and \verb/\endprooftree/.

To get a vertical string of dots instead of the proof rule, do
\begin{verbatim}
\[
	[A]
\using
	\pi
\proofdotseparation=1.2ex
\proofdotnumber=4
\leadsto
	B
\]
\end{verbatim}
to get
\prooftree
	[A]
\using
	\pi
\proofdotseparation=1.2ex
\proofdotnumber=4
\leadsto
	B
\endprooftree

All of of the keywords except \verb/\prooftree/ and \verb/\endprooftree/
are optional and may appear in any order. They may also be combined in
\verb/\newcommand/s, for example
\begin{verbatim}
\newcommand\Cut{\using\sf cut\thickness.08em\justifies}
\end{verbatim}
with the abbreviation
\begin{verbatim}
\[ A \vdash B \qquad
   B \vdash C
  \Cut
   A \vdash C
\]
\end{verbatim}

\verb/\thickness/ specifies the breadth of the rule in any units, although
font-relative units such as ex or em are preferable.
It may optionally be followed by =.
\verb/\proofrulebreadth=.08em/ or \verb/\setlength\proofrulebreadth{.08em}/
may also be used either in place of \verb/\thickness/ or globally; the
default is 0.04em. \verb/\proofdotseparation/ and \verb/\proofdotnumber/
control the size of the string of dots.

If proof trees and formulae are mixed, some explicit spacing is needed,
but don't put anything to the left of the left-most (or the right of
the right-most) hypothesis, or put it in braces, because this will cause
the indentation to be lost.

By default the conclusion is centered wrt the left-most and right-most
immediate hypotheses (not their proofs); \verb/\shiftright/ or
\verb/\shiftleft/ moves it relative to this position.
(Not sure about this specification or how
it should affect spreading of proof tree.)

\end{document}