Debian Codegraph @

texmf-dist/source/latex/prooftrees/prooftrees.dtx

raw
1 % \iffalse meta-comment
2 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 % prooftrees.dtx
4 % Additions and changes Copyright (C) 2016-2026 Clea F. Rees.
5 % Code from skeleton.dtx Copyright (C) 2015-2024 Scott Pakin (see below).
6 %
7 % This work may be distributed and/or modified under the
8 % conditions of the LaTeX Project Public License, either version 1.3c
9 % of this license or (at your option) any later version.
10 % The latest version of this license is in
11 % https://www.latex-project.org/lppl.txt
12 % and version 1.3c or later is part of all distributions of LaTeX
13 % version 2008-05-04 or later.
14 %
15 % This work has the LPPL maintenance status 'muaintained'.
16 %
17 % The Current Maintainer of this work is Clea F. Rees.
18 %
19 % This work consists of all files listed in manifest.txt.
20 %
21 % The file prooftrees.dtx is a derived work under the terms of the
22 % LPPL. It is based on version 2.4 of skeleton.dtx which is part of
23 % dtxtut by Scott Pakin. A copy of dtxtut, including the
24 % unmodified version of skeleton.dtx is available from
25 % https://www.ctan.org/pkg/dtxtut and released under the LPPL.
26 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
27 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
28 % arara: pdflatex: { synctex: true, shell: false }
29 % arara: biber
30 % arara: makeindex
31 % arara: pdflatex: { synctex: true, shell: false }
32 % arara: pdflatex: { synctex: true, shell: false }
33 % biber --output_format=bibtex --output_resolve prooftrees.bcf to generate .bib for upload
34 % sed -i '/1977/s/DATE/YEAR'
35 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
36 % \fi
37 %
38 % \iffalse
39 %<*driver>
40 \RequirePackage{svn-prov}
41 % ^^A ref. ateb Max Chernoff: https://tex.stackexchange.com/a/723294/
42 % ^^A \def\MakePrivateLetters{\makeatletter\ExplSyntaxOn\endlinechar13}
43 % ^^A \ExplSyntaxOff
44 \ProvidesFileSVN{$Id: prooftrees.dtx 11666 2026-02-21 01:53:54Z cfrees $}[v0.9.3 \revinfo][\filebase DTX: ]
45 \DefineFileInfoSVN[prooftreesdoc]
46 \GetFileInfoSVN*
47 \let\prooftreesdocversion\fileversion
48 \let\prooftreesdocrev\filerev
49 \let\prooftreesdocbase\filebase
50 \let\prooftreesdocinfo\fileinfo
51 \let\prooftreesdocdate\filedate
52 \let\prooftreesdocname\filename
53 %^^A BEGIN preamble <<<
54 \documentclass[10pt,british,a4paper,doc2]{ltxdoc}
55 % ltnews42 / ateb David Carlisle: https://tex.stackexchange.com/a/754799/ (sylwad Ulrike Fischer rhywle ond alla i ddim canfod o hyd iddo fe)
56 \partokencontext=0
57 \usepackage{memoize}
58 \mmzset{%
59 prefix={memos/},
60 include context in ccmemo,
61 auto=\cref{multiref},
62 auto=\Cref{multiref},
63 auto=\labelcref{multiref},
64 auto=\cpageref{multiref},
65 auto=\labelcpageref{multiref},
66 auto=\namecref{ref},
67 auto=\nameCref{ref},
68 auto=\namecrefs{ref},
69 auto=\nameCrefs{ref},
70 auto=\lcnamecrefs{ref},
71 auto=\lcnamecrefs{ref},
72 auto=\crefrange{refrange},
73 auto=\cpagerefrange{refrange},
74 auto=\Cpagerefrange{refrange},
75 mkdir,
76 }
77 \CodelineIndex
78 \RecordChanges
79 \EnableCrossrefs
80 \usepackage{babel,geometry,fancyhdr,enumitem}
81 \usepackage{csquotes}
82 \MakeAutoQuote{‘}{’}
83 \MakeAutoQuote*{“}{”}
84 \usepackage[rm={lining},sf={lining},tt={tabular,lining,monowidth}]{cfr-lm}
85 \usepackage{amssymb}
86 \usepackage{mathtools}
87 \usepackage{microtype}
88 \usepackage[section]{placeins}
89 \usepackage[citestyle=authoryear-comp,bibstyle=authoryear,mergedate=basic,isbn=false,url=true,sortcites=true,backend=biber,mincrossrefs=6]{biblatex}
90 \DeclareFieldFormat{eprint:ctan}{%
91 \mkbibacro{CTAN}\addcolon\space
92 \ifhyperref
93 {\href{https://www.ctan.org/pkg/#1}{\nolinkurl{#1}}}
94 {\nolinkurl{#1}}%
95 }
96 \DeclareFieldAlias{eprint:CTAN}{eprint:ctan}
97 % ^^A \bibliography{abbrv, authors, journals-series, pub, lleoedd, phil, ref}
98 \bibliography{prooftrees_biber.bib}% generate for upload (gweler uchod)
99 \usepackage{etoolbox,verbatim,parskip,changepage,titling,makeidx}
100 \usepackage[dvipsnames,svgnames,rgb,x11names]{xcolor}
101 \usepackage[tableaux]{prooftrees}
102 \GetFileInfoSVN{prooftrees}
103 \let\prooftreesversion\fileversion
104 \let\prooftreesrev\filerev
105 \let\prooftreesbase\filebase
106 \let\prooftreesinfo\fileinfo
107 \let\prooftreesdate\filedate
108 \let\prooftreesname\filename
109 \usepackage{mathtools,turnstile,pifont}
110 \newcommand*{\fycheck}{\text{\ding{52}}}
111 \newcommand*{\fycross}{\text{\ding{56}}}
112 \usetikzlibrary{decorations.pathreplacing,arrows.meta,positioning,calc,arrows.meta,fit,backgrounds,tikzmark}
113 \tikzset{%
114 nodiad/.style={text=#1, draw=#1, font=\footnotesize\scshape, align=left, shorten >=-1.5pt, shorten <=-1.5pt, {Circle[width=3pt, length=3pt, fill=#1]}-{Circle[width=3pt, length=3pt, fill=#1]}, fill=none},
115 grwp/.style={fill opacity=.25, fill=#1, rounded corners, draw=#1},
116 post grwp/.style={fill=white, postaction={fill opacity=.25, fill=#1}, draw=#1, rounded corners},
117 }
118 \forestset{%
119 nyth/.style n args=3{%
120 tikz+={%
121 \pgfmathsetmacro\lliw{#2*100/14}
122 \scoped[on background layer]\node [fit=(.west) (.east) (!F) (!L) (!1) (!11) (!l) (!ll) #1 (#3#2.center), inner xsep=28-2*#2 pt, inner ysep=0pt, draw=WildStrawberry!\lliw!blue, rounded corners] {};
123 },
124 },
125 }
126 \usepackage{tcolorbox}
127 \tcbuselibrary{listingsutf8}% ^^A if you use skins, you need to disable externalisation for boxes which use the relevant options - gweler nodiadau/tex/tex.se/tcolorbox-coursepacket-exp.tex
128 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
129 % ^^A Sašo Živanović: https://github.com/sasozivanovic/memoize/issues/31#issuecomment-2424700001
130 \csappto{tcb@shield@@externalize}{\ifdefined\memoizefalse\memoizefalse\fi}
131 \tcbset{shield externalize}
132 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
133 \let\docenvironment\environment
134 \let\enddocenvironment\endenvironment
135 \let\docmacrocode\macrocode
136 \let\enddocmacrocode\endmacrocode
137 \let\docmacro\macro
138 \let\enddocmacro\endmacro
139 \usepackage[%^^A
140 loadHyperref=true,
141 createIndexEntries=false,
142 ]{doctools}
143 \usepackage{hypdoc}%^^A ateb Ulrike Fischer: https://tex.stackexchange.com/a/695555/
144 \usepackage{bookmark}
145 \hypersetup{%^^A
146 colorlinks=true,
147 citecolor={moss},
148 extension=pdf,
149 linkcolor={strawberry},
150 linktocpage=true,
151 pdfcreator={TeX},
152 pdfproducer={pdfeTeX},
153 urlcolor={blueberry},
154 }
155 \usepackage{cleveref}
156 \makeatletter
157 % ^^A Joseph Wright: from \file{siunitx.sty} ; \url{https://chat.stackexchange.com/transcript/message/64327823#64327823}
158 \providecommand\IfFormatAtLeastTF{\@ifl@t@r\fmtversion}
159 % ^^A \IfFormatAtLeastTF {2024-11-01}
160 % ^^A {% ^^A ateb sgwrsio Ulrike Fischer: https://chat.stackexchange.com/transcript/message/66562343#66562343
161 % ^^A \NewSocketPlug{refstepcounter}{cleveref}{%
162 % ^^A \ifHy@pdfstring\else#1
163 % ^^A {%
164 % ^^A \firstaid@cref@updatelabeldata{\@currentcounter}%
165 % ^^A }%
166 % ^^A \fi
167 % ^^A }%
168 % ^^A \AssignSocketPlug{refstepcounter}{cleveref}%
169 % ^^A }{}
170 \renewcommand*\Describe@Macro[1]{\endgroup
171 \marginpar{%^^A
172 \raggedleft\PrintDescribeMacro{#1}\par
173 \PrintLabelName[\macrolabelfont]{\macrolabelname}%^^A
174 }%^^A
175 \expandafter\prooftrees@index{\macrolabelname}{\protect\ttfamily\protect\string\protect#1}\@esphack\ignorespaces}
176 \renewcommand*\Describe@Env[1]{\endgroup
177 \marginpar{%^^A
178 \raggedleft\PrintDescribeMacro{#1}\par
179 \PrintLabelName[\macrolabelfont]{\envlabelname}%^^A
180 }%^^A
181 \expandafter\prooftrees@index{\envlabelname}{#1}\@esphack\ignorespaces}
182 \newcommand*\DescribeKey{\leavevmode\@bsphack
183 \begingroup\MakePrivateLetters\Describe@Key}
184 \newcommand*\Describe@Key[2][key]{\endgroup
185 \marginpar{%^^A
186 \raggedleft\PrintDescribeMacro{#2}\par
187 \PrintLabelName[\macrolabelfont]{\csname #1labelname\endcsname}%^^A
188 }%^^A
189 \edef\tempa{\csname #1labelname\endcsname}%^^A
190 \expandafter\prooftrees@index{\tempa}{#2}\@esphack\ignorespaces}
191 \newcommand*\DescribeKeys{\leavevmode\@bsphack
192 \begingroup\MakePrivateLetters\Describe@Keys}
193 \expandafter\newif\csname ifcyntafun\endcsname
194 \newcommand*\Describe@Keys[2][key]{\endgroup
195 \renewcommand*\do[1]{\ifcyntafun ##1\else\\##1\fi\cyntafunfalse}%^^A
196 \cyntafuntrue
197 \marginpar{%^^A
198 \raggedleft\PrintDescribeMacro{ %^^A paid â dileu'r gwagle hwn!!
199 \expandafter\docsvlist{#2}%^^A
200 }\par
201 \PrintLabelName[\macrolabelfont]{\csname #1labelname\endcsname}%^^A
202 }%^^A
203 \edef\tempa{\csname #1labelname\endcsname}%^^A
204 \renewcommand*\do[1]{\expandafter\prooftrees@index{\tempa}{##1}}%^^A
205 \expandafter\docsvlist{#2}\@esphack\ignorespaces}
206 \def\get@first#1,#2\@null{#1}
207 \def\get@rest#1,#2\@null{#2}
208 \newcommand*\vals[1]{%^^A
209 \edef\tempa{\expandafter\get@first #1\@null}%^^A
210 \edef\tempb{\expandafter\get@rest #1\@null}%^^A
211 \renewcommand*\do[1]{\textbar ##1}%^^A
212 {\ttfamily = \tempa
213 \expandafter\docsvlist{\tempb}%^^A
214 }%^^A
215 }
216 \newcommand*\val[1]{{\ttfamily = \meta{#1}}}
217 \newcommand*\valmarg[1]{{\ttfamily = \marg{#1}}}
218 \newcommand*\pkg[1]{\textsf{#1}}
219 \DeclareRobustCommand\macrolabelfont{\normalfont\footnotesize\em\normalcolor}
220 \ExplSyntaxOn
221 \cs_new_nopar:Npn \prooftreesdoc_new_label:nnn #1#2#3
222 {
223 \cs_new_nopar:cpn {#1labelname} {#2}
224 \cs_new_nopar:cpn {#1shortname} {#3}
225 }
226 \cs_new_nopar:Npn \__prooftreesdoc_new_forest_label:nn #1#2
227 {
228 \prooftreesdoc_new_label:nnn {#1}{Forest~#2}{#2}
229 }
230 \seq_set_split:Nnn \l_tmpa_seq {,}
231 {
232 fkeylist,
233 fregkeylist,
234 foptkeylist,
235 freg,
236 fopt,
237 fregdim,
238 fregcount,
239 fregtoks,
240 fopttoks,
241 fregbool,
242 foptbool,
243 fregautotoks,
244 foptautotoks,
245 fstyle,
246 fstylewrap,
247 fbracketkey,
248 flstep,
249 fsstep,
250 fstep,
251 fchoice,
252 fcodekey,
253 ftagkeylist,
254 flib,
255 }
256 \seq_set_split:Nnn \l_tmpb_seq {,}
257 {
258 keylist,
259 keylist~register,
260 keylist~option,
261 register,
262 option,
263 dimension~register,
264 count~register,
265 toks~register,
266 toks~option,
267 boolean~register,
268 boolean~option,
269 autowrapped~toks~register,
270 autowrapped~toks~option,
271 style,
272 wrapped~style,
273 bracket~key,
274 long~step,
275 short~step,
276 step,
277 choice~key,
278 code~key,
279 tagging~keylist,
280 library,
281 }
282 \seq_map_pairwise_function:NNN \l_tmpa_seq \l_tmpb_seq \__prooftreesdoc_new_forest_label:nn
283 \ExplSyntaxOff
284 \newcommand*\macrolabelname{macro}
285 \newcommand*\PrintLabelName[2][\normalfont\normalsize\normalcolor]{#1#2}
286 \newcommand*\envlabelname{environment}
287 \newcommand*\keylabelname{key}
288 \newcommand*\pkgoptlabelname{package option}
289 \newcommand*\pkglabelname{package}
290 \let\PrintDescribeKey\PrintDescribeMacro
291 \newcommand*\keyval[1]{\texttt{#1}}
292 \NewDocumentCommand\keyname { s O {key} m }{%^^A
293 \texttt{#3}%^^A
294 \IfBooleanTF {#1}{}{%^^A
295 \edef\tempa{\csname #2labelname\endcsname}%^^A
296 \expandafter\prooftrees@index{\tempa}{#3}%^^A
297 }%^^A
298 }
299 \def\prooftrees@index#1#2{%^^A
300 \index{#1s\actualchar\doctools@indexHeadFont{#1s}\levelchar #2}%^^A
301 }
302 \renewenvironment{theindex}
303 {%^^A
304 \twocolumn[\section*{\indexname}
305 \emph{%^^A
306 Features are sorted by kind.
307 Page references are given for both definitions and comments on use.
308 Underlined numbers refer to code line numbers; the remainder to pages.%
309 }\bigskip
310 ]%^^A
311 \markboth{\indexname}%^^A
312 {\indexname}%^^A
313 \pagestyle{fancyplain}%^^A
314 \thispagestyle{plain}%^^A
315 \parindent\z@
316 \parskip\z@ \@plus .3\p@\relax
317 \let\item\@idxitem}
318 {}
319 \makeatother
320 \lstdefinestyle{lstcoeden}{%^^A modified from style used by doctools.sty for the latexcode environment
321 style=lstDocStyleBase,
322 numbers=none,
323 stringstyle=\color{doc@stringcolor},
324 keywordstyle=\color{doc@keywordcolor},
325 commentstyle=\color{doc@commentcolor},
326 frame=none,
327 }
328 \lstdefinestyle{lstsrc}{%^^A
329 style=lstDemoStyleLaTeXCode,
330 stringstyle=\color{doc@stringcolor},
331 keywordstyle=\color{doc@keywordcolor},
332 commentstyle=\color{doc@commentcolor},
333 texcsstyle=\color{doc@keywordcolor},
334 frame=none,
335 numbers=left,
336 moretexcs={forestset,linenumberstyle,ifcsname,ProcessOptions,DeclareOption,ProvidesPackageSVN,bracketset,NewDocumentEnvironment,ExplSyntaxOn,mmzset,ExplSyntaxOff,forest,prooftrees@enw,foresteregister,foresteoption,forestregister,forestoption,PackageError,PackageWarning,PassOptionsToPackage,CurrentOption,@ifpackageloaded,endforest,draw},
337 }
338 \geometry{headheight=12pt,marginparwidth=45mm,hmarginratio=4:1,vscale=.8,hscale=.7,verbose}
339 \newlength\tewadjust
340 \setlength\tewadjust{\marginparwidth+\marginparsep-\paperwidth+\textwidth+\oddsidemargin+1in}
341 \tcbset{%^^A
342 coeden/.style={
343 colback=doc@demo@backcolor,
344 colframe=doc@rulecolor,
345 halign=center,
346 fonttitle=\sffamily\plstyle\bfseries,
347 sharpish corners,
348 list entry={\protect\numberline{\thetcbcounter\textbar}#1},
349 title={\fbox{\plstyle\thetcbcounter}\hskip 1.5em #1},
350 float,
351 floatplacement={!tbp},
352 },
353 coeden dew/.style={
354 coeden=#1,
355 grow to left by=\tewadjust,
356 },
357 cod coeden/.style={
358 coeden=#1,
359 listing style=lstcoeden,
360 },
361 cod coeden dew/.style={
362 cod coeden=#1,
363 grow to left by=\tewadjust,
364 },
365 every float=\centering,
366 }
367 \NewTColorBox[auto counter, crefname={box}{boxes}, Crefname={Box}{Boxes},]{coeden}{s O {} m }
368 {%^^A
369 IfBooleanTF={#1}{coeden dew=#3}{coeden=#3},
370 #2,
371 }
372 \NewTCBListing[use counter from=coeden, crefname={box}{boxes}, Crefname={Box}{Boxes}]{codcoeden}{ s O {} m }
373 {%^^A
374 IfBooleanTF={#1}{cod coeden dew=#3}{cod coeden=#3},
375 listing side text,
376 halign lower=center,
377 #2,
378 }
379 \NewTCBListing[use counter from=coeden, crefname={box}{boxes}, Crefname={Box}{Boxes}]{codcoedenhir}{ s O {} m }
380 {%^^A
381 IfBooleanTF={#1}{cod coeden dew=#3}{cod coeden=#3},
382 listing above text,
383 halign lower=center,
384 #2,
385 }
386 \newcommand*{\tnot}{\ensuremath{\mathord{\sim}}}
387 \newcommand*{\lif}{\ensuremath{\mathbin{\rightarrow}}}
388 \newcommand*{\liff}{\ensuremath{\mathbin{\leftrightarrow}}}
389 \DeclareMathSymbol{\aand}{\mathbin}{operators}{38}
390 \newcommand*\TikZ{Ti\emph{k}Z}
391 \newcommand*{\elim}{\,\text{E}}
392 \newcommand*\wff{\emph{wff}}
393 \newcommand*\wffs{\emph{wffs}}
394 \newcounter{lliw}
395 \setcounter{lliw}{0}
396 \newcounter{rhiflliwnyth}
397 \setcounter{rhiflliwnyth}{0}
398 \def\rhiflliw{14}
399 \colorlet{fylliw}{WildStrawberry!\rhiflliw!blue}
400 \NewDocumentCommand\nyth { s o }{%^^A
401 \IfBooleanTF {#1}{%^^A
402 \stepcounter{lliw}%^^A
403 }{}%^^A
404 \IfValueTF {#2}{%^^A
405 \setcounter{rhiflliwnyth}{#2}%^^A
406 }{%^^A
407 \setcounter{rhiflliwnyth}{\value{lliw}}%^^A
408 }%^^A
409 \pgfmathsetmacro\rhiflliw{int(\value{rhiflliwnyth}*100/14)}%^^A
410 \colorlet{fylliw}{WildStrawberry!\rhiflliw!blue}%^^A
411 \tikz[baseline=(a.base),/mmz/csname meaning to context={c@rhiflliwnyth},/mmz/meaning to context=\rhiflliw]{%^^A
412 \node (a) [circle, fill=fylliw, inner sep=0pt, font=\sffamily, text width=12pt, text depth=0pt, text centered, text=white] {\arabic{rhiflliwnyth}};
413 }%^^A
414 }
415 \NewDocumentCommand\bocsnyth { O {} }{%^^A
416 \tikz[baseline=(a.base)]{\node (a) [rounded corners, draw=fylliw, text width=15pt, text height=10pt, inner sep=0pt] {#1};
417 }%^^A
418 }
419 \renewcommand\maketitlehookb{%^^A
420 \begin{center}
421 Version \prooftreesdocversion{}
422 \end{center}%^^A
423 }
424 \appto\mmzAtEndMemoization{%^^A
425 \xtoksapp\mmzCMemo{\string^\string^A}%^^A
426 }
427 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
428 \ExplSyntaxOn
429 \keys_define:nn { prooftrees / doc }
430 {
431 unknown .code:n = {
432 \cs_if_free:cT { \l_keys_key_str }
433 {
434 \tl_gset:cn { \l_keys_key_str } { #1 }
435 }
436 },
437 }
438 \NewDocumentCommand \prooftreesdocset { +m }
439 {
440 \keys_set:nn { prooftrees / doc } { #1 }
441 }
442 \ExplSyntaxOff
443 \prooftreesdocset{%^^A
444 bug={\href{https://codeberg.org/cfr/prooftrees/issues}{\textsc{bugtracker}}},
445 codeberg={\href{https://codeberg.org/cfr/prooftrees}{\textsc{codeberg}}},
446 github={\href{https://github.com/cfr42/prooftrees}{\textsc{github}}},
447 ctan={\href{https://ctan.org/}{\textsc{ctan}}},
448 }
449 \title{\pkg{\filebase}: Typesetting Logical Tableaux}
450 \author{Clea F. Rees\thanks{%^^A
451 Bug tracker:
452 \href{https://codeberg.org/cfr/prooftrees/issues}{\url{codeberg.org/cfr/prooftrees/issues}}
453 \textbar{} Code:
454 \href{https://codeberg.org/cfr/prooftrees}{\url{codeberg.org/cfr/prooftrees}}
455 \textbar{} Mirror:
456 \href{https://github.com/cfr42/prooftrees}{\url{github.com/cfr42/prooftrees}}%^^A
457 }}
458 \date{\prooftreesdocdate}
459 \title{\prooftreesdocbase}
460 \ExplSyntaxOn
461 \hook_gput_code:nnn {shipout/lastpage} {.}
462 {
463 \property_record:nn {t:lastpage}{abspage,page,pagenum}
464 }
465 \cs_new_protected_nopar:Npn \lastpage
466 {
467 \property_ref:nn {t:lastpage}{page}
468 }
469 \cs_new:Npn \__prooftreesdoc_mpl: {
470 \char_set_catcode_letter:N \@\char_set_catcode_letter:N \_\char_set_catcode_letter:N \:
471 }
472 \cs_set_eq:NN \MakePrivateLetters \__prooftreesdoc_mpl:
473 \cs_new_eq:NN \__prooftreesdoc_cs_orig:n \cs
474 \cs_new_protected:Npn \__prooftreesdoc_cs_expl:n #1
475 {
476 \exp_args:Ne \__prooftreesdoc_cs_orig:n {\tl_to_str:n {#1}}
477 }
478 \cs_new_eq:NN \ecs \__prooftreesdoc_cs_expl:n
479 \ExplSyntaxOff
480 % ^^A % ^^A if these are commented where the f*** are they defined?
481 % ^^A % ^^A \definecolor{strawberry}{rgb}{1.000,0.000,0.502}
482 % ^^A % ^^A \definecolor{blueberry}{rgb}{0.000,0.000,1.000}
483 % ^^A % ^^A \definecolor{moss}{rgb}{0.000,0.502,0.251}
484 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
485 \pagestyle{fancy}
486 \fancyhf{}
487 \fancyhf[lh]{\textit{\leftmark}}
488 \fancyhf[rh]{\textit{\rightmark}}
489 \fancyhf[cf]{\textit{--- \thepage{} of \lastpage{} ---}}
490 \fancypagestyle{fancyplain}{%^^A
491 \fancyhf{}%^^A
492 \fancyhf[lh]{\textit{\leftmark}}%^^A
493 \renewcommand*\headrulewidth{0pt}%^^A
494 \fancyhf[cf]{\textit{--- \thepage{} of \lastpage{} ---}}}
495 \fancypagestyle{plain}{%^^A
496 \fancyhf{}%^^A
497 \renewcommand*\headrulewidth{0pt}%^^A
498 \fancyhf[cf]{\textit{--- \thepage{} of \lastpage{} ---}}}
499 \patchcmd{\sectionmark}{\MakeUppercase}{}{\typeout{sectionmark patched OK!}}{\typeout{sectionmark patch failed!}}
500 \patchcmd{\tableofcontents}{\MakeUppercase}{}{\typeout{sectionmark patched OK!}}{\typeout{tableofcontents patch failed!}}
501 \patchcmd{\tableofcontents}{\MakeUppercase\contentsname}{}{\typeout{sectionmark patched OK!}}{\typeout{tableofcontents patch failed!}}
502 % ^^A Really, why on Earth does Biblatex do something this obnoxious?
503 % ^^A It is all for unilaterally declaring standard LaTeX macros 'deprecated' and trying to replace them with its own less convenient versions.
504 % ^^A It could at least do us the favour of holding some of its much less defensible and much more inconvenient design decisions in equal contempt!!
505 \defbibheading{bibliography}[\refname]{%^^A
506 \section*{#1}%^^A
507 \markboth{#1}{}}
508 \errorcontextlines=10
509 % ^^A break long code lines unsuccessfully
510 \makeatletter
511 \def\@xobeysp{\leavevmode\penalty100\ }
512 \makeatother
513 %^^A END preamble >>>
514 \begin{document}
515 %^^A \let\MakePrivateLetters\MyMakePrivateLetters
516 \DocInput{\prooftreesdocname}
517 \end{document}
518 %</driver>
519 % \fi
520 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
521 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
522 % \newgeometry{headheight=12pt,scale=.8,marginparwidth=0pt,marginparsep=0pt}%
523 % \savegeometry{safonol}%
524 % \setlength\tewadjust{\marginparwidth+\marginparsep}%
525 % \fancyheadoffset[lh]{0pt}% ^^A REQUIRED - do NOT remove this line!!
526 % \pagenumbering{arabic}%
527 % \maketitle
528 % \bigskip
529 %
530 % \begin{abstract}
531 % \noindent \keyname[pkg]{\pkg{prooftrees}} is a \LaTeXe{} package, based on \keyname[pkg]{\pkg{forest}}, designed to support the typesetting of logical tableaux --- ‘proof trees’ or ‘truth trees’ --- in styles sometimes used in teaching introductory logic courses, especially those aimed at students without a strong background in mathematics.
532 % One textbook which uses proofs of this kind is \textcite{hodges-logic}.
533 % Like \pkg{forest}, \pkg{prooftrees} supports \keyname[pkg]{\pkg{memoize}} out-of-the-box.
534 % \pkg{prooftrees} uses \pkg{forest-ext} to support tagged \textsc{pdf}s out-of-the-box.
535 % \end{abstract}
536 % \bigskip
537 %
538 % ^^A <<<
539 % \begin{figure}[!b]
540 % \begin{adjustwidth}{-3em}{-5em}
541 % \centering
542 % \begin{minipage}[t]{.475\linewidth}
543 % \begin{tableau}
544 % {
545 % to prove={S \liff \lnot T, T \liff \lnot R \sststile{\mathcal{L}}{} S \liff R},
546 % highlight format={text=WildStrawberry},
547 % line no sep=.35em,
548 % just sep=.35em,
549 % wff format={Purple4},
550 % line no format={Purple4},
551 % just format={Purple4},
552 % close format={Purple4},
553 % for tree={edge=Purple4},
554 % close with format={Purple4},
555 % where level=0{%
556 % tikz+={%
557 % \draw [Purple4, thick] (current bounding box.north west) rectangle (current bounding box.south east);
558 % \draw [Purple4, semithick] (.south -| current bounding box.west) -- (.south -| current bounding box.east);
559 % },
560 % }{},
561 % }
562 % [{S \liff \lnot T}, checked, just=pr.
563 % [T \liff \lnot R, checked, just=pr.
564 % [\lnot(S \liff R), checked, just=$\lnot$ conc.
565 % [S, just={$\liff$\elim:!uuu}
566 % [\lnot T , just={$\liff$\elim:!uuuu}
567 % [T, just={$\liff$\elim:!uuuu}
568 % [\lnot R, close={:!uu,!u} , just={$\liff$\elim:!uuuuu}
569 % ]
570 % ]
571 % [\lnot T
572 % [\lnot \lnot R, checked
573 % [\lnot S, just={$\lnot\liff$\elim:!r111}, highlight line
574 % [R, just={$\lnot\liff$\elim:!r111}, close={:!uuuuu,!u}, highlight line
575 % ]
576 % ]
577 % [S
578 % [\lnot R
579 % [R, just={$\lnot\lnot$\elim:!uuu}, close={:!u,!c}
580 % ]
581 % ]
582 % ]
583 % ]
584 % ]
585 % ]
586 % ]
587 % [\lnot S, just={$\liff$\elim:!uuu}
588 % [\lnot \lnot T, just={$\liff$\elim:!uuuu}, checked
589 % [T, just={$\liff$\elim:!uuuu}
590 % [\lnot R, just={$\liff$\elim:!uuuuu}
591 % [\lnot S, just={$\lnot\liff$\elim:!r111}
592 % [R, just={$\lnot\liff$\elim:!r111}, close={:!uu,!c}
593 % ]
594 % ]
595 % [S
596 % [\lnot R, close={:!r1111,!u}
597 % ]
598 % ]
599 % ]
600 % ]
601 % [\lnot T
602 % [\lnot \lnot R, checked
603 % [T, close={:!uu,!c}, just={$\lnot\lnot$\elim:!uuu}
604 % ]
605 % ]
606 % ]
607 % ]
608 % ]
609 % ]
610 % ]
611 % ]
612 % \end{tableau}%
613 % \end{minipage}\hfill
614 % \begin{minipage}[t]{.525\linewidth}
615 % \begin{tableau}
616 % {
617 % to prove={(\exists x)((\forall y)(Py \Rightarrow (x = y)) \cdot Px) \sststile{\mathcal{L}_1}{} (\exists x)(\forall y)(Py \Leftrightarrow (x = y))},
618 % line no sep=.35em,
619 % just sep=.35em,
620 % wff format={RoyalBlue4},
621 % line no format={RoyalBlue4},
622 % just format={RoyalBlue4},
623 % close format={RoyalBlue4},
624 % for tree={edge=RoyalBlue4},
625 % close with format={RoyalBlue4},
626 % where level=0{%
627 % tikz+={%
628 % \draw [RoyalBlue4, thick] (current bounding box.north west) rectangle (current bounding box.south east);
629 % \draw [RoyalBlue4, semithick] (.south -| current bounding box.west) -- (.south -| current bounding box.east);
630 % },
631 % }{},
632 % }
633 % [{(\exists x)((\forall y)(Py \Rightarrow (x = y)) \cdot Px)}, checked=d, just=pr.
634 % [{\tnot (\exists x)(\forall y)(Py \Leftrightarrow (x = y))}, subs=d, just=$\lnot$ conc.
635 % [{(\forall y)(Py \Rightarrow (d = y)) \cdot Pd}, checked, just={$\exists$\elim:!uu}
636 % [{(\forall y)(Py \Rightarrow (d = y))}, subs=c, just={$\cdot$\elim:!u}
637 % [Pd, just=$\cdot$\elim:!uu
638 % [{\tnot (\forall y)(Py \Leftrightarrow (d = y))}, checked=c, just={$\tnot\exists$\elim:!r11}
639 % [{\tnot (Pc \Leftrightarrow (d = c))}, checked, just={$\tnot\forall$\elim:!u}
640 % [Pc, just={$\tnot\Leftrightarrow$\elim:!u}
641 % [d \neq c, just={$\tnot\Leftrightarrow$\elim:!uu}, name=fred
642 % [{Pc \Rightarrow (d = c)}, checked, just=$\forall$\elim:!r1111, move by=1
643 % [\tnot Pc, close={:!uuu,!c} , just=$\Rightarrow$\elim:!u, wff options=WildStrawberry, !uuu.wff options=WildStrawberry
644 % ]
645 % [{d = c}
646 % [d \neq d, close={:!c} , just={$=$:fred,!u}, wff options=red
647 % ]
648 % ]
649 % ]
650 % ]
651 % ]
652 % [\tnot Pc
653 % [{d = c}
654 % [Pc, just={$=$:!r11111,!u}, close={:!uu,!c}, wff options=blue!50!cyan, !uu.wff options=blue!50!cyan
655 % ]
656 % ]
657 % ]
658 % ]
659 % ]
660 % ]
661 % ]
662 % ]
663 % ]
664 % ]
665 % \end{tableau}%
666 % \end{minipage}%
667 % \end{adjustwidth}
668 % \end{figure}
669 % ^^A >>>
670 %
671 % \emph{\bfseries Note that this package requires version 2.1 (2016/12/04) of \keyname[pkg]{\pkg{forest}} \autocite{saso-forest-manual}.
672 % It will not work with versions prior to 2.1.}
673 %
674 % \emph{\bfseries Versions 0.9.2 and later require \keyname[pkg]{\pkg{forest-ext}} \autocite{cfr-forest-ext}.}
675 %
676 % \bigskip
677 %
678 % \emph{I would like to thank \citeauthor{saso-forest-manual} both for developing \pkg{forest} and for considerable patience in answering my questions, addressing my confusions and correcting my mistakes.
679 % The many remaining errors are, of course, entirely my own.
680 % This package's deficiencies would be considerably greater and more numerous were it not for his assistance.}
681 %
682 %
683 % \clearpage
684 %
685 % \tableofcontents
686 %
687 % \section{Raison d'être}\label{sec:raisondetre}
688 %^^A BEGIN raisondetre <<<
689 %
690 % Suppose that we wish to typeset a typical tableau demonstrating the following entailment
691 % \[
692 % \{P \vee (Q \vee \lnot R), P \lif \lnot R, Q \lif \lnot R\} \sststile{}{} \lnot R
693 % \]
694 %
695 % We start by typesetting the tree using \pkg{forest}'s default settings (\cref{fordefaults}) and find our solution has several advantages: the proof is specified concisely and the code reflects the structure of the tree.
696 % \iffalse
697 %<*verb>
698 % \fi
699 \begin{codcoeden}[label=fordefaults,floatplacement=bp!]{\pkg{forest}: default settings}
700 \begin{forest}
701 [$P \vee (Q \vee \lnot R)$
702 [$P \lif \lnot R$
703 [$Q \lif \lnot R$
704 [$\lnot\lnot R$
705 [$P$
706 [$\lnot P$]
707 [$\lnot R$]
708 ]
709 [$Q \vee \lnot R$
710 [$Q$
711 [$\lnot Q$]
712 [$\lnot R$]
713 ]
714 [$\lnot R$]
715 ]
716 ]
717 ]
718 ]
719 ]
720 \end{forest}
721 \end{codcoeden}
722 % \iffalse
723 %</verb>
724 % \fi
725 % It is relatively straightforward to specify a proof using \pkg{forest}'s bracket notation, and the spacing of nodes and branches is automatically calculated.
726 %
727 % Despite this, the results are not quite what we might have hoped for in a tableau.
728 % The assumptions should certainly be grouped more closely together and no edges (lines) should be drawn between them because these are not steps in the proof --- they do not represent inferences.
729 % Preferably, edges should start from a common point in the case of branching inferences, rather than there being a gap.
730 %
731 % Moreover, tableaux are often compacted so that \emph{non-branching} inferences are grouped together, like assumptions, without explicitly drawn edges.
732 % Although explicit edges to represent non-branching inferences are useful when introducing students to tableaux, more complex proofs grow unwieldy and the more compact presentation becomes essential.
733 %
734 % Furthermore, it is useful to have the option of \emph{annotating} tableaux by numbering the lines of the proof on the left and entering the justification for each line on the right.
735 %
736 % \pkg{forest} is a powerful and flexible package capable of all this and, indeed, a good deal more.
737 % It is not enormously difficult to customise particular trees to meet most of our desiderata.
738 % However, it is difficult to get things perfectly aligned even in simple cases, requires the insertion of ‘phantom’ nodes and management of several sub-trees in parallel (one for line numbers, one for the proof and one for the justifications).
739 % The process requires a good deal of manual intervention, trial-and-error and hard-coding of things it would be better to have \LaTeXe{} manage for us, such as keeping count of lines and line references.
740 %
741 % \pkg{prooftrees} aims to make it as easy to specify tableaux as it was to specify our initial tree using \pkg{forest}'s default settings.
742 % The package supports a small number of options which can be configured to customise the output.
743 % The code for a \pkg{prooftrees} tableau is shown in \cref{ptdefaults}, together with the output obtained using the default settings.
744 %
745 % \iffalse
746 %<*verb>
747 % \fi
748 \begin{codcoeden}*[label=ptdefaults]{\pkg{prooftrees}: default settings}
749 \begin{tableau}
750 {
751 to prove={\{P \vee (Q \vee \lnot R), P \lif \lnot R, Q \lif \lnot R\} \sststile{}{} \lnot R}
752 }
753 [P \vee (Q \vee \lnot R), just=Ass, checked
754 [P \lif \lnot R, just=Ass, checked
755 [Q \lif \lnot R, just=Ass, checked, name=last premise
756 [\lnot\lnot R, just={$\lnot$ Conc}, name=not conc
757 [P, just={$\vee$ Elim:!uuuu}
758 [\lnot P, close={:!u,!c}]
759 [\lnot R, close={:not conc,!c}, just={$\lif$ Elim:!uuuu}]]
760 [Q \vee \lnot R
761 [Q, move by=1
762 [\lnot Q, close={:!u,!c}]
763 [\lnot R, close={:not conc,!c}, just={$\lif$ Elim:last premise}]]
764 [\lnot R, close={:not conc,!c}, move by=1, just={$\vee$ Elim:!u}]]]]]]
765 \end{tableau}
766 \end{codcoeden}
767 % \iffalse
768 %</verb>
769 % \fi
770 % More extensive configuration can be achieved by utilising \pkg{forest} \autocite{saso-forest-manual} and/or \TikZ{} \autocite{tantau-tikz-pgf-manual} directly.
771 % A sample of supported tableau styles are shown in \cref{sample}.
772 % The package is \emph{\bfseries not} intended for the typesetting of tableaux which differ significantly in structure.
773 % \clearpage
774 % \thispagestyle{plain}%
775 % \begin{coeden}[label=sample, floatplacement={!bp}, grow to left by=3em, grow to right by=3em]{\pkg{prooftrees}: sample output}
776 % \centering
777 % \mbox{%^^A required by docstrip + memoize (but only for both)
778 % \begin{tableau}
779 % {
780 % to prove={\{ P \lor (Q \lor \lnot R), P \lif \lnot R, Q \lif \lnot R \} \sststile{}{} \lnot R},
781 % line no sep=.35em,
782 % just sep=.35em,
783 % }
784 % [P \lor (Q \lor \lnot R), just=Ass, checked
785 % [P \lif \lnot R, just=Ass, checked
786 % [Q \lif \lnot R, just=Ass, checked
787 % [\lnot\lnot R, just={Neg conc}
788 % [P, just={$\lor$ Elim:!r1}
789 % [\lnot P, close={:!u,!c}]
790 % [\lnot R, close={:!uu,!c}, just={$\lif$ Elim:!r11}
791 % ]
792 % ]
793 % [Q \lor \lnot R, checked
794 % [Q, move by=1
795 % [\lnot Q, close={:!u,!c}
796 % ]
797 % [\lnot R, close={:!r1111,!c}, just={$\lif$ Elim:!r111}
798 % ]
799 % ]
800 % [\lnot R, close={:!r1111,!c}, just={$\lor$ Elim:!u}, move by=1
801 % ]
802 % ]
803 % ]
804 % ]
805 % ]
806 % ]
807 % \end{tableau}%
808 % }%^^A
809 % \hfill
810 % {%
811 % \renewcommand*\linenumberstyle[1]{#1)}%
812 % \mbox{%^^A required by docstrip + memoize (but only for both)
813 % \begin{tableau}
814 % {
815 % close with={\ensuremath{\ast}},
816 % just format={text=gray, font=\itshape},
817 % line no format={text=gray},
818 % for tree={
819 % edge path'={(!u.parent anchor) -- +(0,-5pt) -| (.child anchor)},
820 % edge={gray},
821 % },
822 % line no sep=.35em,
823 % just sep=.35em,
824 % }
825 % [P \lor (Q \lor \tnot R), just=Ass, checked
826 % [P \supset \tnot R, just=Ass, checked
827 % [Q \supset \tnot R, just=Ass, checked
828 % [\tnot\tnot R, just={Neg conc}
829 % [P, just={$\lor$ Elim:!r1}
830 % [\tnot P, close={:!u,!c}]
831 % [\tnot R, close={:!uu,!c}, just={$\supset$ Elim:!r11}
832 % ]
833 % ]
834 % [Q \lor \tnot R, checked
835 % [Q, move by=1
836 % [\tnot Q, close={:!u,!c}]
837 % [\tnot R, close={:!r1111,!c}, just={$\supset$ Elim:!r111}
838 % ]
839 % ]
840 % [\tnot R, close={:!r1111,!c}, just={$\lor$ Elim:!u}, move by=1
841 % ]
842 % ]
843 % ]
844 % ]
845 % ]
846 % ]
847 % \end{tableau}%
848 % }%^^A
849 % }
850 %
851 % \mbox{%^^A required by docstrip + memoize (but only for both)
852 % \begin{tableau}
853 % {
854 % not line numbering,
855 % single branches,
856 % close with={\fycross},
857 % check with={\fycheck},
858 % check left,
859 % line no sep=.35em,
860 % just sep=.35em,
861 % }
862 % [P \lor (Q \lor \lnot R), just=Ass, checked
863 % [P \lif \lnot R, just=Ass, checked, grouped
864 % [Q \lif \lnot R, just=Ass, checked, grouped
865 % [\lnot\lnot R, just={Neg conc}, grouped
866 % [P, just={$\lor$ Elim}
867 % [\lnot P, close]
868 % [\lnot R, close, just={$\lif$ Elim}
869 % ]
870 % ]
871 % [Q \lor \lnot R, checked
872 % [Q, move by=1
873 % [\lnot Q, close]
874 % [\lnot R, close, just={$\lif$ Elim}
875 % ]
876 % ]
877 % [\lnot R, close, just={$\lor$ Elim}, move by=1
878 % ]
879 % ]
880 % ]
881 % ]
882 % ]
883 % ]
884 % \end{tableau}%
885 % }%^^A
886 % \hfill
887 % \mbox{%^^A required by docstrip + memoize (but only for both)
888 % \begin{tableau}
889 % {
890 % to prove={\{ P \lor (Q \lor \lnot R), P \lif \lnot R, Q \lif \lnot R \} \therefore \lnot R},
891 % close with={\ensuremath{\times}},
892 % highlight format={text=red},
893 % line no sep=.35em,
894 % just sep=.35em,
895 % }
896 % [P \lor (Q \lor \lnot R), just=Ass, checked
897 % [P \lif \lnot R, just=Ass, checked
898 % [Q \lif \lnot R, just=Ass, checked
899 % [\lnot\lnot R, just={Neg conc}, highlight wff
900 % [P, just={$\lor$ Elim:!r1}
901 % [\lnot P, close={:!u,!c}, move by=2]
902 % [\lnot R, close={:!uu,!c}, just={$\lif$ Elim:!r11}, highlight wff, move by=2
903 % ]
904 % ]
905 % [Q \lor \lnot R, checked
906 % [Q
907 % [\lnot Q, close={:!u,!c}
908 % ]
909 % [\lnot R, close={:!r1111,!c}, just={$\lif$ Elim:!r111}, highlight wff
910 % ]
911 % ]
912 % [\lnot R, close={:!r1111,!c}, just={$\lor$ Elim:!u}, highlight wff
913 % ]
914 % ]
915 % ]
916 % ]
917 % ]
918 % ]
919 % \end{tableau}
920 % }%^^A
921 %
922 % \mbox{%^^A required by docstrip + memoize (but only for both)
923 % \begin{tableau}
924 % {
925 % to prove={(\exists x)(Lx \lor Mx) \sststile{}{} (\exists x) Lx \lor (\exists x) Mx},
926 % highlight format={text=blue!50!cyan},
927 % line no sep=.5em,
928 % just sep=.5em,
929 % }
930 % [(\exists x) (Lx \lor Mx), checked=a, just=Ass
931 % [\lnot ((\exists x) Lx \lor (\exists x) Mx), checked, just=Neg Conc
932 % [La \lor Ma, checked, just={1 $\exists$\elim}
933 % [\lnot (\exists x) Lx, subs=a, just={2 $\lnot\lor$\elim}, highlight line, tikz+/.wrap pgfmath arg={%
934 % \draw [decorate, decoration={brace, mirror}, draw=blue!50!cyan] (!1.south east -| just #1.east) ++(0,5pt) -- (just #1.north east);
935 % }{level()}
936 % [\lnot (\exists x) Mx, subs=a, highlight line
937 % [\lnot La, just={4 $\lnot\exists$\elim}
938 % [\lnot Ma, just={5 $\lnot\exists$\elim}
939 % [La, close={6,8}, just={3 $\lor$\elim}]
940 % [Ma, close={7,8}]
941 % ]
942 % ]
943 % ]
944 % ]
945 % ]
946 % ]
947 % ]
948 % \end{tableau}%
949 % }%^^A
950 % \hfill
951 % \mbox{%^^A required by docstrip + memoize (but only for both)
952 % \begin{tableau}
953 % {
954 % for tree={%
955 % plain content,
956 % edge path'={(!u.parent anchor) -- ++(0,-5pt) -| (.child anchor)},
957 % align=center,
958 % edge={rounded corners},
959 % },
960 % not line numbering,
961 % just sep=.5em,
962 % }
963 % [Either Alice saw nobody\\or she didn't see nobody.
964 % [Alice saw nobody., just={$\vee$\elim}, subs=Jones
965 % [Alice didn't see Jones., just={$\forall$\elim}]
966 % ]
967 % [Alice didn't see nobody., move by=2, just={$\vee$\elim}
968 % [Alice saw somebody., just={$\lnot\lnot$\elim}, checked=Jones
969 % [Alice saw Jones., just={$\exists$\elim}, before typesetting nodes={for current and ancestors/.wrap pgfmath arg={edge+/.wrap pgfmath arg={red!##1!blue}{100*(level)/#1}, text/.wrap pgfmath arg={red!##1!blue}{100*(level)/#1}}{level}}]
970 % ]
971 % ]
972 % ]
973 % \end{tableau}%
974 % }%^^A
975 % \end{coeden}
976 %^^A END sec:raisondetre >>>
977 % \clearpage
978 %
979 % \section{Assumptions \& Limitations}\label{sec:ass}
980 %^^A BEGIN sec:ass <<<
981 %
982 % \pkg{prooftrees} makes certain assumptions about the nature of the proof system, $\mathcal{L}$, on which proofs are based.
983 % \begin{itemize}
984 % \item All derivation rules yield equal numbers of \wff{}s on all branches.
985 % \begin{center}
986 % \begin{tableau}
987 % {
988 % not line numbering,
989 % for tree={plain content},
990 % for root={s sep+=10pt}
991 % }
992 % [\wff[\wff][\wff[\phantom{\wff}, label={[text=Green3]right:{\fycheck}}]]]
993 % [\wff[\wff[\wff]][\wff[\wff, label={[text=Green3]right:{\fycheck}}]]]
994 % [\wff[\wff][\wff[\wff, label={[text=red]right:{\fycross}}]]]
995 % [\wff[\wff[\wff]][\wff[\phantom{\wff}, label={[text=red]right:{\fycross}}]]]
996 % \end{tableau}
997 % \end{center}
998 % If $\mathcal{L}$ fails to satisfy this condition, \pkg{prooftrees} is likely to violate the requirements of affected derivation rules by splitting branches ‘mid-inference’.
999 % \item No derivation rule yields \wff{}s on more than two branches.
1000 % \item All derivation rules proceed in a downwards direction at an angle of -90\textdegree{} i.e.~from north to south.
1001 % \item Any justifications are set on the far right of the tableau.
1002 % \item Any line numbers are set on the far left of the tableau.
1003 % \item Justifications can refer only to earlier lines in the proof.
1004 % \pkg{prooftrees} can typeset proofs if $\mathcal{L}$ violates this condition, but the cross-referencing system explained in \cref{subsec:lo} cannot be used for affected justifications.
1005 % \end{itemize}
1006 % \pkg{prooftrees} does not support the automatic breaking of tableaux across pages\footnote{%
1007 % It is possible to persuade \pkg{prooftrees} to do this automatically or semi-automatically.
1008 % However, the code is not in a state I would wish to inflict on an unsuspecting public.
1009 % The perilously inquisitive may search TeX Stack Exchange at their own risk.%^^A
1010 % }.
1011 % Tableaux can be manually broken by using \keyname[fregcount]{line no shift} with an appropriate value for parts after the first (\cref{subsec:go}).
1012 % However, horizontal alignment across page breaks will not be consistent in this case.
1013 %
1014 % In addition, \pkg{prooftrees} almost certainly relies on additional assumptions not articulated above and certainly depends on a feature of \pkg{forest} which its author classifies as experimental (\keyname*{do dynamics}).
1015 %
1016 %^^A END sec:ass >>>
1017 %
1018 % \section{Typesetting a Tableau}\label{sec:ee}
1019 %^^A BEGIN sec:ee <<<
1020 %
1021 % After loading \pkg{prooftrees} in the document preamble:
1022 % \iffalse
1023 %<*verb>
1024 % \fi
1025 \begin{latexcode}
1026 % in document's preamble
1027 \usepackage{prooftrees}
1028 \end{latexcode}
1029 % \iffalse
1030 %</verb>
1031 % \fi
1032 % the \env{prooftree} environment is available for typesetting tableaux.
1033 % This takes an argument used to specify a \meta{tree preamble}, with the body of the environment consisting of a \meta{tree specification} in \pkg{forest}'s notation.
1034 % The \meta{tree preamble} can be as simple as an empty argument --- \arg{} --- or much more complex.
1035 %
1036 % Customisation options and further details concerning loading and invocation are explained in \cref{sec:llwytho}, \cref{sec:invoke}, \cref{sec:anatomy}, \cref{sec:ops} and \cref{sec:macros}.
1037 % In this section, we begin by looking at a simple example using the default settings.
1038 %
1039 % Suppose that we wish to typeset the tableau for
1040 % \[
1041 % (\exists x)((\forall y)(Py \lif x = y) \land Px) \sststile{}{} (\exists x)(\forall y)(Py \liff x = y)
1042 % \]
1043 % and we would like to typeset the entailment established by our proof at the top of the tree.
1044 % Then we should begin like this:
1045 % \iffalse
1046 %<*verb>
1047 % \fi
1048 \begin{latexcode}
1049 \begin{tableau}
1050 {
1051 to prove={(\exists x)((\forall y)(Py \lif x = y) \land Px) \sststile{}{} (\exists x)(\forall y)(Py \liff x = y)}
1052 }
1053 \end{tableau}
1054 \end{latexcode}
1055 % \iffalse
1056 %</verb>
1057 % \fi
1058 % That is all the preamble we want, so we move onto consider the \meta{tree specification}.
1059 % \pkg{forest} uses square brackets to specify trees' structures.
1060 % To typeset a proof, think of it as consisting of nested trees, trunks upwards, and work from the outside in and the trunks down (\cref{nythod}).
1061 % \begin{coeden}[label=nythod]{Nested structure of tableau}
1062 % \begin{tableau}
1063 % {
1064 % to prove={(\exists x)((\forall y)(Py \lif x = y) \land Px) \sststile{}{} (\exists x)(\forall y)(Py \liff x = y)},
1065 % just sep*=3,
1066 % line no sep*=3,
1067 % for root={%
1068 % tikz+={%
1069 % \foreach \i [evaluate=\i as \j using 100*\i/14, evaluate=\i as \k using (11*(\i-7))-30, evaluate=\i as \m using (11*(7-\i))-30] in {13,...,1}
1070 % {%
1071 % \ifnum\i<8
1072 % \coordinate (p\i) at ([yshift=-1 pt,xshift=\k pt]current bounding box.south);
1073 % \else
1074 % \ifnum\i<10
1075 % \coordinate (p\i) at ([yshift=-1 pt,xshift=\m pt]current bounding box.south);
1076 % \else
1077 % \ifnum\i=10
1078 % \coordinate (p\i) at ([yshift=-1 pt,xshift=\k+40 pt]current bounding box.south);
1079 % \else
1080 % \coordinate (p\i) at ([yshift=-1 pt,xshift=\k-52 pt]current bounding box.south);
1081 % \fi
1082 % \fi
1083 % \fi
1084 % \node [fill=WildStrawberry!\j!blue, circle, font=\sffamily\small, text width=12pt, text centered, text=white, inner sep=0pt] at (p\i) {\i};
1085 % \ifnum\i>7
1086 % \ifnum\i<10
1087 % \coordinate (q\i) at ([xshift=\k+40 pt]current bounding box.south |- p\i);
1088 % \node [fill=WildStrawberry!\j!blue, circle, font=\sffamily\small, text width=12pt, text centered, text=white, inner sep=0pt] at (q\i) {\i};
1089 % \else
1090 % \ifnum\i=12
1091 % \coordinate (q\i) at ([xshift=\m pt]current bounding box.south |- p\i);
1092 % \node [fill=WildStrawberry!\j!blue, circle, font=\sffamily\small, text width=12pt, text centered, text=white, inner sep=0pt] at (q\i) {\i};
1093 % \fi
1094 % \fi
1095 % \fi
1096 % }
1097 % },
1098 % },
1099 % for tree={%
1100 % s sep'+=30pt,
1101 % if={%
1102 % > O_> O_= & {level}{0} {proof tree rhifo}{1}
1103 % }{%
1104 % node options/.process={%
1105 % OOw2+nw+Pw {level}{proof tree toing by}{#1+#2}{#1*100/14}{%
1106 % draw,rounded corners,WildStrawberry!#1!blue}},
1107 % fill=white,
1108 % delay={%
1109 % tempcounta/.process={OOw2+n{level}{proof tree toing by}{#1+#2}},
1110 % if={> R_< {tempcounta}{8}}{%
1111 % nyth/.process={Rw{tempcounta}{{(!r211111111112111) (!Luu) (!Luuu) (!11) (!Fuu) (!r21111111111)}{#1}{p}}},
1112 % }{%
1113 % if={>R_>{tempcounta}{9}}{%
1114 % if={>O_={!uu.n}{2}}{}{%
1115 % tempcounta'+=1,
1116 % if={>O_=O_=&{n}{1}{!u.n children}{2}}{%
1117 % nyth/.process={Rw{tempcounta}{{}{#1}{q}}},
1118 % }{%
1119 % nyth/.process={Rw{tempcounta}{{}{#1}{p}}},
1120 % },
1121 % },
1122 % }{%
1123 % tempcountb/.register=tempcounta,
1124 % if={>R_={tempcounta}{8}}{%
1125 % if n=1{%^^A is-goeden ar y chwith
1126 % nyth={(!1111) (!llll) (!lllll)}{8}{p},
1127 % }{%^^A is-goeden ar y dde
1128 % nyth={(!1) (!11)}{8}{q},
1129 % },
1130 % tempcounta'+=1,
1131 % for n=1{%
1132 % if={>O_={!u.n}{1}}{%^^A is-goeden ar y chwith
1133 % nyth={(!Fuu) (!Luu)}{9}{p},
1134 % }{%^^A is-goeden ar y dde
1135 % nyth={(!1)}{9}{q},
1136 % tempcounta'+=1,
1137 % for n=1{%
1138 % nyth={}{10}{p},
1139 % },
1140 % },
1141 % },
1142 % }{},
1143 % },
1144 % },
1145 % },
1146 % }{},
1147 % },
1148 % }
1149 % [{(\exists x)((\forall y)(Py \lif x = y) \land Px)}, checked=a, just=Pr., name=pr
1150 % [{\lnot (\exists x)(\forall y)(Py \liff x = y)}, subs=a, just=Conc.~neg., name=neg conc
1151 % [{(\forall y)(Py \lif a = y) \land Pa}, checked, just=$\exists\elim$:pr
1152 % [{(\forall y)(Py \lif a = y)}, subs=b, just=$\land\elim$:!u, name=mark
1153 % [Pa, just=$\land\elim$:!uu, name=simple
1154 % [{\lnot (\forall y)(Py \liff a = y)}, checked=b, just=$\lnot\exists\elim$:neg conc
1155 % [{\lnot (Pb \liff a = b)}, checked, just=$\lnot\forall\elim$:!u
1156 % [Pb, just=$\liff\elim$:!u, name=to Pb or not to Pb
1157 % [a \neq b, just=$\liff\elim$:!u
1158 % [{Pb \lif a = b}, checked, just=$\forall\elim$:mark, move by=1
1159 % [\lnot Pb, close={:to Pb or not to Pb,!c}, just=$\lif\elim$:!u
1160 % ]
1161 % [{a = b}
1162 % [a \neq a, close={:!c}, just={$=\elim$:{!uuu,!u}}
1163 % ]
1164 % ]
1165 % ]
1166 % ]
1167 % ]
1168 % [\lnot Pb
1169 % [{a = b}
1170 % [Pb, just={$=\elim$:{simple,!u}}, close={:to Pb or not to Pb,!c}
1171 % ]
1172 % ]
1173 % ]
1174 % ]
1175 % ]
1176 % ]
1177 % ]
1178 % ]
1179 % ]
1180 % ]
1181 % \end{tableau}
1182 % \end{coeden}
1183 %
1184 % Starting with the outermost tree \nyth*{} and the topmost trunk, we replace the \bocsnyth{} with square brackets and enter the first \wff{} inside, adding \verb|just=Pr.| for the justification on the right and \verb|checked=a| so that the line will be marked as discharged with $a$ substituted for $x$.
1185 % We also use \pkg{forest}'s \keyname*[fopttoks]{name} to label the line for ease of reference later.
1186 % (Technically, it is the node rather than the line which is named, but, for our purposes, this doesn't matter.
1187 % \pkg{forest} will create a name if we don't specify one, but it will not necessarily be one we would have chosen for ease of use!)
1188 % \iffalse
1189 %<*verb>
1190 % \fi
1191 \begin{latexcode}
1192 \begin{tableau}
1193 {
1194 to prove={(\exists x)((\forall y)(Py \lif x = y) \land Px) \sststile{}{} (\exists x)(\forall y)(Py \liff x = y)}
1195 }
1196 [{(\exists x)((\forall y)(Py \lif x = y) \land Px)}, checked=a, just=Pr., name=pr
1197 ]
1198 \end{tableau}
1199 \end{latexcode}
1200 % \iffalse
1201 %</verb>
1202 % \fi
1203 % We can refer to this line later as \verb|pr|.
1204 %
1205 % We then consider the next tree \nyth*{}.
1206 % Its \bocsnyth{} goes inside that for \nyth[1], so the square brackets containing the next \wff{} go inside those we used for \nyth[1].
1207 % Again, we add the justification with \keyname[foptautotoks]{just}, but we use \verb|subs=a| rather than \verb|checked=a| as we want to mark substitution of $a$ for $x$ without discharging the line.
1208 % Again, we use \keyname*[fopttoks]{name} so that we can refer to the line later as \verb|neg conc|.
1209 % \iffalse
1210 %<*verb>
1211 % \fi
1212 \begin{latexcode}
1213 \begin{tableau}
1214 {
1215 to prove={(\exists x)((\forall y)(Py \lif x = y) \land Px) \sststile{}{} (\exists x)(\forall y)(Py \liff x = y)}
1216 }
1217 [{(\exists x)((\forall y)(Py \lif x = y) \land Px)}, checked=a, just=Pr., name=pr
1218 [{\lnot (\exists x)(\forall y)(Py \liff x = y)}, subs=a, just=Conc.~neg., name=neg conc
1219 ]
1220 ]
1221 \end{tableau}
1222 \end{latexcode}
1223 % \iffalse
1224 %</verb>
1225 % \fi
1226 %
1227 % Turning to tree \nyth*{}, we again note that its \bocsnyth{} is nested within the previous two, so the square brackets for its \wff{} need to be nested within those for the previous \wff{}s.
1228 % This time, we want to mark the line as discharged without substitution, so we simply use \keyname[fstyle]{checked} without a value.
1229 % Since the justification for this line includes mathematics, we need to ensure that the relevant part of the justification is surrounded by \verb|$|\dots \verb|$| or \verb|\(|\dots\verb|\)|.
1230 % This justification also refers to an earlier line in the proof.
1231 % We could write this as \verb|just=1 $\exists\elim$|, but instead we use the name we assigned earlier with the referencing feature provided by \pkg{prooftrees}.
1232 % To do this, we put the reference, \verb|pr| \emph{after} the rest of the justification, separating the two parts by a colon i.e.~\verb|$\exists\elim$:pr| and allow \pkg{prooftrees} to figure out the correct number.
1233 % \iffalse
1234 %<*verb>
1235 % \fi
1236 \begin{latexcode}
1237 \begin{tableau}
1238 {
1239 to prove={(\exists x)((\forall y)(Py \lif x = y) \land Px) \sststile{}{} (\exists x)(\forall y)(Py \liff x = y)}
1240 }
1241 [{(\exists x)((\forall y)(Py \lif x = y) \land Px)}, checked=a, just=Pr., name=pr
1242 [{\lnot (\exists x)(\forall y)(Py \liff x = y)}, subs=a, just=Conc.~neg., name=neg conc
1243 [{(\forall y)(Py \lif a = y) \land Pa}, checked, just=$\exists\elim$:pr
1244 ]
1245 ]
1246 ]
1247 \end{tableau}
1248 \end{latexcode}
1249 % \iffalse
1250 %</verb>
1251 % \fi
1252 %
1253 % Continuing in the same way, we surround each of the \wff{}s for \nyth*{}, \nyth*{}, \nyth*{} and \nyth*{} within square brackets nested within those surrounding the previous \wff{} since each of the trees is nested within the previous one.
1254 % Where necessary, we use \keyname*[fopttoks]{name} to label lines we wish to refer to later, but we also use \pkg{forest}'s \emph{relative} naming system when this seems easier.
1255 % For example, in the next line we add, we specify the justification as \verb|just=$\land\elim$:!u|.
1256 % \verb|!| tells \pkg{forest} that the reference specifies a relationship between the current line and the referenced one, rather than referring to the other line by name.
1257 % \verb|!u| refers to the current line's parent line --- in this case, \verb|{(\forall y)(Py \lif a = y) \land Pa}, checked, just=$\exists\elim$:pr|.
1258 % \verb|!uu| refers to the current line's parent line's parent line and so on.
1259 % \iffalse
1260 %<*verb>
1261 % \fi
1262 \begin{latexcode}
1263 \begin{tableau}
1264 {
1265 to prove={(\exists x)((\forall y)(Py \lif x = y) \land Px) \sststile{}{} (\exists x)(\forall y)(Py \liff x = y)}
1266 }
1267 [{(\exists x)((\forall y)(Py \lif x = y) \land Px)}, checked=a, just=Pr., name=pr
1268 [{\lnot (\exists x)(\forall y)(Py \liff x = y)}, subs=a, just=Conc.~neg., name=neg conc
1269 [{(\forall y)(Py \lif a = y) \land Pa}, checked, just=$\exists\elim$:pr
1270 [{(\forall y)(Py \lif a = y)}, subs=b, just=$\land\elim$:!u, name=mark
1271 [Pa, just=$\land\elim$:!uu, name=simple
1272 [{\lnot (\forall y)(Py \liff a = y)}, checked=b, just=$\lnot\exists\elim$:neg conc
1273 [{\lnot (Pb \liff a = b)}, checked, just=$\lnot\forall\elim$:!u
1274 ]
1275 ]
1276 ]
1277 ]
1278 ]
1279 ]
1280 ]
1281 \end{tableau}
1282 \end{latexcode}
1283 % \iffalse
1284 %</verb>
1285 % \fi
1286 %
1287 % Reaching \nyth*{}, things get a little more complex since we now have not one, but \emph{two} \bocsnyth{} nested within \nyth[7].
1288 % This means that we need \emph{two} sets of square brackets for \nyth{} --- one for each of its two trees.
1289 % Again, both of these should be nested within the square brackets for \nyth[7] but neither should be nested within the other because the trees for the two branches at \nyth{} are distinct.
1290 % \iffalse
1291 %<*verb>
1292 % \fi
1293 \begin{latexcode}
1294 \begin{tableau}
1295 {
1296 to prove={(\exists x)((\forall y)(Py \lif x = y) \land Px) \sststile{}{} (\exists x)(\forall y)(Py \liff x = y)}
1297 }
1298 [{(\exists x)((\forall y)(Py \lif x = y) \land Px)}, checked=a, just=Pr., name=pr
1299 [{\lnot (\exists x)(\forall y)(Py \liff x = y)}, subs=a, just=Conc.~neg., name=neg conc
1300 [{(\forall y)(Py \lif a = y) \land Pa}, checked, just=$\exists\elim$:pr
1301 [{(\forall y)(Py \lif a = y)}, subs=b, just=$\land\elim$:!u, name=mark
1302 [Pa, just=$\land\elim$:!uu, name=simple
1303 [{\lnot (\forall y)(Py \liff a = y)}, checked=b, just=$\lnot\exists\elim$:neg conc
1304 [{\lnot (Pb \liff a = b)}, checked, just=$\lnot\forall\elim$:!u
1305 [Pb, just=$\liff\elim$:!u, name=to Pb or not to Pb
1306 ]
1307 [\lnot Pb
1308 ]
1309 ]
1310 ]
1311 ]
1312 ]
1313 ]
1314 ]
1315 ]
1316 \end{tableau}
1317 \end{latexcode}
1318 % \iffalse
1319 %</verb>
1320 % \fi
1321 %
1322 % At this point, we need to work separately or in parallel on each of our two branches since each constitutes its own tree.
1323 % Turning to trees \nyth*{}, each needs to be nested within the relevant tree \nyth[8], since each \bocsnyth{} is nested within the applicable branch's tree.
1324 % Hence, we nest square brackets for each of the \wff{}s at \nyth{} within the previous set.
1325 % \iffalse
1326 %<*verb>
1327 % \fi
1328 \begin{latexcode}
1329 \begin{tableau}
1330 {
1331 to prove={(\exists x)((\forall y)(Py \lif x = y) \land Px) \sststile{}{} (\exists x)(\forall y)(Py \liff x = y)}
1332 }
1333 [{(\exists x)((\forall y)(Py \lif x = y) \land Px)}, checked=a, just=Pr., name=pr
1334 [{\lnot (\exists x)(\forall y)(Py \liff x = y)}, subs=a, just=Conc.~neg., name=neg conc
1335 [{(\forall y)(Py \lif a = y) \land Pa}, checked, just=$\exists\elim$:pr
1336 [{(\forall y)(Py \lif a = y)}, subs=b, just=$\land\elim$:!u, name=mark
1337 [Pa, just=$\land\elim$:!uu, name=simple
1338 [{\lnot (\forall y)(Py \liff a = y)}, checked=b, just=$\lnot\exists\elim$:neg conc
1339 [{\lnot (Pb \liff a = b)}, checked, just=$\lnot\forall\elim$:!u
1340 [Pb, just=$\liff\elim$:!u, name=to Pb or not to Pb
1341 [a \neq b, just=$\liff\elim$:!u
1342 ]
1343 ]
1344 [\lnot Pb
1345 [{a = b}
1346 ]
1347 ]
1348 ]
1349 ]
1350 ]
1351 ]
1352 ]
1353 ]
1354 ]
1355 \end{tableau}
1356 \end{latexcode}
1357 % \iffalse
1358 %</verb>
1359 % \fi
1360 %
1361 % We only have one tree \nyth*{} as there is no corresponding tree in the left-hand branch.
1362 % This isn't a problem: we just need to ensure that we nest it within the appropriate tree \nyth[9].
1363 % There are two additional complications here.
1364 % The first is that the justification contains a comma, so we need to surround the argument we give \keyname[foptautotoks]{just} with curly brackets.
1365 % That is, we must write \verb|just={5,9 $=\elim$}| or \verb|just={$=\elim$:{simple,!u}}|.
1366 % The second is that we wish to close this branch with an indication of the line numbers containing inconsistent \wff{}s.
1367 % We can use \verb|close={8,10}| for this or we can use the same referencing system we used to reference lines when specifying justifications and write \verb|close={:to Pb or not to Pb,!c}|.
1368 % In either case, we again surrounding the argument with curly brackets to protect the comma.
1369 % \verb|!c| refers to the current line --- something useful in many close annotations, but not helpful in specifying non-circular justifications.
1370 % \iffalse
1371 %<*verb>
1372 % \fi
1373 \begin{latexcode}
1374 \begin{tableau}
1375 {
1376 to prove={(\exists x)((\forall y)(Py \lif x = y) \land Px) \sststile{}{} (\exists x)(\forall y)(Py \liff x = y)}
1377 }
1378 [{(\exists x)((\forall y)(Py \lif x = y) \land Px)}, checked=a, just=Pr., name=pr
1379 [{\lnot (\exists x)(\forall y)(Py \liff x = y)}, subs=a, just=Conc.~neg., name=neg conc
1380 [{(\forall y)(Py \lif a = y) \land Pa}, checked, just=$\exists\elim$:pr
1381 [{(\forall y)(Py \lif a = y)}, subs=b, just=$\land\elim$:!u, name=mark
1382 [Pa, just=$\land\elim$:!uu, name=simple
1383 [{\lnot (\forall y)(Py \liff a = y)}, checked=b, just=$\lnot\exists\elim$:neg conc
1384 [{\lnot (Pb \liff a = b)}, checked, just=$\lnot\forall\elim$:!u
1385 [Pb, just=$\liff\elim$:!u, name=to Pb or not to Pb
1386 [a \neq b, just=$\liff\elim$:!u
1387 ]
1388 ]
1389 [\lnot Pb
1390 [{a = b}
1391 [Pb, just={$=\elim$:{simple,!u}}, close={:to Pb or not to Pb,!c}
1392 ]
1393 ]
1394 ]
1395 ]
1396 ]
1397 ]
1398 ]
1399 ]
1400 ]
1401 ]
1402 \end{tableau}
1403 \end{latexcode}
1404 % \iffalse
1405 %</verb>
1406 % \fi
1407 %
1408 % This completes the main right-hand branch of the tree and we can focus solely on the remaining left-hand one.
1409 % Tree \nyth*{} is straightforward --- we just need to nest it within the left-hand tree \nyth[9].
1410 % \iffalse
1411 %<*verb>
1412 % \fi
1413 \begin{latexcode}
1414 \begin{tableau}
1415 {
1416 to prove={(\exists x)((\forall y)(Py \lif x = y) \land Px) \sststile{}{} (\exists x)(\forall y)(Py \liff x = y)}
1417 }
1418 [{(\exists x)((\forall y)(Py \lif x = y) \land Px)}, checked=a, just=Pr., name=pr
1419 [{\lnot (\exists x)(\forall y)(Py \liff x = y)}, subs=a, just=Conc.~neg., name=neg conc
1420 [{(\forall y)(Py \lif a = y) \land Pa}, checked, just=$\exists\elim$:pr
1421 [{(\forall y)(Py \lif a = y)}, subs=b, just=$\land\elim$:!u, name=mark
1422 [Pa, just=$\land\elim$:!uu, name=simple
1423 [{\lnot (\forall y)(Py \liff a = y)}, checked=b, just=$\lnot\exists\elim$:neg conc
1424 [{\lnot (Pb \liff a = b)}, checked, just=$\lnot\forall\elim$:!u
1425 [Pb, just=$\liff\elim$:!u, name=to Pb or not to Pb
1426 [a \neq b, just=$\liff\elim$:!u
1427 [{Pb \lif a = b}, checked, just=$\forall\elim$:mark%, move by=1
1428 ]
1429 ]
1430 ]
1431 [\lnot Pb
1432 [{a = b}
1433 [Pb, just={$=\elim$:{simple,!u}}, close={:to Pb or not to Pb,!c}
1434 ]
1435 ]
1436 ]
1437 ]
1438 ]
1439 ]
1440 ]
1441 ]
1442 ]
1443 ]
1444 \end{tableau}
1445 \end{latexcode}
1446 % \iffalse
1447 %</verb>
1448 % \fi
1449 %
1450 % At this point, the main left-hand branch itself branches, so we have two trees \nyth*{}.
1451 % Treating this in the same way as the earlier branch at \nyth[8], we use two sets of square brackets nested within those for tree \nyth{}, but with neither nested within the other.
1452 % Since we also want to mark the leftmost branch as closed, we add \verb|close={:to Pb or not to Pb,!c}| in the same way as before.
1453 % \iffalse
1454 %<*verb>
1455 % \fi
1456 \begin{latexcode}
1457 \begin{tableau}
1458 {
1459 to prove={(\exists x)((\forall y)(Py \lif x = y) \land Px) \sststile{}{} (\exists x)(\forall y)(Py \liff x = y)}
1460 }
1461 [{(\exists x)((\forall y)(Py \lif x = y) \land Px)}, checked=a, just=Pr., name=pr
1462 [{\lnot (\exists x)(\forall y)(Py \liff x = y)}, subs=a, just=Conc.~neg., name=neg conc
1463 [{(\forall y)(Py \lif a = y) \land Pa}, checked, just=$\exists\elim$:pr
1464 [{(\forall y)(Py \lif a = y)}, subs=b, just=$\land\elim$:!u, name=mark
1465 [Pa, just=$\land\elim$:!uu, name=simple
1466 [{\lnot (\forall y)(Py \liff a = y)}, checked=b, just=$\lnot\exists\elim$:neg conc
1467 [{\lnot (Pb \liff a = b)}, checked, just=$\lnot\forall\elim$:!u
1468 [Pb, just=$\liff\elim$:!u, name=to Pb or not to Pb
1469 [a \neq b, just=$\liff\elim$:!u
1470 [{Pb \lif a = b}, checked, just=4 $\forall\elim$
1471 [\lnot Pb, close={:to Pb or not to Pb,!c}, just=$\lif\elim$:!u
1472 ]
1473 [{a = b}
1474 ]
1475 ]
1476 ]
1477 ]
1478 [\lnot Pb
1479 [{a = b}
1480 [Pb, just={$=\elim$:{simple,!u}}, close={:to Pb or not to Pb,!c}
1481 ]
1482 ]
1483 ]
1484 ]
1485 ]
1486 ]
1487 ]
1488 ]
1489 ]
1490 ]
1491 \end{tableau}
1492 \end{latexcode}
1493 % \iffalse
1494 %</verb>
1495 % \fi
1496 %
1497 % We complete our initial specification by nesting \nyth*{} within the appropriate tree \nyth[12], again marking closure appropriately.
1498 % \iffalse
1499 %<*verb>
1500 % \fi
1501 \begin{latexcode}
1502 \begin{tableau}
1503 {
1504 to prove={(\exists x)((\forall y)(Py \lif x = y) \land Px) \sststile{}{} (\exists x)(\forall y)(Py \liff x = y)}
1505 }
1506 [{(\exists x)((\forall y)(Py \lif x = y) \land Px)}, checked=a, just=Pr., name=pr
1507 [{\lnot (\exists x)(\forall y)(Py \liff x = y)}, subs=a, just=Conc.~neg., name=neg conc
1508 [{(\forall y)(Py \lif a = y) \land Pa}, checked, just=$\exists\elim$:pr
1509 [{(\forall y)(Py \lif a = y)}, subs=b, just=$\land\elim$:!u, name=mark
1510 [Pa, just=$\land\elim$:!uu, name=simple
1511 [{\lnot (\forall y)(Py \liff a = y)}, checked=b, just=$\lnot\exists\elim$:neg conc
1512 [{\lnot (Pb \liff a = b)}, checked, just=$\lnot\forall\elim$:!u
1513 [Pb, just=$\liff\elim$:!u, name=to Pb or not to Pb
1514 [a \neq b, just=$\liff\elim$:!u
1515 [{Pb \lif a = b}, checked, just=4 $\forall\elim$
1516 [\lnot Pb, close={:to Pb or not to Pb,!c}, just=$\lif\elim$:!u
1517 ]
1518 [{a = b}
1519 [a \neq a, close={:!c}, just={$=\elim$:{!uuu,!u}}
1520 ]
1521 ]
1522 ]
1523 ]
1524 ]
1525 [\lnot Pb
1526 [{a = b}
1527 [Pb, just={$=\elim$:{simple,!u}}, close={:to Pb or not to Pb,!c}
1528 ]
1529 ]
1530 ]
1531 ]
1532 ]
1533 ]
1534 ]
1535 ]
1536 ]
1537 ]
1538 \end{tableau}
1539 \end{latexcode}
1540 % \iffalse
1541 %</verb>
1542 % \fi
1543 %
1544 % Compiling our code, we find that the line numbering is not quite right:
1545 %
1546 % \begin{tableau}
1547 % {
1548 % to prove={(\exists x)((\forall y)(Py \lif x = y) \land Px) \sststile{}{} (\exists x)(\forall y)(Py \liff x = y)}
1549 % }
1550 % [{(\exists x)((\forall y)(Py \lif x = y) \land Px)}, checked=a, just=Pr., name=pr
1551 % [{\lnot (\exists x)(\forall y)(Py \liff x = y)}, subs=a, just=Conc.~neg., name=neg conc
1552 % [{(\forall y)(Py \lif a = y) \land Pa}, checked, just=$\exists\elim$:pr
1553 % [{(\forall y)(Py \lif a = y)}, subs=b, just=$\land\elim$:!u, name=mark
1554 % [Pa, just=$\land\elim$:!uu, name=simple
1555 % [{\lnot (\forall y)(Py \liff a = y)}, checked=b, just=$\lnot\exists\elim$:neg conc
1556 % [{\lnot (Pb \liff a = b)}, checked, just=$\lnot\forall\elim$:!u
1557 % [Pb, just=$\liff\elim$:!u, name=to Pb or not to Pb
1558 % [a \neq b, just=$\liff\elim$:!u
1559 % [{Pb \lif a = b}, checked, just=4 $\forall\elim$
1560 % [\lnot Pb, close={:to Pb or not to Pb,!c}, just=$\lif\elim$:!u
1561 % ]
1562 % [{a = b}
1563 % [a \neq a, close={:!c}, just={$=\elim$:{!uuu,!u}}
1564 % ]
1565 % ]
1566 % ]
1567 % ]
1568 % ]
1569 % [\lnot Pb
1570 % [{a = b}
1571 % [Pb, just={$=\elim$:{simple,!u}}, close={:to Pb or not to Pb,!c}
1572 % ]
1573 % ]
1574 % ]
1575 % ]
1576 % ]
1577 % ]
1578 % ]
1579 % ]
1580 % ]
1581 % ]
1582 % \end{tableau}
1583 %
1584 % \pkg{prooftrees} warns us about this:
1585 % \iffalse
1586 %<*verb>
1587 % \fi
1588 \begin{latexcode}
1589 Package prooftrees Warning: Merging conflicting justifications for line 10! Please examine the output carefully and use "move by" to move lines later in the proof if required. Details of how to do this are included in the documentation.
1590 \end{latexcode}
1591 % \iffalse
1592 %</verb>
1593 % \fi
1594 % We would like line 10 in the left-hand branch to be moved down by one line, so we add \verb|move by=1| to the relevant line of our proof.
1595 % That is, we replace the line
1596 % \iffalse
1597 %<*verb>
1598 % \fi
1599 \begin{latexcode}
1600 [{Pb \lif a = b}, checked, just=4 $\forall\elim$
1601 \end{latexcode}
1602 % \iffalse
1603 %</verb>
1604 % \fi
1605 % by
1606 % \iffalse
1607 %<*verb>
1608 % \fi
1609 \begin{latexcode}
1610 [{Pb \lif a = b}, checked, just=$\forall\elim$:mark, move by=1
1611 \end{latexcode}
1612 % \iffalse
1613 %</verb>
1614 % \fi
1615 % giving us the following code:
1616 % \iffalse
1617 %<*verb>
1618 % \fi
1619 \begin{latexcode}
1620 \begin{tableau}
1621 {
1622 to prove={(\exists x)((\forall y)(Py \lif x = y) \land Px) \sststile{}{} (\exists x)(\forall y)(Py \liff x = y)}
1623 }
1624 [{(\exists x)((\forall y)(Py \lif x = y) \land Px)}, checked=a, just=Pr., name=pr
1625 [{\lnot (\exists x)(\forall y)(Py \liff x = y)}, subs=a, just=Conc.~neg., name=neg conc
1626 [{(\forall y)(Py \lif a = y) \land Pa}, checked, just=$\exists\elim$:pr
1627 [{(\forall y)(Py \lif a = y)}, subs=b, just=$\land\elim$:!u, name=mark
1628 [Pa, just=$\land\elim$:!uu, name=simple
1629 [{\lnot (\forall y)(Py \liff a = y)}, checked=b, just=$\lnot\exists\elim$:neg conc
1630 [{\lnot (Pb \liff a = b)}, checked, just=$\lnot\forall\elim$:!u
1631 [Pb, just=$\liff\elim$:!u, name=to Pb or not to Pb
1632 [a \neq b, just=$\liff\elim$:!u
1633 [{Pb \lif a = b}, checked, just=$\forall\elim$:mark, move by=1
1634 [\lnot Pb, close={:to Pb or not to Pb,!c}, just=$\lif\elim$:!u
1635 ]
1636 [{a = b}
1637 [a \neq a, close={:!c}, just={$=\elim$:{!uuu,!u}}
1638 ]
1639 ]
1640 ]
1641 ]
1642 ]
1643 [\lnot Pb
1644 [{a = b}
1645 [Pb, just={$=\elim$:{simple,!u}}, close={:to Pb or not to Pb,!c}
1646 ]
1647 ]
1648 ]
1649 ]
1650 ]
1651 ]
1652 ]
1653 ]
1654 ]
1655 ]
1656 \end{tableau}
1657 \end{latexcode}
1658 % \iffalse
1659 %</verb>
1660 % \fi
1661 % which produces our desired result:
1662 %
1663 % \begin{tableau}
1664 % {
1665 % to prove={(\exists x)((\forall y)(Py \lif x = y) \land Px) \sststile{}{} (\exists x)(\forall y)(Py \liff x = y)}
1666 % }
1667 % [{(\exists x)((\forall y)(Py \lif x = y) \land Px)}, checked=a, just=Pr., name=pr
1668 % [{\lnot (\exists x)(\forall y)(Py \liff x = y)}, subs=a, just=Conc.~neg., name=neg conc
1669 % [{(\forall y)(Py \lif a = y) \land Pa}, checked, just=$\exists\elim$:pr
1670 % [{(\forall y)(Py \lif a = y)}, subs=b, just=$\land\elim$:!u, name=mark
1671 % [Pa, just=$\land\elim$:!uu, name=simple
1672 % [{\lnot (\forall y)(Py \liff a = y)}, checked=b, just=$\lnot\exists\elim$:neg conc
1673 % [{\lnot (Pb \liff a = b)}, checked, just=$\lnot\forall\elim$:!u
1674 % [Pb, just=$\liff\elim$:!u, name=to Pb or not to Pb
1675 % [a \neq b, just=$\liff\elim$:!u
1676 % [{Pb \lif a = b}, checked, just=$\forall\elim$:mark, move by=1
1677 % [\lnot Pb, close={:to Pb or not to Pb,!c}, just=$\lif\elim$:!u
1678 % ]
1679 % [{a = b}
1680 % [a \neq a, close={:!c}, just={$=\elim$:{!uuu,!u}}
1681 % ]
1682 % ]
1683 % ]
1684 % ]
1685 % ]
1686 % [\lnot Pb
1687 % [{a = b}
1688 % [Pb, just={$=\elim$:{simple,!u}}, close={:to Pb or not to Pb,!c}
1689 % ]
1690 % ]
1691 % ]
1692 % ]
1693 % ]
1694 % ]
1695 % ]
1696 % ]
1697 % ]
1698 % ]
1699 % \end{tableau}
1700 %
1701 %^^A END sec:ee >>>
1702 %
1703 % \restoregeometry
1704 % \setlength\tewadjust{\marginparwidth+\marginparsep-\paperwidth+\textwidth+\oddsidemargin+1in}%
1705 % \fancyheadoffset[lh]{\tewadjust}%
1706 % \section{Loading the Package}\label{sec:llwytho}
1707 %^^A BEGIN sec:llwytho <<<
1708 %
1709 % To load the package simply add the following to your document's preamble.
1710 % \iffalse
1711 %<*verb>
1712 % \fi
1713 \begin{latexcode}
1714 \usepackage{prooftrees}
1715 \end{latexcode}
1716 % \iffalse
1717 %</verb>
1718 % \fi
1719 % \keyname[pkg]{\pkg{prooftrees}} will load \keyname[pkg]{\pkg{forest}} automatically.
1720 %
1721 % \changes{v0.6}{}{Add compatibility option for use with \pkg{bussproofs}.
1722 % Thanks to Peter Smith for suggesting this.}
1723 % The only option currently supported is \keyname[pkgopt]{\option{tableaux}}.
1724 % If this option is specified, the \env{prooftree} environment will be called \env{tableau} instead.
1725 % \Example{\cs{usepackage}[tableaux]{prooftrees}} would cause the \env{tableau} environment to be defined \emph{rather than} \env{prooftree}.
1726 %
1727 % Any other options given will be passed to \keyname[pkg]{\pkg{forest}}.
1728 % \Example{\cs{usepackage}[debug]{prooftrees}} would enable \keyname[pkg]{\pkg{forest}}'s debugging.
1729 %
1730 % If one or more of \keyname[pkg]{\pkg{forest}}'s libraries are to be loaded, it is recommended that these be loaded separately and their defaults applied, if applicable, within a local \TeX{} group so that they do not interfere with \keyname[pkg]{\pkg{prooftrees}}'s environment.
1731 %^^A END sec:llwytho >>>
1732 %
1733 % \section{Invocation}\label{sec:invoke}
1734 %^^A BEGIN sec:invoke <<<
1735 % \DescribeEnv{prooftree}\cs{begin}\arg{\env{prooftree}}\marg{tree preamble}\meta{tree specification}\cs{end}\arg{\env{prooftree}}\AfterLastParam
1736 % The \meta{tree preamble} is used to specify any non-default options which should be applied to the tree.
1737 % It may contain any code valid in the preamble of a regular \pkg{forest} tree, in addition to setting \pkg{prooftree} options.
1738 % The preamble may be empty, but the argument is \emph{required}\footnote{%
1739 % Failure to specify a required argument does not always yield a compilation error in the case of environments.
1740 % However, failure to specify required arguments to environments often fails to achieve the best consequences, even when it does not result in compilation failures, and will, therefore, be avoided by the prudent.}.
1741 % The \meta{tree specification} specifies the tree in the bracket notation parsed by \pkg{forest}.
1742 %
1743 % {\em
1744 % {\bfseries
1745 % Users of \keyname[pkg]{\pkg{forest}} should note that the environments \env{prooftree} and \env{forest} differ in important ways.%
1746 % }%
1747 % \begin{itemize}
1748 % \item \env{prooftree}'s argument is \emph{mandatory}.
1749 % \item The tree's preamble \emph{cannot} be given in the body of the environment.
1750 % \item \cs{end}\arg{prooftree} \emph{must} follow the \meta{tree specification} \emph{immediately}.
1751 % \end{itemize}%
1752 % }
1753 %
1754 % \DescribeEnv{tableau}\cs{begin}\arg{\env{tableau}}\marg{tree preamble}\meta{tree specification}\cs{end}\arg{\env{tableau}}\AfterLastParam
1755 % A substitute for \env{prooftree}, defined \emph{instead} of \env{prooftree} if the package option \option{tableaux} is specified or a \cs{prooftree} macro is already defined when \keyname[pkg]{\pkg{prooftrees}} is loaded.
1756 % See \cref{sec:llwytho} for details and \cref{sec:compat} for this option's raison d'être.
1757 %
1758 %^^A END sec:invoke >>>
1759 %
1760 % \section{Tableau Anatomy}\label{sec:anatomy}
1761 %^^A BEGIN sec:anatomy <<<
1762 % The following diagram provides an overview of the configuration and anatomy of a \pkg{prooftrees} proof tree.
1763 % Detailed documentation is provided in \cref{sec:ops} and \cref{sec:macros}.
1764 %
1765 % \forestset{declare count register={cau},cau'=0}
1766 % \begin{tableau}
1767 % {
1768 % to prove={proof statement},
1769 % for tree={%
1770 % plain content,
1771 % font=\itshape,
1772 % delay={content=wff, shape=rectangle,},
1773 % if level=0{}{just=justification},
1774 % if n children=0{%
1775 % close={$n,m$},
1776 % cau'+=1,
1777 % tikz+/.wrap pgfmath arg={%
1778 % \begin{scope}[on background layer]
1779 % \node (cau#1) [inner sep=-2pt, post grwp=DarkOrchid4, fit=(!1) (!11)] {};
1780 % \end{scope}
1781 % }{cau},
1782 % if={cau==5}{%
1783 % tikz+={%
1784 % \path [nodiad=DarkOrchid4] (cau5.south) -- ++(0,-30pt) |- ++(-50:85pt) node (x2) [anchor=west] {Closure};
1785 % \begin{scope}[every node/.append style={font=\scriptsize, align=left, inner sep=0pt}]
1786 % \node [text=DarkOrchid4, anchor=north west, xshift=10pt, text width=.475\textwidth] at (x2.south west) {\textbullet\ closure symbol \& optional annotation\\\textbullet\ location \& annotation content controlled by \keyname[fstyle]{close} within the \meta{tree specification}\\\textbullet\ annotations support cross-references\\\textbullet\ closure symbol controlled by \keyname[fregtoks]{close with} and \keyname[fregkeylist]{close with format}\\\textbullet\ global annotation format controlled by \keyname[fregkeylist]{close format} \& \keyname[fregdim]{close sep}};
1787 % \end{scope}
1788 % }
1789 % }{}
1790 % }{},
1791 % },
1792 % for root={%
1793 % delay={%
1794 % tikz+={%
1795 % \begin{scope}[on background layer]
1796 % \begin{scope}[inner sep=0pt]
1797 % \node (cas) [fit=(), grwp=DodgerBlue3] {};
1798 % \node (rhif) [fit=(!1) (!1F), grwp=Green4] {};
1799 % \node (nod) [fit=(!3) (!3F), grwp=DarkOrange3] {};
1800 % \node (wff) [fit=(!2) (!2F) (!2L) (!2LP) (!2LPP), grwp=WildStrawberry] {};
1801 % \end{scope}
1802 % \path [nodiad=DodgerBlue3] (cas.north) -- ++(0,7.5pt) |- ++(85:90pt) node (cas2) [anchor=west] {Theorem/Entailment};
1803 % \path [nodiad=Green4] (rhif.south) -- ++(0,-45pt) |- ++(-85:130pt) node (rhif2) [anchor=west] {Line Numbers};
1804 % \path [nodiad=DarkOrange3] (nod.north) |- ++(40:35pt) node (nod2) [anchor=west] {Justifications};
1805 % \path [nodiad=WildStrawberry] (wff.south) |- ++(-50pt,-15pt) -- ++(0,-15pt) node (wff2) [anchor=north] {\wff s};
1806 % \begin{scope}[every node/.append style={font=\scriptsize, align=left, inner sep=0pt}]
1807 % \node [text=DodgerBlue3, anchor=north west, xshift=10pt,] at (cas2.south west) {\textbullet\ specified with \texttt{to prove}\\\textbullet\ format controlled by \keyname[fregkeylist]{proof statement format}\\\textbullet\ named \texttt{proof statement}};
1808 % \node [text=Green4, anchor=north west, xshift=10pt, text width=.6\textwidth] at (rhif2.south west) {\textbullet\ content \& location automatic\\\textbullet\ existence controlled by \texttt{line numbering}\\\textbullet\ global format controlled by \keyname[fregkeylist]{line no format} \& \cs{linenumberstyle}\\\textbullet\ local format controlled by \keyname[foptbool]{highlight line no} \& \keyname[foptautotoks]{line no options}\\\textbullet\ named \texttt{line no $n$} for proof line $n$};
1809 % \node (nod3) [text=DarkOrange3, anchor=north west, xshift=10pt, text width=.4\textwidth] at (nod2.south west) {\textbullet\ location automatic\\\textbullet\ existence controlled implicitly or with \texttt{justifications}\\\textbullet\ content specified with \texttt{just}\\\textbullet\ cross-references supported\\\textbullet\ global format controlled by \keyname[fregkeylist]{just format} \& \keyname[fregbool]{just refs left}\\\textbullet\ local format controlled by \keyname[foptbool]{highlight just} \& \keyname[foptautotoks]{just options}\\\textbullet\ named \texttt{just $n$} for proof line $n$};
1810 % \node [text=WildStrawberry, anchor=north west, xshift=10pt, text width=.25\textwidth] at (wff2.south west) {\textbullet\ from \meta{tree specification}\\\textbullet\ global format controlled by \keyname[fregkeylist]{wff format}\\\textbullet\ local format controlled by \keyname[foptbool]{highlight wff} \& \keyname[foptautotoks]{wff options}\\\textbullet\ \keyname[foptbool]{highlight line} and \keyname[foptautotoks]{line options} control the format of the current \wff's proof line};
1811 % \end{scope}
1812 % \node (esb) [below=10pt of nod3.south west, font=\footnotesize, anchor=north west, align=left, text width=.4\textwidth] {\textsc{Anatomy \& Ontology}\\\textbullet\ \pkg{forest} trees consist of (\TikZ) \texttt{nodes}\\\textbullet\ \pkg{prooftrees} places \wff s, line numbers, justifications \& proof statements into nodes\\\textbullet\ the content \& location of each node depends on its type: line number, \wff{}, justification or proof statement\\\textbullet\ the proof's structure \& appearance is determined by the \meta{tree preamble} \& \meta{tree specification}\\\textbullet\ node content, existence \& location is controlled by one or both of these, depending on the node type};
1813 % \node [below=5pt of esb.south west, font=\footnotesize, anchor=north west, align=left, text width=.55\textwidth, xshift=-.15\textwidth] {\textsc{Meaning \& Reference}\\\textbullet\ nodes for the proof statement, justifications \& line numbers are given standard names for ease of reference\\\textbullet\ the proof statement node is the \texttt{root}\\\textbullet\ \wff{} nodes may be named as required\\\textbullet\ a cross-referencing system supports annotations in justifications and closures};
1814 % \end{scope}
1815 % },
1816 % },
1817 % },
1818 % }
1819 % [, checked,
1820 % tikz+={%
1821 % \node (c1) [anchor=base east] at (.base east) {\phantom{$\checkmark$}};
1822 % \begin{scope}[on background layer]
1823 % \node [post grwp=DarkOrchid4,anchor=base east, inner sep=-2pt, fit=(c1)] {};
1824 % \path [nodiad=DarkOrchid4] ([yshift=-2pt]c1.north) |- ++(80:75pt) node (ann2) [anchor=west] {Discharge \& Substitution};
1825 % \begin{scope}[every node/.append style={font=\scriptsize, align=left, inner sep=0pt}]
1826 % \node [text=DarkOrchid4, anchor=north west, xshift=10pt, text width=.7\textwidth] at (ann2.south west) {\textbullet\ location \& annotation content controlled by \keyname[fstyle]{checked} and \keyname[fstyle]{subs} within the \meta{tree specification}\\\textbullet\ discharge \& substitution symbols controlled by \keyname[fregtoks]{check with} \& \keyname[fregtoks]{subs with}\\\textbullet\ \keyname[fregbool]{check right} \& \keyname[fregbool]{subs right} control relative location};
1827 % \end{scope}
1828 % \end{scope}
1829 % }
1830 % [, checked=a,
1831 % tikz+={%
1832 % \node (c2) [anchor=base east] at (.base east) {\phantom{$\checkmark a$}};
1833 % \begin{scope}[on background layer]
1834 % \node [post grwp=DarkOrchid4,anchor=base east, inner sep=-2pt, fit=(c2)] {};
1835 % \end{scope}
1836 % }
1837 % [, subs={a,b},
1838 % tikz+={%
1839 % \node (s1) [anchor=base east] at (.base east) {\phantom{$\backslash a,b$}};
1840 % \begin{scope}[on background layer]
1841 % \node [post grwp=DarkOrchid4,anchor=base east, inner sep=-2.5pt, fit=(s1)] {};
1842 % \end{scope}
1843 % }
1844 % [[[[][]]]][[[[[]][[[]]]][[]]]]]]]
1845 % \end{tableau}
1846 %
1847 %^^A END sec:anatomy >>>
1848 %
1849 % \section{Options}\label{sec:ops}
1850 %^^A BEGIN sec:ops <<<
1851 % Most configuration uses the standard key/value interface provided by \TikZ{} and extended by \pkg{forest}.
1852 % These are divided into those which determine the overall appearance of the proof as a whole and those with more local effects.
1853 % See \cref{sec:keylists} for advanced customisation.
1854 %
1855 % \subsection{Global Options}\label{subsec:go}
1856 %^^A BEGIN subsec:go <<<
1857 %
1858 % The following options affect the global style of the tree and should typically be set in the tree's preamble if non-default values are desired.
1859 % The default values for the document can be set outside the \env{prooftree} environment using \cs{forestset}\marg{settings}.
1860 % If \emph{only} tableaux will be typeset, a default style can be configured using \pkg{forest}'s \keyname*[fkeylist]{default preamble}.
1861 %
1862 % \changes{v0.7}{}{Implement \pkg{forest} boolean register \texttt{auto move}.
1863 % The main point of this option is to allow automatic moves to be switched off if one teaches students to first apply all available non-branching rules for the tableau as a whole, as opposed to all non-branching rules for the sub-tree.
1864 % The automatic algorithm is consistent with the latter, but not former, approach.
1865 % The algorithm favours compact trees, which are more likely to fit on \pkg{beamer} slides.
1866 % Switching the algorithm off permits users to specify exactly how things should or should not be moved.
1867 % Thanks to Peter Smith for prompting this.}
1868 % \DescribeKeys[fregbool]{auto move, not auto move}\vals{true,false}\AfterLastParam
1869 % \Default{true}
1870 % Determines whether \pkg{prooftrees} will move lines automatically, where possible, to avoid combining different justifications when different branches are treated differently.
1871 % The default is to avoid conflicts automatically where possible.
1872 % Turning this off permits finer-grained control of what gets moved using \keyname[fstyle]{move by}.
1873 % The following are equivalent to the default setting:
1874 % \iffalse
1875 %<*verb>
1876 % \fi
1877 \begin{latexcode}
1878 auto move
1879 auto move=true
1880 \end{latexcode}
1881 % \iffalse
1882 %</verb>
1883 % \fi
1884 % Either of the following will turn auto move off:
1885 % \iffalse
1886 %<*verb>
1887 % \fi
1888 \begin{latexcode}
1889 not auto move
1890 auto move=false
1891 \end{latexcode}
1892 % \iffalse
1893 %</verb>
1894 % \fi
1895 %
1896 % \DescribeKeys[fregbool]{line numbering, not line numbering}\vals{true,false}\AfterLastParam
1897 % \Default{true}
1898 % This determines whether lines should be numbered.
1899 % The default is to number lines.
1900 % The following are equivalent to the default setting:
1901 % \iffalse
1902 %<*verb>
1903 % \fi
1904 \begin{latexcode}
1905 line numbering
1906 line numbering=true
1907 \end{latexcode}
1908 % \iffalse
1909 %</verb>
1910 % \fi
1911 % Either of the following will turn line numbering off:
1912 % \iffalse
1913 %<*verb>
1914 % \fi
1915 \begin{latexcode}
1916 not line numbering
1917 line numbering=false
1918 \end{latexcode}
1919 % \iffalse
1920 %</verb>
1921 % \fi
1922 %
1923 % \DescribeKeys[fregbool]{justifications, not justifications}\vals{true,false}\AfterLastParam
1924 % This determines whether justifications for lines of the proof should be typeset to the right of the tree.
1925 % It is rarely necessary to set this option explicitly as it will be automatically enabled if required.
1926 % The only exception concerns a proof for which a line should be moved but no justifications are specified.
1927 % In this case either of the following should be used to activate the option:
1928 % \iffalse
1929 %<*verb>
1930 % \fi
1931 \begin{latexcode}
1932 justifications
1933 justifications=true
1934 \end{latexcode}
1935 % \iffalse
1936 %</verb>
1937 % \fi
1938 % This is not necessary if \keyname[foptautotoks]{just} is used for any line of the proof.
1939 %
1940 % \DescribeKeys[fregbool]{single branches, not single branches}\vals{true,false}\AfterLastParam
1941 % \Default{false}
1942 % This determines whether inference steps which do not result in at least two branches should draw and explicit branch.
1943 % The default is to not draw single branches explicitly.
1944 % The following are equivalent to the default setting:
1945 % \iffalse
1946 %<*verb>
1947 % \fi
1948 \begin{latexcode}
1949 not single branches
1950 single branches=false
1951 \end{latexcode}
1952 % \iffalse
1953 %</verb>
1954 % \fi
1955 % Either of the following will turn line numbering off:
1956 % \iffalse
1957 %<*verb>
1958 % \fi
1959 \begin{latexcode}
1960 single branches
1961 single branches=true
1962 \end{latexcode}
1963 % \iffalse
1964 %</verb>
1965 % \fi
1966 %
1967 % \subsubsection{Dimensions}\label{subsubsec:go-dims}
1968 % ^^A subsubsec:go-dims <<<
1969 %
1970 % \DescribeKey[fregdim]{line no width}\val{dimension}\AfterLastParam
1971 % The maximum width of line numbers.
1972 % By default, this is set to the width of the formatted line number \keyval{99}.
1973 % \Example{line no width=20pt}
1974 %
1975 % \DescribeKey[fregdim]{just sep}\val{dimension}\AfterLastParam
1976 % \Default{1.5em}
1977 % Amount by which to shift justifications away from the tree.
1978 % A larger value will shift the justifications further to the right, increasing their distance from the tree, while a smaller one will decrease this distance.
1979 % Note that a negative value ought never be given.
1980 % Although this will not cause an error, it may result in strange things happening.
1981 % If you wish to decrease the distance between the tree and the justifications further, please set \keyname[fregdim]{just sep} to zero and use the options provided by \pkg{forest} and/or \TikZ{} to make further negative adjustments.
1982 % \Example{just sep=.5em}
1983 %
1984 % \DescribeKey[fregdim]{line no sep}\val{dimension}\AfterLastParam
1985 % \Default{1.5em}
1986 % Amount by which to shift line numbers away from the tree.
1987 % A larger value will shift the line numbers further to the left, increasing their distance from the tree, while a smaller one will decrease this distance.
1988 % Note that a negative value ought never be given.
1989 % Although this will not cause an error, it may result in strange things happening.
1990 % If you wish to decrease the distance between the tree and the line numbers further, please set \keyname[fregdim]{line no sep} to zero and use the options provided by \pkg{forest} and/or \TikZ{} to make further negative adjustments.
1991 % \Example{line no sep=5pt}
1992 %
1993 % \DescribeKey[fregdim]{close sep}\val{dimension}\AfterLastParam
1994 % \Default{.75\cs{baselineskip}}
1995 % Distance between the symbol marking branch closure and any following annotation.
1996 % If the format of such annotations is changed with \keyname[fregkeylist]{close format}, this dimension may require adjustment.
1997 % \Example{close sep=\cs{baselineskip}}
1998 %
1999 % \DescribeKey[fregdim]{proof tree inner proof width}\val{dimension}\AfterLastParam
2000 % \Default{0pt}
2001 %
2002 % \DescribeKey[fregdim]{proof tree inner proof midpoint}\val{dimension}\AfterLastParam
2003 % \Default{0pt}
2004 % ^^A subsubsec:go-dims >>>
2005 %
2006 % \subsubsection{Line Numbers}\label{subsubsec:go-nos}
2007 % ^^A subsubsec:go-nos <<<
2008 %
2009 % \DescribeKey[fregcount]{line no shift}\val{integer}\AfterLastParam
2010 % \Default{0}
2011 % This value increments or decrements the number used for the first line of the proof.
2012 % By default, line numbering starts at \texttt{1}.
2013 % \Example{line no shift=3} would begin numbering the lines at 4.
2014 %
2015 % \DescribeKey[fstyle]{zero start}
2016 % Start line numbering from 0 rather than 1.
2017 % The following are equivalent:
2018 % \iffalse
2019 %<*verb>
2020 % \fi
2021 \begin{latexcode}
2022 zero start
2023 line no shift=-1
2024 \end{latexcode}
2025 % \iffalse
2026 %</verb>
2027 % \fi
2028 % ^^A subsubsec:go-nos >>>
2029 %
2030 % \subsubsection{Proof Statement}\label{subsubsec:go-prove}
2031 % ^^A subsubsec:go-prove <<<
2032 %
2033 % \DescribeKey[fstyle]{to prove}\val{wff}\AfterLastParam
2034 % Statement of theorem or entailment to be typeset above the proof.
2035 % In many cases, it will be necessary to enclose the statement in curly brackets.
2036 % \Example{to prove=\arg{\cs{sststile}\arg{}\arg{} P \cs{lif} P}}
2037 % By default, the content is expected to be suitable for typesetting in maths mode and should \emph{not}, therefore, be enclosed by dollar signs or equivalent.
2038 % ^^A END subsubsec:go-prove >>>
2039 %
2040 % \subsubsection{Format}\label{subsubsec:go-format}
2041 % ^^A subsubsec:go-format <<<
2042 %
2043 % \DescribeKey[fregtoks]{check with}\val{symbol}\AfterLastParam
2044 % \Default{\cs{ensuremath}\arg{\cs{checkmark}} (\ensuremath{\checkmark})}
2045 % Symbol with which to mark discharged lines.
2046 % \Example{check with=\arg{\cs{text}\arg{\cs{ding}\arg{52}}}}
2047 % Within the tree, \keyname[fstyle]{checked} is used to identify discharged lines.
2048 %
2049 % \DescribeKeys[fregbool]{check right, not check right}\vals{true,false}\AfterLastParam
2050 % \Default{true}
2051 % Determines whether the symbol indicating that a line is discharged should be placed to the right of the \wff{}.
2052 % The alternative is, unsurprisingly, to place it to the left of the \wff{}.
2053 % The following are equivalent to the default setting:
2054 % \iffalse
2055 %<*verb>
2056 % \fi
2057 \begin{latexcode}
2058 check right
2059 check right=true
2060 \end{latexcode}
2061 % \iffalse
2062 %</verb>
2063 % \fi
2064 % \DescribeKeys[fstyle]{check left}%
2065 % Set \keyname[fregbool]{check right}\verb|=false|.
2066 % The following are equivalent ways to place the markers to the left:
2067 % \iffalse
2068 %<*verb>
2069 % \fi
2070 \begin{latexcode}
2071 check right=false
2072 not check right
2073 check left
2074 \end{latexcode}
2075 % \iffalse
2076 %</verb>
2077 % \fi
2078 %
2079 % \DescribeKey[fregtoks]{close with}\val{symbol}\AfterLastParam
2080 % \Default{\cs{ensuremath}\arg{\cs{otimes}} (\ensuremath{\otimes})}
2081 % Symbol with which to close branches.
2082 % \Example{close with=\arg{\cs{ensuremath}\arg{\cs{ast}}}}
2083 % Within the tree, \keyname[fstyle]{close} is used to identify closed branches.
2084 %
2085 % \DescribeKey[fregkeylist]{close with format}\val{key-value list}\AfterLastParam
2086 % Additional \TikZ{} keys to apply to the closure symbol.
2087 % Empty by default.
2088 % \Example{close with format=\arg{red, font=\Huge}}
2089 % To replace a previously set value, rather than adding to it, use \keyname[fregkeylist]{close with format\textquotesingle} rather than \keyname[fregkeylist]{close with format}.
2090 %
2091 % \DescribeKey[fregkeylist]{close format}\val{key-value list}\AfterLastParam
2092 % \Default{font=\cs{scriptsize}}
2093 % Additional \TikZ{} keys to apply to any annotation following closure of a branch.
2094 % \Example{close format=\arg{font=\cs{footnotesize}\cs{sffamily}, text=gray!75}}
2095 % To replace the default value of \keyname[fregkeylist]{close format}, rather than adding to it, use \keyname[fregkeylist]{close format\textquotesingle} rather than \keyname[fregkeylist]{close format}.
2096 % \Example{close format\textquotesingle=\arg{text=red}} will produce red annotations in the default font size, whereas
2097 % \Example{close format=\arg{text=red}} will produce red annotations in \verb|\scriptsize|.
2098 %
2099 % \DescribeKey[fregtoks]{subs with}\val{symbol}\AfterLastParam
2100 % \Default{\cs{ensuremath}\arg{\cs{backslash}} (\ensuremath{\backslash})}
2101 % Symbol to indicate variable substitution.
2102 % \Example{\cs{text}\arg{:}}
2103 % Within the tree, \keyname[fstyle]{subs} is used to indicate variable substitution.
2104 %
2105 % \DescribeKeys[fregbool]{subs right, not subs right}\vals{true,false}\AfterLastParam
2106 % \Default{true}
2107 % Determines whether variable substitution should be indicated to the right of the \wff{}.
2108 % The alternative is, again, to place it to the left of the \wff{}.
2109 % The following are equivalent to the default setting:
2110 % \iffalse
2111 %<*verb>
2112 % \fi
2113 \begin{latexcode}
2114 subs right
2115 subs right=true
2116 \end{latexcode}
2117 % \iffalse
2118 %</verb>
2119 % \fi
2120 % \DescribeKeys[fstyle]{subs left}%
2121 % Set \keyname[fregbool]{subs right}\verb|=false|.
2122 % The following are equivalent ways to place the annotations to the left:
2123 % \iffalse
2124 %<*verb>
2125 % \fi
2126 \begin{latexcode}
2127 subs right=false
2128 not subs right
2129 subs left
2130 \end{latexcode}
2131 % \iffalse
2132 %</verb>
2133 % \fi
2134 %
2135 % \DescribeKeys[fregbool]{just refs left, not just refs left}\vals{true,false}\AfterLastParam
2136 % \Default{true}
2137 % Determines whether line number references should be placed to the left of justifications.
2138 % The alternative is to place them to the right of justifications.
2139 % The following are equivalent to the default setting:
2140 % \iffalse
2141 %<*verb>
2142 % \fi
2143 \begin{latexcode}
2144 just refs left
2145 just refs left=true
2146 \end{latexcode}
2147 % \iffalse
2148 %</verb>
2149 % \fi
2150 % \DescribeKeys[fstyle]{just refs right}%
2151 % Set \keyname[fregbool]{just refs left}\verb|=false|.
2152 % The following are equivalent ways to place the references to the right:
2153 % \iffalse
2154 %<*verb>
2155 % \fi
2156 \begin{latexcode}
2157 just refs left=false
2158 not just refs left
2159 just refs right
2160 \end{latexcode}
2161 % \iffalse
2162 %</verb>
2163 % \fi
2164 % Note that this setting \emph{only affects the placement of line numbers specified using the cross-referencing system} explained in \cref{subsec:lo}.
2165 % Hard-coded line numbers in justifications will be typeset as is.
2166 %
2167 % \DescribeKey[fregkeylist]{just format}\val{key-value list}\AfterLastParam
2168 % Additional \TikZ{} keys to apply to line justifications.
2169 % Empty by default.
2170 % \Example{just format=\arg{red, font=\itshape}}
2171 % To replace a previously set value, rather than adding to it, use \keyname[fregkeylist]{just format\textquotesingle} rather than \keyname[fregkeylist]{just format}.
2172 %
2173 % \DescribeKey[fregkeylist]{line no format}\val{key-value list}\AfterLastParam
2174 % Additional \TikZ{} keys to apply to line numbers.
2175 % Empty by default.
2176 % \Example{line no format=\arg{align=right, text=gray}}
2177 % To replace a previously set value, rather than adding to it, use \keyname[fregkeylist]{line no format\textquotesingle} rather than \keyname[fregkeylist]{line no format}.
2178 % To change the way the number itself is formatted --- to eliminate the dot, for example, or to put the number in brackets --- redefine \cs{linenumberstyle} (see \cref{sec:macros}).
2179 %
2180 % \DescribeKey[fregkeylist]{wff format}\val{key-value list}\AfterLastParam
2181 % Additional \TikZ{} keys to apply to \wff s.
2182 % Empty by default.
2183 % \Example{wff format=\arg{draw=orange}}
2184 % To replace a previously set value, rather than adding to it, use \keyname[fregkeylist]{wff format\textquotesingle} rather than \keyname[fregkeylist]{wff format}.
2185 %
2186 % \DescribeKey[fregkeylist]{proof statement format}\val{key-value list}\AfterLastParam
2187 % Additional \TikZ{} keys to apply to the proof statement.
2188 % Empty by default.
2189 % \Example{proof statement format=\arg{text=gray, draw=gray}}
2190 % To replace a previously set value, rather than adding to it, use \keyname[fregkeylist]{proof statement format\textquotesingle} rather than \keyname[fregkeylist]{proof statement format}.
2191 %
2192 % \DescribeKey[fregautotoks]{highlight format}\val{key-value list}\AfterLastParam
2193 % \Default{draw=gray, rounded corners}
2194 % Additional \TikZ{} keys to apply to highlighted \wff s.
2195 % \Example{highlight format=\arg{text=red}}
2196 % To apply highlighting, use the \keyname[foptbool]{highlight wff}, \keyname[foptbool]{highlight just}, \keyname[foptbool]{highlight line no} and/or \keyname[foptbool]{highlight line} keys (see \cref{subsec:lo}).
2197 %
2198 % \DescribeKey[fregtoks]{merge delimiter}\val{punctuation}\AfterLastParam
2199 % \Default{\cs{text}\arg{; } (\text{; })}
2200 % Punctuation to separate distinct justifications for a single proof line.
2201 % Note that \pkg{prooftrees} will issue a warning if it detects different justifications for a single proof line and will suggest using \keyname[fstyle]{move by} to avoid the need for merging justifications.
2202 % In general, justifications ought not be merged because it is then less clear to which \wff(s) each justification applies.
2203 % Moreover, later references to the proof line will be similarly ambiguous.
2204 % That is, \keyname[fregtoks]{merge delimiter} ought almost never be necessary because it is almost always better to restructure the proof to avoid ambiguity.
2205 %
2206 %^^A END subsubsec:go-format >>>
2207 %^^A END subsec:go >>>
2208 %
2209 % \subsection{Local Options}\label{subsec:lo}
2210 %^^A BEGIN subsec:lo <<<
2211 %
2212 % The following options affect the local structure or appearance of the tree and should typically be passed as options to the relevant node(s) within the tree.
2213 %
2214 % \DescribeKeys[foptbool]{grouped, not grouped}
2215 % Indicate that a line is not an inference.
2216 % When \keyname[fregbool]{single branches} is false, as it is with the default settings, this key is applied automatically and need not be given in the specification of the tree.
2217 % When \keyname[fregbool]{single branches} is true, however, this key must be specified for any line which ought not be treated as an inference.
2218 % \Example{grouped}
2219 %
2220 % \subsubsection{Annotations}\label{subsubsec:lo-annot}
2221 % ^^A subsubsec:lo-annot <<<
2222 %
2223 % \DescribeKey[fstyle]{checked}
2224 % Mark a complex \wff{} as resolved, discharging the line.
2225 % \Example{checked}
2226 % \DescribeKey[fstyle]{checked}\val{name}\AfterLastParam
2227 % Existential elimination, discharge by substituting \meta{name}.
2228 % \Example{checked=a}
2229 %
2230 % \DescribeKey[fstyle]{close}
2231 % Close branch.
2232 % \Example{close}
2233 % \DescribeKey[fstyle]{close}\val{annotation}\AfterLastParam
2234 % \val{annotation prefix}\texttt{:}\meta{references}\AfterLastParam
2235 % Close branch with annotation.
2236 % In the simplest case, \meta{annotation} contains no colon and is typeset simply as it is.
2237 % Any required references to other lines of the proof are assumed to be given explicitly.
2238 % \Example{close=\arg{12,14}}
2239 % If \meta{annotation} includes a colon, \pkg{prooftrees} assumes that it is of the form \meta{annotation prefix}\texttt{:}\meta{references}.
2240 % In this case, the material prior to the colon should include material to be typeset before the line numbers and the material following the colon should consist of one or more references to other lines in the proof.
2241 % In typical cases, no prefix will be required so that the colon will be the first character.
2242 % In case there is a prefix, \pkg{prooftrees} will insert a space prior to the line numbers.
2243 % \meta{references} may consist of either \pkg{forest} names (e.g.~given by \keyname*[fopttoks]{name}\val{name label} and then used as \meta{name label}) or \pkg{forest} relative node names (e.g.~\meta{nodewalk}) or a mixture.
2244 % \Example{close=\arg{:negated conclusion}} where \verb|name=negated conclusion| was used to label an earlier proof line \verb|negated conclusion|.
2245 % If multiple references are given, they should be separated by commas and either \meta{references} or the entire \meta{annotation} must be enclosed in curly brackets, as is usual for \TikZ{} and \pkg{forest} values containing commas.
2246 % \Example{close=\arg{:!c,!uuu}}
2247 %
2248 % \DescribeKey[fstyle]{subs}\val{name}/\meta{names}\AfterLastParam
2249 % Universal instantiation, instantiate with \meta{name} or \meta{names}.
2250 % \Example{subs=\arg{a,b}}
2251 %
2252 % \DescribeKey[foptautotoks]{just}\val{justification}\AfterLastParam
2253 % \val{justification prefix/suffix}\texttt{:}\meta{references}\AfterLastParam
2254 % Justification for inference.
2255 % This is typeset in text mode.
2256 % Hence, mathematical expressions must be enclosed suitably in dollar signs or equivalent.
2257 % In the simplest case, \meta{justification} contains no colon and is typeset simply as it is.
2258 % Any required references to other lines of the proof are assumed to be given explicitly.
2259 % \Example{just=3 \$\cs{lor}\$D}
2260 % If \meta{justification} includes a colon, \pkg{prooftrees} assumes that it is of the form \meta{justification prefix/suffix}\texttt{:}\meta{references}.
2261 % In this case, the material prior to the colon should include material to be typeset before or after the line numbers and the material following the colon should consist of one or more references to other lines in the proof.
2262 % Whether the material prior to the colon is interpreted as a \meta{justification prefix} or a \meta{justification suffix} depends on the value of \keyname[fregbool]{just refs left}.
2263 % \meta{references} may consist of either \pkg{forest} names (e.g.~given by \keyname*[fopttoks]{name}\val{name label} and then used as \meta{name label}) or \pkg{forest} relative node names (e.g.~\meta{nodewalk}) or a mixture.
2264 % If multiple references are given, they should be separated by commas and \meta{references} must be enclosed in curly brackets.
2265 % If \keyname[fregbool]{just refs left} is true, as it is by default, then the appropriate line number(s) will be typeset before the \meta{justification suffix}.
2266 % \Example{just=\$\cs{lnot}\cs{exists}\$\cs{elim}:\arg{!uu,!u}}
2267 % If \keyname[fregbool]{just refs left} is false, then the appropriate line number(s) will be typeset after the \meta{justification prefix}.
2268 % \Example{just=From:bertha}
2269 % ^^A subsubsec:lo-annot >>>
2270 %
2271 % \subsubsection{Moving}\label{subsubsec:lo-move}
2272 % ^^A subsubsec:lo-move <<<
2273 %
2274 % \DescribeKey[fstyle]{move by}\val{positive integer}\AfterLastParam
2275 % Move the content of the current line \meta{positive integer} lines later in the proof.
2276 % If the current line has a justification and the content is moved, the justification will be moved with the line.
2277 % Later lines in the same branch will be moved appropriately, along with their justifications.
2278 % \Example{move by=3}
2279 % Note that, in many cases, \pkg{prooftrees} will automatically move lines later in the proof.
2280 % It does this when it detects a condition in which it expects conflicting justifications may be required for a line while initially parsing the tree.
2281 % Essentially, \pkg{prooftrees} tries to detect cases in which a branch is followed closely by asymmetry in the structure of the branches.
2282 % This happens, for example, when the first branch's first \wff{} is followed by a single \wff{}, while the second branch's first \wff{} is followed by another branch.
2283 % Diagrammatically:
2284 % \begin{center}
2285 % \forestset{declare boolean={go iawn}{1}}
2286 % \begin{forest}
2287 % for root={%
2288 % shape=coordinate,
2289 % for children={%
2290 % shape=coordinate,
2291 % no edge
2292 % },
2293 % },
2294 % for tree={%
2295 % delay={content={\wff}},
2296 % if level=3{WildStrawberry}{},
2297 % if level=2{edge={densely dashed},not go iawn}{},
2298 % parent anchor=children,
2299 % child anchor=parent,
2300 % },
2301 % before computing xy={%
2302 % where={n_children()==1}{%
2303 % for children={%
2304 % if go iawn={%
2305 % l=\baselineskip, no edge,
2306 % }{},
2307 % },
2308 % }{},
2309 % }
2310 % [
2311 % [[[[]][[][]]]]
2312 % [[[[[[,edge={densely dashed}, shape=coordinate, not go iawn, before drawing tree={for tree={fill=none, content={}, typeset node}}[,edge={densely dashed,-{Stealth[]}}, not go iawn]]]]][[][]]]]
2313 % ]
2314 % \end{forest}
2315 % \end{center}
2316 % In this case, \pkg{prooftrees} tries to adjust the tree by moving lines appropriately if required.
2317 %
2318 % However, this detection is merely structural --- \pkg{prooftrees} does not examine the content of the \wff s or justifications for this purpose.
2319 % Nor does it look for slightly more distant structural asymmetries, conflicting justifications in the absence of structural asymmetry or potential conflicts with justifications for lines in other, more distant parallel branches.
2320 % Although it is not that difficult to detect the \emph{need} to move lines in a greater proportion of cases, the problem lies in providing general rules for deciding \emph{how} to resolve such conflicts.
2321 % (Indeed, some such conflicts might be better left unresolved e.g.~to fit a proof on a single Beamer slide.)
2322 % In these cases, a human must tell \pkg{prooftrees} if something should be moved, what should be moved and how far it should be moved.
2323 %
2324 % Because simple cases are automatically detected, it is best to typeset the proof before deciding whether or where to use this option since \pkg{prooftrees} will assume that this option specifies movements which are required \emph{in addition to} those it automatically detects.
2325 % Attempting to move a line ‘too far’ is not advisable.
2326 % \pkg{prooftrees} tries to simply ignore such instructions, but the results are likely to be unpredictable.
2327 %
2328 % Not moving a line far enough --- or failing to move a line at all --- may result in the content of one justification being combined with that of another.
2329 % This happens if \keyname[foptautotoks]{just} is specified more than once for the same proof line with differing content.
2330 % \pkg{prooftrees} \emph{does} examine the content of justifications for \emph{this} purpose.
2331 % When conflicting justifications are detected for the same proof line, the justifications are merged and a warning issued suggesting the use of \keyname[fstyle]{move by}.
2332 % ^^A subsubsec:lo-move >>>
2333 %
2334 % \subsubsection{Format: \wff{}, justification \& line number}\label{subsubsec:lo-format}
2335 % ^^A subsubsec:lo-format <<<
2336 %
2337 % \DescribeKeys[foptbool]{highlight wff, not hightlight wff}
2338 % Highlight \wff{}.
2339 % \Example{highlight wff}
2340 %
2341 % \DescribeKeys[foptbool]{highlight just, not hightlight just}
2342 % Highlight justification.
2343 % \Example{highlight just}
2344 %
2345 % \DescribeKeys[foptbool]{highlight line no, not highlight line no}
2346 % Highlight line number.
2347 % \Example{highlight line no}
2348 %
2349 % \DescribeKeys[foptbool]{highlight line, not highlight line}
2350 % Highlight proof line.
2351 % \Example{highlight line}
2352 %
2353 % \DescribeKey[foptautotoks]{line no options}\val{key-value list}\AfterLastParam
2354 % Additional \TikZ{} keys to apply to the line number for this line.
2355 % \Example{line no options=\arg{blue}}
2356 %
2357 % \DescribeKey[foptautotoks]{just options}\val{key-value list}\AfterLastParam
2358 % Additional \TikZ{} keys to apply to the justification for this line.
2359 % \Example{just options=\arg{draw, font=\cs{bfseries}}}
2360 %
2361 % \DescribeKey[foptautotoks]{wff options}\val{key-value list}\AfterLastParam
2362 % Additional \TikZ{} keys to apply to the \wff{} for this line.
2363 % \Example{wff options=\arg{magenta, draw}}
2364 % Note that this key is provided primarily for symmetry as it is faster to simply give the options directly to \pkg{forest} to pass on to \TikZ{}.
2365 % Unless \keyname[fregkeylist]{wff format} is set to a non-default value, the following are equivalent:
2366 % \iffalse
2367 %<*verb>
2368 % \fi
2369 \begin{latexcode}
2370 wff options={magenta, draw}
2371 magenta, draw
2372 \end{latexcode}
2373 % \iffalse
2374 %</verb>
2375 % \fi
2376 %
2377 % \DescribeKey[foptautotoks]{line options}\val{key-value list}\AfterLastParam
2378 % Additional \TikZ{} keys to apply to this proof line.
2379 % \Example{line options=\arg{draw, rounded corners}}
2380 %
2381 % \DescribeKey[fstyle]{line no override}\val{text}\AfterLastParam
2382 % Substitute \meta{text} for the programmatically-assigned line number.
2383 % \meta{text} will be wrapped by \keyname[macro]{\cs{linenumberstyle}}, so should not be anything which would not make sense in that context.
2384 % \Example{line no override=\arg{n}}
2385 %
2386 % \DescribeKey[fstyle]{no line no}
2387 % Do not typeset a line number for this line.
2388 % Intended for use in trees where \keyname[foptbool]{line numbering} is activated, but some particular line should not have its number typeset.
2389 % Note that the number for the line is still assigned and the node which would otherwise contain that number is still typeset.
2390 % If the next line is automatically numbered, the line numbering will, therefore, ‘jump’, skipping the omitted number.
2391 % \Example{no line no}
2392 %
2393 %^^A END subsubsec:lo-format >>>
2394 %^^A END subsec:lo >>>
2395 %^^A END sec:ops >>>
2396 %
2397 % \section{Macros}\label{sec:macros}
2398 %^^A BEGIN sec:macros <<<
2399 %
2400 % \DescribeMacro{\linenumberstyle}\marg{number}\AfterLastParam
2401 % This macro is responsible for formatting the line numbers.
2402 % The default definition is
2403 % \iffalse
2404 %<*verb>
2405 % \fi
2406 \begin{latexcode}
2407 \newcommand*\linenumberstyle[1]{#1.}
2408 \end{latexcode}
2409 % \iffalse
2410 %</verb>
2411 % \fi
2412 % It may be redefined with \cs{renewcommand*} in the usual way.
2413 % For example, if for some reason you would like bold line numbers, try
2414 % \iffalse
2415 %<*verb>
2416 % \fi
2417 \begin{latexcode}
2418 \renewcommand*\linenumberstyle[1]{\textbf{#1.}}
2419 \end{latexcode}
2420 % \iffalse
2421 %</verb>
2422 % \fi
2423 %
2424 %^^A END sec:macros >>>
2425 %
2426 % \section{Extras}\label{sec:ychwanegol}
2427 % ^^A sec:ychwanegol <<<
2428 %
2429 % \subsection{Steps}\label{subsec:camau}
2430 % ^^A subsec:camau <<<
2431 %
2432 % \DescribeKey[flstep]{every wff}
2433 % A nodewalk long step which visits the proof statement and every \wff{} exactly once in proof line number order.
2434 % This is the default order used for tagging the tableau, but may be used for other purposes.
2435 % As with the next step, this one should be used in \keyname[foptkeylist]{before annotating} or similar.
2436 %
2437 % \DescribeKey[flstep]{wff from proof line no to}\marg{start}\marg{end}\AfterLastParam
2438 % A long step which visits all \wffs{} between proof lines numbered \meta{start} and \marg{end} inclusive.
2439 % \meta{start} and \meta{end} must be proof line numbers in the tableau.
2440 %
2441 % \textbf{This step cannot be used until quite late in the tableau's processing, as it is valid only once line numbers have been assigned.}
2442 % Hence use of this step must always be delayed.
2443 % For example, to colour the \wffs{} in lines 3, 4 and 5 blue, you could add the following to the preamble:
2444 % \iffalse
2445 %<*verb>
2446 % \fi
2447 \begin{latexcode}
2448 before annotating={for nodewalk={wffs from proof line no to={3}{5}}{blue,typeset node}},
2449 \end{latexcode}
2450 % \iffalse
2451 %</verb>
2452 % \fi
2453 % Note the use of \texttt{typeset node} to re-typeset the content.
2454 % Without this option, the colour would have no effect.
2455 % ^^A subsec:camau >>>
2456 %
2457 % \subsection{Fit}\label{subsec:fit}
2458 % ^^A subsec:fit <<<
2459 %
2460 % \DescribeKey[fstyle]{nodewalk to node}\val{name}\marg{nodewalk}\AfterLastParam
2461 % A simple wrapper around \pkg{forest}'s \keyname[fstyle]{fit to}, which is a \TikZ{} key used to create a node fitted around a nodewalk using the \TikZ{} \pkg{fit} library.
2462 % This does not depend on the code used for tableaux and may be used in an ordinary \env{forest} environment.
2463 % (But do not load \pkg{prooftrees} just for this!)
2464 %
2465 % For example, adding the following to a tableau's preamble would create a node named \texttt{a} around all the \wffs{} in lines \texttt{4} to \texttt{7} inclusive.
2466 % Note that this does not include the line number or justification, if used, but only the \wffs{} in the ‘main’ part of the proof.
2467 % \iffalse
2468 %<*verb>
2469 % \fi
2470 \begin{latexcode}
2471 nodewalk to node={a}{wffs from proof line no to={4}{7}},
2472 \end{latexcode}
2473 % \iffalse
2474 %</verb>
2475 % \fi
2476 %
2477 % \DescribeKeys[fstylewrap]{nodewalk node, nodewalk node+, +nodewalk node, nodewalk node\textquotesingle}\val{key-value list}\AfterLastParam
2478 % \Default{inner sep=0pt}
2479 % Style applied to any \TikZ{} nodes created using \keyname[fstyle]{nodewalk to node}.
2480 % The versions with \texttt{+} prepend/append to the existing style, while the \texttt{\textquotesingle} version replaces it.
2481 % \texttt{nodewalk node} is aliased to \texttt{nodewalk node+}.
2482 % \Example{nodewalk node=\{draw=magenta,rounded corners\},}
2483 % This would cause the options \texttt{inner sep=0pt,draw=magenta,rounded corners} to be applied to any nodes created by \keyname[fstyle]{nodewalk to node}.
2484 %
2485 % Note that, despite any similarity in syntax, these are not \pkg{forest} options or registers, but just code wrappers around a simple \TikZ{} style.
2486 % ^^A subsec:fit >>>
2487 % ^^A sec:ychwanegol >>>
2488 %
2489 % \section{Advanced Configuration}\label{sec:keylists}
2490 % ^^A sec:keylists <<<
2491 %
2492 % \pkg{forest}'s default \foptkeylistlabelname{} options may be used to customise tableaux if the provided options prove insufficient.
2493 % In versions 0.9 and earlier, great care must be taken to avoid conflicts with \pkg{prooftrees}'s use of these lists.
2494 % In later versions, internal versions are reserved for \pkg{prooftrees}'s use, enabling \pkg{forest}'s to be used more freely by the user.
2495 % Note that you should still avoid changing the basic structure of the proof.
2496 % For example, deleting extant justifications or line numbers (as opposed to modifying their content or options), would end badly.
2497 %
2498 % See \cref{sec:manylion} for details of the typesetting process.
2499 %
2500 % \DescribeKey[foptkeylist]{before making annotations}\val{key-value list}\AfterLastParam
2501 % This \foptkeylistlabelname{} allows customisation after node positions are first computed by \pkg{forest} but before annotations are created.
2502 % This is sometimes useful.
2503 %
2504 % \DescribeKey[foptkeylist]{before annotating}\val{key-value list}\AfterLastParam
2505 % This \foptkeylistlabelname{} allows customisation after annotations are created, but before they are attached to their corresponding \wffs{}.
2506 % I do not know if this option is useful or not.
2507 %
2508 % The remaining options in this section are applicable only if tagging is active.
2509 %
2510 % \DescribeKey[foptkeylist]{before copying content}\val{key-value list}\AfterLastParam
2511 % Only really useful if tagging is active.
2512 % This \foptkeylistlabelname{} allows the content of a node to be altered before it is copied for tagging.
2513 % Changes made after \keyname[foptkeylist]{proof tree copy content} will affect only the visual representation.
2514 % \Example{P \cs{supset} Q, before copying content=\{content+=\{*\}\}, before typesetting nodes=\{blue\},}
2515 % This would include the \texttt{*} into the content of the node used for tagging, but not the colouration.
2516 %
2517 % \DescribeKey[foptkeylist]{before tagging nodes}\val{key-value list}\AfterLastParam
2518 % Provided by the \pkg{ext.tagging} library.
2519 % Only really useful if tagging is active (see \cref{sec:tag}).
2520 % Allow changes before tagged content for a node is finalised.
2521 % This \foptkeylistlabelname{} is processed before annotations are added to a node's tagged content.
2522 % \Example{P \cs{supset} Q, before tagging nodes=\{alt text'=\{P horseshoe Q\},\},}
2523 % This would replace \verb|P \supset Q| with \texttt{P horseshoe Q} in the content used for tagging\footnote{%
2524 % This is not the best way to handle the horseshoe, however.
2525 % It would be better to define a dedicated macro to produce the symbol such as \cs{horseshoe} and assign an appropriate ‘output intent’, regardless of whether you choose to override the content in tagging.%
2526 % }.
2527 %
2528 % \DescribeKey[foptkeylist]{before collating tags}\val{key-value list}\AfterLastParam
2529 % Provided by the \pkg{ext.tagging} library.
2530 % Only really useful if tagging is active (see \cref{sec:tag}).
2531 % This \foptkeylistlabelname{} is processed after annotations are added to a node's tagged content, but before that content is used for tagging.
2532 % \Example{P \cs{supset} Q, just=Ass, before collating tags=\{alt text'=\{P horseshoe Q\},\}}
2533 % This would prevent \texttt{Ass} from being used in the tagged content.
2534 % Note that it would also lose any line number, so this should be added explicitly if required.
2535 %
2536 %^^A END sec:keylists >>>
2537 %
2538 % \section{Memoization}\label{sec:memoize}
2539 %^^A BEGIN sec:memoize <<<
2540 %
2541 % Tableaux created by \pkg{prooftrees} cannot, in general, be externalised with \TikZ's \keyname[pkg]{\pkg{external}} library.
2542 % Since \keyname[pkg]{\pkg{pgf}}/\TikZ{}, in general, and \pkg{prooftrees}, in particular, can be rather slow to compile, this is a serious issue.
2543 % If you only have a two or three small tableaux, the compilation time will be negligible.
2544 % But if you have large, complex proofs or many smaller ones, compilation time will quickly become excessive.
2545 %
2546 % Version 0.9 does not cure the disease, but it does offer an extremely effective remedy for the condition.
2547 % While it does not make \pkg{prooftrees} any faster, it supports the \keyname[pkg]{\pkg{memoize}} package developed by \pkg{forest}'s author, Sašo Živanović \autocite*{saso-memoize-manual}.
2548 % Memoization is faster, more secure, more robust and easier to use than \TikZ's externalisation.
2549 % \begin{description}
2550 % \item[It is faster.] It does not require separate compilations for each memoized object, so it is comparatively fast even when memoizing.
2551 % \item[It is more secure.] It requires only restricted shell-escape, which almost all \TeX{} installations enable by default, so it is considerably more secure and can be utilised even where shell-escape is disabled.
2552 % \item[It is more robust.] It can successfully memoize code which defeats all ordinary mortals' attempts to externalize with the older \TikZ{} library.
2553 % \item[It is easier to use.] It requires less configuration and less intervention.
2554 % For example, it detects problematic code and aborts memoization automatically in many cases in which \TikZ's \pkg{external} would either cause a compilation error or silently produce nonsense output, forcing the user to manually disable the process for relevant code.
2555 % \item[It is compatible with tagging.] The library used for tagging ensures that tagging data is not lost when \pkg{forest} trees are externalised with \pkg{memoize}.
2556 % \end{description}
2557 %
2558 % There is always a ‘but’, but this is a pretty small ‘but’ as ‘but’s go.
2559 % \begin{description}
2560 % \item[But installation requires slightly more work.] To reap the full benefits, you want to use either the \texttt{perl} or the \texttt{python} ‘extraction’ method\footnote{%
2561 % A better \texttt{lua}-based solution is currently under development.
2562 % Once this is available, no additional software will be required, at least for users of \TeX{} Live.%
2563 % }.
2564 % There is a third method, which does not require any special installation, but this lacks several of the advantages explained above and is not recommended.
2565 %
2566 % If you use \TeX{} Live, you have \texttt{perl} already, but you may need to install a couple of libraries.
2567 % \texttt{python} is not a prerequisite for \TeX{} Live but, if you happen to have it installed, you will probably only need an additional library to use this method.
2568 %
2569 % See \citetitle{saso-memoize-manual} \autocite{saso-memoize-manual} for further details.
2570 % \end{description}
2571 %
2572 % Once you have the prerequisites setup, all you need do is load \pkg{memoize} \emph{before} \pkg{prooftrees}.
2573 %
2574 % \iffalse
2575 %<*verb>
2576 % \fi
2577 \begin{latexcode}
2578 \usepackage[extraction method=perl]{memoize}% or python
2579 \usepackage{memoize-ext}
2580 \usepackage{prooftrees}
2581 \end{latexcode}
2582 % \iffalse
2583 %</verb>
2584 % \fi
2585 %
2586 % After a single compilation, your document will have expanded to include extra pages.
2587 % At this point, it will look pretty weird.
2588 % After the next compilation, your document will return to its normal self, the only difference being the speed with which it does so as all your memoized tableaux will simply be included, as opposed to recompiled.
2589 % Only when you alter the code for a tableau, delete the generated files, disable memoization or explicitly request it will the proof be recompiled.
2590 %
2591 % Memoization is compatible with both \pkg{prooftrees}'s cross-referencing system and \LaTeXe's cross-references, but the latter require an additional compilation.
2592 % In general, if a document element takes $n$ compilations to stabilise, it will take $n+1$ compilations to complete the memoization process.
2593 % See \citetitle{saso-memoize-manual} \autocite{saso-memoize-manual} for details.
2594 %
2595 %^^A END sec:memoize >>>
2596 %
2597 % \section{Tagging}\label{sec:tag}
2598 % ^^A sec:tag <<<
2599 %
2600 % The infrastructure for tagging is provided by the \pkg{ext.tagging} and \pkg{ext.utils} \pkg{forest} libraries, which are part of \pkg{forest-ext}\footcite{cfr-forest-ext}.
2601 % \textbf{These libraries are required regardless of whether tagging is used.}
2602 %
2603 % If \pkg{memoize} is loaded (\cref{sec:memoize}), \pkg{ext.tagging} uses the framework provided by \pkg{memoize-ext}\footcite{cfr-memoize-ext}.
2604 % \textbf{This package is required if \pkg{memoize} is used, regardless of whether tagging is enabled.}
2605 %
2606 % Tagging is \emph{highly experimental} and the implementation will certainly change, as well, possibly, as the interface.
2607 % Changes to the public interface will be avoided where reasonable.
2608 % If documented interfaces do change, compatibility options will be provided if possible.
2609 %
2610 % By default, tagging should largely ‘just work’ for straightforward tableaux.
2611 % If tagging is active, an ‘alternative text’ (\texttt{alt text}) is automatically generated based on the tableau content\footnote{%
2612 % Whether this is a useful way to tag them I do not know.
2613 % Some input from users of tableaux with screen-reading software is required.
2614 % Contributions, suggestions or feedback seem exceedingly unlikely, but would be appreciated.%
2615 % }.
2616 % The default aim is to tag tableaux \emph{syntactically}, as opposed to semantically, in accordance with typical usage in logic\footnote{%
2617 % This might seem at odds with the \LaTeX{} Project's efforts to tag mathematical content which, as I understand it, is a \emph{semantic} project.
2618 % But the tension here is, of course, merely apparent, since the intended semantic content of tableaux is syntactic.
2619 % In the \LaTeX{} Project's sense, this package tries to provide \emph{semantic} tagging.
2620 % It just so happens that the relevant semantic content is concerned with \emph{syntactic}, as opposed to \emph{semantic}, methods.%
2621 % }.
2622 % If your document is not written in English, you will need to configure a few global options to provide translations.
2623 % See \cref{subsec:tag-go}.
2624 %
2625 % See also \cref{sec:keylists}.
2626
2627 % Most of the few options are global and fairly straightforward.
2628 %
2629 % \subsection{Global Tagging Options}\label{subsec:tag-go}
2630 % ^^A subsec:tag-go <<<
2631 %
2632 % \DescribeKey[fregbool]{tag}\vals{true,false}\AfterLastParam
2633 % \textbf{\emph{Automatically set according to current status of tagging.
2634 % Alter at your peril!}}
2635 % Whether tagging is active or not.
2636 % \textbf{This register should not be set by the user\footnote{%
2637 % Note that setting this false will not result in an untagged tableau.
2638 % Nor will it allow the user to tag the tableau manually.
2639 % If you want to do either of those, see \pkg{tagpdf} (for the former) or \pkg{ext.tagging} (for the latter).%
2640 % }!}
2641 % However, it may be safely read to conditionalise code.
2642 %
2643 % \DescribeKey[fregtoks]{setup plug}\texttt{tableaux/alt}\AfterLastParam
2644 % \DescribeKey[fregtoks]{tag plug}\texttt{alt}\AfterLastParam
2645 % \Default{setup plug=tableaux/alt,tag plug=alt}
2646 % Note these keys are provided by \pkg{ext.tagging}.
2647 %
2648 % The only choice with package-specific support is currently the \texttt{tableaux/alt} \texttt{setup plug}, which uses the library's default \texttt{alt} option for \texttt{tag plug}.
2649 % It provides a customised configuration for \texttt{tag nodes} which constructs an \texttt{alt text} for all \emph{wffs} and the \texttt{to prove} statement, if present.
2650 % It also modifies the order in which tags are collated.
2651 % Use of \pkg{latex-lab}'s plugs for \pkg{tikz} will yield chaotic results at best, but more likely invalid structures or compilation errors.
2652 % If you need something other than the current \texttt{tableaux/alt} and the options provided by the \pkg{ext.tagging} library do not suffice, file a feature request.
2653 %
2654 % \DescribeKey[fregtoks]{tag check with}\val{text}\AfterLastParam
2655 % \Default{discharged}
2656 % Text replacement for \keyname[fregtoks]{check with} for tagging.
2657 %
2658 % \DescribeKey[fregtoks]{tag close with}\val{text}\AfterLastParam
2659 % \Default{closed}
2660 % Text replacement for \keyname[fregtoks]{close with} for tagging.
2661 %
2662 % \DescribeKey[fregtoks]{tag subs with}\val{text}\AfterLastParam
2663 % \Default{substituted}
2664 % Text replacement for \keyname[fregtoks]{subs with} for tagging.
2665 %
2666 % \DescribeKey[fregtoks]{tag to prove}\val{text}\AfterLastParam
2667 % \Default{To prove: }
2668 % Text to prepend to the proof statement when tagging.
2669 %
2670 % For example, here's a possible setup for Welsh\footnote{%
2671 % I do not know if there is an extant terminology for logic.
2672 % If you know of one, I'd be grateful if you could file a feature request letting me know.%
2673 % }.
2674 % \iffalse
2675 %<*verb>
2676 % \fi
2677 \begin{latexcode}
2678 \forestset{%
2679 tag check with={cyflawnedig},
2680 tag close with={caead},
2681 tag sub with={enghreifftiwyd},
2682 tag to prove={Profir: },
2683 }
2684 \end{latexcode}
2685 % \iffalse
2686 %</verb>
2687 % \fi
2688 % ^^A subsec:tag-go >>>
2689 %
2690 % \subsection{Local Tagging Options}\label{subsec:tag-lo}
2691 % ^^A subsec:tag-lo <<<
2692 %
2693 % \DescribeKey[fopttoks]{alt text}\val{text}\AfterLastParam
2694 % Provided by \pkg{ext.tagging}.
2695 % \texttt{alt text} stores the content used to tag the proof statement and each \wff{} in the tableau.
2696 % \pkg{prooftrees} creates this content automatically from either the proof statement given to {to prove} or the content of the \wff{}.
2697 % Additional content is appended or prepended when \keyname[fstyle]{checked}, \keyname[fstyle]{close}, \keyname[fstyle]{subs} and/or \keyname[foptautotoks]{just} are used.
2698 % If applicable, a line number is also added.
2699 %
2700 % The content used for tagging the node may be supplemented or entirely overridden by the user at any stage, but direct use of the option must be delayed in order for the changes to be effective.
2701 % \Example{P \cs{equiv} Q, just=Ass, before collating tags=\{alt text\textquotesingle=\{P iff Q (Premise)\},\}, checked,}
2702 % This would use precisely the specified content when tagging i.e.~the checked marker, justification and any line number would be omitted.
2703 % \Example{P \cs{equiv} Q, just=Ass, before tagging nodes=\{alt text\textquotesingle=\{P iff Q (Premise)\},\}, checked,}
2704 % The would use the specified content, together with the line number and justification, but would omit the checked marker.
2705 %
2706 % See \cref{sec:keylists,sec:manylion}.
2707 % ^^A subsec:tag-lo >>>
2708 % ^^A sec:tag >>>
2709 %
2710 % \section{Typesetting Process}\label{sec:manylion}
2711 % ^^A sec:manylion <<<
2712 %
2713 % This section provides a high-level description of the process \env{prooftree}/\env{tableau} uses to construct and typeset a proof.
2714 % Further details can be found in the code documentation.
2715 %
2716 % \textbf{Most uses of \pkg{prooftrees} do not require knowledge --- or, even, awareness of --- the details described in this section.}
2717 % Indeed, earlier versions of the documentation did not include this section at all.
2718 % The details may be of use to users who wish to modify tableaux in ways unsupported by the features documented in previous sections.
2719 %
2720 % \begin{enumerate}
2721 % \item Initialise tagging, if applicable.
2722 % This is largely a matter of setting \pkg{latex-lab}'s plug for \pkg{tikz} to \texttt{noop}, setting some options for \pkg{ext.tagging} and resetting the \emph{tagging keylist} \texttt{tag nodes}.
2723 % This is necessary because a \pkg{forest} tree involves \emph{many} uses of \env{tikzpicture} and the default tagging can result in erroneous structures and/or compilation errors and produces at best chaotic \texttt{marked content}.
2724 % \item\label{enum:stages} Starts \env{forest} with a custom definition of \keyname[foptkeylist]{stages}.
2725 % \keyname[fstyle]{tag tree stage} executes the code actually responsible for tagging the proof.
2726 %
2727 % Any \foptkeylistshortname{} described as ‘Does nothing by default.’ is explicitly intended for users to customise the process.
2728 %
2729 % Any key marked ‘\pkg{forest}’ is provided by \pkg{forest} and used unaltered.
2730 %
2731 % Any key marked ‘\pkg{ext.tagging}’ is provided by \pkg{forest-ext} and used unaltered.
2732 %
2733 % Any key marked ‘\emph{Internal}’ is used by this package in constructing and/or tagging the tableau.
2734 % Like those used by \pkg{ext.tagging} and \pkg{forest} itself, you are both welcome to redefine these and welcome to keep the itsy-bitsy teeny-weeny little pieces if stuff breaks.
2735 %
2736 % Note that only those intended explicitly for user use \emph{by this package} are marked as ‘Does nothing by default.’, but several other such items are similarly provided by \pkg{forest} and \pkg{ext.tagging}\footnote{%
2737 % Anything \emph{beginning} \texttt{before} is probably OK, but you should check the other package's documentation to be sure.%
2738 % }
2739 %
2740 % See \cref{sec:keylists}, \textcite{saso-forest} and \pkg{forest-ext} for details.
2741 %
2742 % Here is a (long!) step-by-step description of \pkg{prooftrees}'s redefinition of \texttt{stages}.
2743 % \begin{enumerate}[label={Stage \arabic*},align=left,leftmargin=*,widest=99]
2744 % \item Execute the standard \pkg{forest} parsing for the \keyname[fregkeylist]{default preamble} and \keyname[fregkeylist]{preamble} with
2745 % \pkg{forest}.
2746 % \iffalse
2747 %<*verb>
2748 % \fi
2749 \begin{latexcode}
2750 for root'={%
2751 process keylist register=default preamble,
2752 process keylist register=preamble,
2753 },
2754 \end{latexcode}
2755 % \iffalse
2756 %</verb>
2757 % \fi
2758 % \item Process the \pkg{forest} \foptkeylistshortname{} \keyname[foptkeylist]{given options}.
2759 % \pkg{forest}.
2760 % \item Process the \foptkeylistshortname{} \keyname[foptkeylist]{before copying content}.
2761 % Does nothing by default.
2762 % \item Process the \foptkeylistshortname{} \keyname[ftagkeylist]{proof tree copy content}.
2763 % \emph{Internal.}
2764 % \item Process the \foptkeylistshortname{} \keyname[foptkeylist]{proof tree after copying content}.
2765 % Does nothing by default.
2766 % \item Process the \foptkeylistshortname{} \keyname[foptkeylist]{proof tree before typesetting nodes}.
2767 % \emph{Internal.}
2768 % \item Process the \pkg{forest} \foptkeylistshortname{} \keyname[foptkeylist]{before typesetting nodes}.
2769 % \pkg{forest}.
2770 % \item Process the \foptkeylistshortname{} \keyname[foptkeylist]{proof tree ffurf}.
2771 % \emph{Internal.}
2772 % \item Process the \foptkeylistshortname{} \keyname[foptkeylist]{proof tree symud awto}.
2773 % \emph{Internal.}
2774 % \item Execute \pkg{forest}'s \keyname[fstyle]{typeset nodes stage}.
2775 % \pkg{forest}.
2776 % \item Process the \foptkeylistshortname{} \keyname[foptkeylist]{proof tree before packing}.
2777 % \emph{Internal.}
2778 % \item Process the \pkg{forest} \foptkeylistshortname{} \keyname[foptkeylist]{before packing}.
2779 % \pkg{forest}.
2780 % \item Execute \pkg{forest}'s \keyname[fstyle]{pack stage}.
2781 % \pkg{forest}.
2782 % \item Process the \foptkeylistshortname{} \keyname[foptkeylist]{proof tree before computing xy}.
2783 % \emph{Internal.}
2784 % \item Process the \pkg{forest} \foptkeylistshortname{} \keyname[foptkeylist]{before computing xy}.
2785 % \pkg{forest}.
2786 % \item Execute \pkg{forest}'s \keyname[fstyle]{compute xy stage}.
2787 % \pkg{forest}.
2788 % \item Process the \foptkeylistshortname{} \keyname[foptkeylist]{before making annotations}.
2789 % Does nothing by default.
2790 % \item Process the \foptkeylistshortname{} \keyname[foptkeylist]{proof tree creu nodiadau}.
2791 % \emph{Internal.}
2792 % \item Process the \foptkeylistshortname{} \keyname[foptkeylist]{before annotating}.
2793 % Does nothing by default.
2794 % \item Process the \foptkeylistshortname{} \keyname[foptkeylist]{proof tree nodiadau}.
2795 % \emph{Internal.}
2796 % \item Process the \foptkeylistshortname{} \keyname[foptkeylist]{proof tree after annotations}.
2797 % \emph{Internal.}
2798 % \item Process the \pkg{ext.tagging} \foptkeylistshortname{} \keyname[foptkeylist]{before tagging nodes}.
2799 % \pkg{ext.tagging}.
2800 % \item Process the \pkg{ext.tagging} \foptkeylistshortname{} \keyname[ftagkeylist]{tag nodes}.
2801 % \pkg{ext.tagging}.
2802 % \item Process the \pkg{ext.tagging} \foptkeylistshortname{} \keyname[foptkeylist]{before collating tags}.
2803 % \pkg{ext.tagging}.
2804 % \item Process the \pkg{ext.tagging} \foptkeylistshortname{} \keyname[ftagkeylist]{collate tags}.
2805 % \pkg{ext.tagging}.
2806 % \item Process the \pkg{ext.tagging} \foptkeylistshortname{} \keyname[foptkeylist]{before tagging tree}.
2807 % \pkg{ext.tagging}.
2808 % \item Execute \pkg{ext.tagging}'s \keyname[fstyle]{tag tree stage}.
2809 % \pkg{ext.tagging}.
2810 % \item Process the \pkg{forest} \foptkeylistshortname{} \keyname[foptkeylist]{before drawing tree}.
2811 % \pkg{forest}.
2812 % \item Execute \pkg{forest}'s \keyname[fstyle]{draw tree stage}.
2813 % \pkg{forest}.
2814 % \end{enumerate}
2815 % \item Applies \fstyleshortname{} \keyname[fstyle]{proof tree}.
2816 % \textbf{This style should NOT be used directly.}
2817 % \item Executes the content of \env{prooftree}/\env{tableau}'s mandatory argument.
2818 % \item Creates a root node with \keyname[fopttoks]{name}\val{proof statement}.
2819 % \item Integrates the contents of the \env{prooftree}/\env{tableau}.
2820 % \end{enumerate}
2821 %
2822 % Note that \pkg{prooftrees} sets \pkg{forest}'s \keyname[fbracketkey]{action character} to \verb|@| before defining the \env{prooftree}/\env{tableau} environment.
2823 % ^^A sec:manylion >>>
2824 %
2825 % \section{Compatibility}\label{sec:compat}
2826 %^^A BEGIN sec:compat <<<
2827 %
2828 % Versions of \pkg{prooftrees} prior to 0.5 are incompatible with \pkg{bussproofs}, which also defines a \env{prooftree} environment.
2829 % Version 0.6 is compatible with \env{bussproofs} provided
2830 % \begin{description}[font=\itshape]
2831 % \item[either] \pkg{bussproofs} is loaded \emph{before} \pkg{prooftrees}
2832 % \item[or] \pkg{prooftrees} is loaded with option \option{tableaux} (see \cref{sec:llwytho}).
2833 % \end{description}
2834 % In either case, \pkg{prooftrees} will \emph{not} define a \env{prooftree} environment, but will instead define \env{tableau}.
2835 % This allows you to use \env{tableau} for \pkg{prooftrees} trees and \env{prooftree} for \pkg{bussproofs} trees.
2836 %
2837 %^^A END sec:compat >>>
2838 %
2839 % \changes{v0.8}{}{Documentation now loads \pkg{enumitem}, since it depended on it already anyway and specifies \pkg{doc2} in options for \cls{ltxdoc} as the code is incompatible with the current version.}
2840 %
2841 % \changes{v0.9.2}{2026-01-19}{\pkg{forest-ext} is now required, since two of its libraries provide a framework for tagging \pkg{forest} trees.
2842 % This applies even if tagging is not used.}
2843 %
2844 % \changes{v0.9.3}{0000-00-00}{\pkg{memoize-ext} is now required if \pkg{memoize} is loaded, since \pkg{forest-ext} now uses its framework for tagging \pkg{forest} trees.
2845 % This applies even if tagging is not used.}
2846 %
2847 % \printbibliography
2848 %
2849 % ^^A \loadgeometry{safonol}%
2850 % ^^A \fancyheadoffset[lh]{0pt}%
2851 %
2852 % \changes{v0.9.3}{0000-00-00}{More robust support for tagging memoized tableaux and changes for compatibility with changes in \pkg{forest-ext}.}
2853 % \changes{v0.9.2}{2026-01-19}{Experimental support for tagging based on \pkg{forest-ext}.}
2854 % \changes{v0.9.1}{2025-08-20}{Switch to \pkg{docstrip}.}
2855 % \changes{v0.9}{0001-01-01}{Use \cs{NewDocumentEnvironment}, removing direct dependency on \pkg{environ}.}
2856 % \changes{v0.8}{0001-01-01}{Add previously unnoticed dependency on \pkg{amstext}.}
2857 % \changes{v0.8}{0001-01-01}{Attempt to fix straying closure symbols evident in documentation and a \TeX\ SE question (\url{https://tex.stackexchange.com/q/619314/}).}
2858 % \changes{v0.7}{0001-01-01}{Fix bug reported at \href{https://tex.stackexchange.com/q/479263/39222}{tex.stackexchange.com/q/479263/39222}.}
2859 % \changes{v0.5}{0001-01-01}{Significant re-implementation leveraging the new argument processing facilities in \pkg{forest} 2.1.
2860 % This significantly improves performance as the code is executed much faster than the previous \pkg{pgfmath} implementation.}
2861 % \changes{v0.41}{0001-01-01}{Update for compatibility with \pkg{forest} 2.1.}
2862 % \changes{v0.4}{0001-01-01}{Bug fix release:
2863 % \texttt{forest} count register \texttt{line no shift} was broken;
2864 % in some cases, an edge was drawn where no edge belonged.%
2865 % }
2866 % \changes{v0.3}{0001-01-01}{First CTAN release.}
2867 %
2868 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2869 % \StopEventually{%^^A \MaybeStop is v3
2870 % \def\glossaryname{Change History}%^^A
2871 % \PrintChanges
2872 % \PrintIndex
2873 % }
2874 %
2875 % \section{Implementation}\label{sec:imp}
2876 %
2877 % ^^A if I'd known what doctools did, I'd never have used it in the first place
2878 % ^^A \let\environment\docenvironment
2879 % ^^A \let\endenvironment\enddocenvironment
2880 % \let\macrocode\docmacrocode
2881 % \let\endmacrocode\enddocmacrocode
2882 % \let\macro\docmacro
2883 % \let\endmacro\enddocmacro
2884 %
2885 %^^A sty guards <<<
2886 %<*sty>
2887 %<@@=tableaux>
2888 % \begin{macrocode}
2889 \NeedsTeXFormat{LaTeX2e}
2890 \RequirePackage{svn-prov}
2891 %<!debug>\ProvidesPackageSVN[\filebase.sty]{$Id: prooftrees.dtx 11666 2026-02-21 01:53:54Z cfrees $}[v0.9.3 \revinfo]
2892 %<debug>\ProvidesPackageSVN[\filebase-debug.sty]{$Id: prooftrees.dtx 11666 2026-02-21 01:53:54Z cfrees $}[v0.9.3 \revinfo\ (debugging)]
2893 \DefineFileInfoSVN
2894 % \end{macrocode}
2895 % \iffalse
2896 % ^^A Paid â defnyddio \GetFileInfoSVN*/\GetFileInfoSVN{} yn y fan hon!!
2897 % \fi
2898 % \begin{macro}{\prooftrees@enw}
2899 % Define \cs{prooftrees@enw} to hold the name of the environment.
2900 %
2901 % Default is to name the environment prooftree, this ensures backwards compatibility.
2902 % \begin{macrocode}
2903 \newcommand*\prooftrees@enw{prooftree}
2904 % \end{macrocode}
2905 % \end{macro}
2906 % ^^A \begin{opt}{tableaux,tableau}
2907 % Allow users to change the name to tableau using tableaux.
2908 % \begin{macrocode}
2909 \DeclareOption{tableaux}{\renewcommand*\prooftrees@enw{tableau}}
2910 % \end{macrocode}
2911 % Just in case.
2912 % \begin{macrocode}
2913 \DeclareOption{tableau}{\renewcommand*\prooftrees@enw{tableau}}
2914 % \end{macrocode}
2915 % ^^A \end{opt}
2916 % \begin{macrocode}
2917 \DeclareOption*{\PassOptionsToPackage{\CurrentOption}{forest}}
2918 % \end{macrocode}
2919 % If \cs{prooftree} is not yet defined, set the name to \texttt{prooftree}; otherwise, use \texttt{tableau} to avoid conflict with \pkg{bussproofs} (which uses \texttt{prooftree} rather than \texttt{bussproof} as one might expect).
2920 %
2921 % Is there some reason I didn't use a hook here? obviously hooks weren't a thing, but \cs{AtBeginDocument}?
2922 % Oh, I guess I can't \dots.
2923 % \begin{macrocode}
2924 \ifcsname prooftree\endcsname
2925 \renewcommand*\prooftrees@enw{tableau}%
2926 \else
2927 \renewcommand*\prooftrees@enw{prooftree}%
2928 \fi
2929 % \end{macrocode}
2930 % ^^A \ifundef\prooftree{\renewcommand*\prooftrees@enw{prooftree}}{\renewcommand*\prooftrees@enw{tableau}}
2931 % Let users override the default \texttt{prooftree} in case they need to load \pkg{bussproofs} later.
2932 % \begin{macrocode}
2933 \ProcessOptions
2934 % \end{macrocode}
2935 % \changes{v0.9.1}{2025-08-27}{Don't load \pkg{amssymb} or \pkg{amstext} unconditionally.}
2936 % Load \pkg{forest}, but load maths packages later only if needed.
2937 % \changes{v0.9.2}{2026-01-19}{Load the \pkg{ext.tagging} library.}
2938 % \changes{v0.9.3}{2026-02-21}{Load the \pkg{memoize-ext} if \pkg{memoize} is loaded.}
2939 % We load \pkg{memoize-ext} and \pkg{forest-ext} because there is a chance it is early enough.
2940 % Once we load \pkg{forest}, it is too late.
2941 % This is required for compatibility with tagging: the support depends on hook rules to override \pkg{latex-lab}'s code.
2942 % \begin{macrocode}
2943 \@ifpackageloaded{memoize}{%
2944 \@ifpackageloaded{memoize-ext}{}{%
2945 \@ifpackageloaded{memoize-ext-debug}{}{%
2946 \IfFileExists{memoize-ext.sty}{%
2947 %<!debug> \RequirePackage{memoize-ext}%
2948 %<debug> \RequirePackage{memoize-ext-debug}%
2949 }{%
2950 \PackageError{prooftrees}{This version of prooftrees requires the
2951 package memoize-ext if memoize is loaded.%
2952 }{%
2953 forest-ext now requires memoize-ext.
2954 You should not receive this version of prooftrees from a distribution
2955 unless it also provides memoize-ext and a current forest-ext.%
2956 }%
2957 }%
2958 }%
2959 }%
2960 }{}
2961 \RequirePackage{forest}[2016/12/04]
2962 \@ifpackageloaded{forest-lib-ext.tagging}{}{%
2963 \@ifpackageloaded{forest-lib-ext.tagging-debug}{}{%
2964 %<!debug> \IfFileExists{forest-lib-ext.tagging.sty}{%
2965 %<!debug> \useforestlibrary*{ext.tagging}%
2966 %<debug> \IfFileExists{forest-lib-ext.tagging-debug.sty}{%
2967 %<debug> \useforestlibrary*{ext.tagging-debug}%
2968 }{%
2969 \PackageError{prooftrees}{This version of prooftrees requires the
2970 forest library ext.tagging, part of the forest-ext package.%
2971 }{%
2972 This version of prooftrees will not be pushed to CTAN until TeX
2973 Live includes forest-ext. Hence, you should see this error only if
2974 you installed the updated prooftrees manually or your TeX
2975 distribution updated prooftrees without including the new dependency.
2976 In the former case, please don't do that. In the latter case, please
2977 report the problem using your distribution's bug tracker.%
2978 }%
2979 }%
2980 }%
2981 }
2982 % \end{macrocode}
2983 % \begin{macro}{\linenumberstyle}
2984 % \mbox{}
2985 % \begin{macrocode}
2986 \newcommand*\linenumberstyle[1]{#1.}
2987 % \end{macrocode}
2988 % \end{macro}
2989 % \changes{v0.9.1}{2025-08-25}{Added for tagging experiments.}
2990 % \changes{v0.9.2}{2026-01-19}{Remove duplicate toks \cs{prooftrees@tableau@toks}.}
2991 %
2992 % Currently, keys starting \texttt{proof tree} or \texttt{tableau} and macros starting \texttt{prooftree} or \texttt{prooftree@} are intended for internal use only.
2993 %
2994 % This does not apply to the environment \texttt{prooftree}.
2995 %
2996 % Other keys and macros are intended for use in documents.
2997 %
2998 % \textbf{In particular, the style \texttt{proof tree} is **NOT** intended to be used directly by the user and its direct use is **ABSOLUTELY NOT SUPPORTED IN ANY WAY, SHAPE OR FORM**; it is intended only for implicit use when the \texttt{prooftree} environment calls it.}
2999 %
3000 % Don't use \texttt{@} in register/option names - the documentation is lying when it says non-alphanumerics will be converted to underscores when forming pgfmath functions ;)
3001 % \begin{macrocode}
3002 \forestset{%
3003 % \end{macrocode}
3004 % Line numbers
3005 % \begin{macrocode}
3006 declare boolean register={line numbering},
3007 % \end{macrocode}
3008 % Default is for line numbers
3009 % \begin{macrocode}
3010 line numbering,
3011 % \end{macrocode}
3012 % Line justifications
3013 % \begin{macrocode}
3014 declare boolean register={justifications},
3015 % \end{macrocode}
3016 % Default is for no line justifications (b/c there's no point in enabling this if the user doesn't specify any content)
3017 % \begin{macrocode}
3018 not justifications,
3019 % \end{macrocode}
3020 % Single branches: explicitly drawn branches and a normal level distance between lone children and their parents
3021 % \begin{macrocode}
3022 declare boolean register={single branches},
3023 % \end{macrocode}
3024 % Default is for lone children to be grouped with their parents
3025 % \begin{macrocode}
3026 not single branches,
3027 % \end{macrocode}
3028 % \begin{macrocode}
3029 declare boolean register={auto move},% ble mae'n bosibl, symud pethau'n awtomatig
3030 % \end{macrocode}
3031 % Default: symud yn awtomatig
3032 % \begin{macrocode}
3033 auto move,
3034 % \end{macrocode}
3035 % Default will be set to the width of 99 wrapped in the line numbering style
3036 % \begin{macrocode}
3037 declare dimen register={line no width},
3038 % \end{macrocode}
3039 % Fallback default is 0pt
3040 % \begin{macrocode}
3041 line no width'=0pt,
3042 % \end{macrocode}
3043 % Amount by which to shift justifications away from the main tree
3044 % \begin{macrocode}
3045 declare dimen register={just sep},
3046 % \end{macrocode}
3047 % Default is 1.5em
3048 % \begin{macrocode}
3049 just sep'=1.5em,
3050 % \end{macrocode}
3051 % Distance of justifications from centre of inner tree; overrides just sep
3052 % \begin{macrocode}
3053 declare dimen register={just dist},
3054 just dist'=0pt,
3055 % \end{macrocode}
3056 % Amount by which to shift line numbers away from the main tree
3057 % \begin{macrocode}
3058 declare dimen register={line no sep},
3059 line no sep'=1.5em,
3060 % \end{macrocode}
3061 % Distance of line nos. from centre of inner tree; overrides line no sep
3062 % \begin{macrocode}
3063 declare dimen register={line no dist},
3064 line no dist'=0pt,
3065 % \end{macrocode}
3066 % Distance between closure symbols and any following annotation
3067 % \begin{macrocode}
3068 declare dimen register={close sep},
3069 close sep'=.75\baselineskip,
3070 declare dimen register={proof tree line no x},
3071 proof tree line no x'=0pt,
3072 declare dimen register={proof tree justification x},
3073 proof tree justification x'=0pt,
3074 declare dimen register={proof tree inner proof width},
3075 proof tree inner proof width'=0pt,
3076 declare dimen register={proof tree inner proof midpoint},
3077 proof tree inner proof midpoint'=0pt,
3078 % \end{macrocode}
3079 % Count the levels in the proof tree
3080 % \begin{macrocode}
3081 declare count register={proof tree rhif lefelau},
3082 proof tree rhif lefelau'=0,
3083 % \end{macrocode}
3084 % Count the line numbers (on the left)
3085 % \begin{macrocode}
3086 declare count register={proof tree lcount},
3087 proof tree lcount'=0,
3088 % \end{macrocode}
3089 % Count the justifications (on the right)
3090 % \begin{macrocode}
3091 declare count register={proof tree jcount},
3092 proof tree jcount'=0,
3093 % \end{macrocode}
3094 % Adjustment for line numbering
3095 % \begin{macrocode}
3096 declare count register={line no shift},
3097 line no shift'=0,
3098 declare count register={proof tree aros},
3099 proof tree aros'=0,
3100 declare toks register={check with},
3101 check with={\ensuremath{\checkmark}},
3102 declare boolean register={check right},
3103 check right,
3104 check left/.style={not check right},
3105 declare toks register={subs with},
3106 subs with={\ensuremath{\backslash}},
3107 declare boolean register={subs right},
3108 subs right,
3109 subs left/.style={not subs right},
3110 declare toks register={close with},
3111 close with={\ensuremath{\otimes}},
3112 declare keylist register={close format},
3113 close format={font=\scriptsize},
3114 declare keylist register={close with format},
3115 close with format={},
3116 declare toks register={merge delimiter},
3117 merge delimiter={\text{; }},
3118 declare boolean register={just refs left},
3119 just refs left,
3120 just refs right/.style={not just refs left},
3121 declare keylist register={just format},
3122 just format={},
3123 declare keylist register={line no format},
3124 line no format={},
3125 declare autowrapped toks register={highlight format},
3126 highlight format={draw=gray, rounded corners},
3127 declare keylist register={proof statement format},
3128 proof statement format={},
3129 declare keylist register={wff format},
3130 wff format={},
3131 declare boolean={proof tree justification}{0},
3132 declare boolean={proof tree line number}{0},
3133 declare boolean={grouped}{0},
3134 declare boolean={proof tree phantom}{0},
3135 declare boolean={highlight wff}{0},
3136 declare boolean={highlight just}{0},
3137 declare boolean={highlight line no}{0},
3138 declare boolean={highlight line}{0},
3139 Autoforward={highlight line}{highlight just, highlight wff, highlight line no},
3140 declare boolean={proof tree toing}{0},
3141 declare boolean={proof tree toing with}{0},
3142 declare boolean={proof tree rhiant cymysg}{0},
3143 declare boolean={proof tree rhifo}{1},
3144 declare boolean={proof tree arweinydd}{0},
3145 declare autowrapped toks={just}{},
3146 declare toks={proof tree rhestr rhifau llinellau}{},
3147 declare toks={proof tree close}{},
3148 declare toks={proof tree rhestr rhifau llinellau cau}{},
3149 declare autowrapped toks={just options}{},
3150 declare autowrapped toks={line no options}{},
3151 declare autowrapped toks={wff options}{},
3152 declare autowrapped toks={line options}{},
3153 Autoforward={line options}{just options={#1}, line no options={#1}, wff options={#1}},
3154 declare count={proof tree toing by}{0},
3155 declare count={proof tree cadw toing by}{0},
3156 declare count={proof tree toooing}{0},
3157 declare count={proof tree proof line no}{0},
3158 % \end{macrocode}
3159 % Keylists for internal storage
3160 % \begin{macrocode}
3161 declare keylist={proof tree jrefs}{},
3162 declare keylist={proof tree crefs}{},
3163 % \end{macrocode}
3164 % Internal keylists for use in stages
3165 % \begin{macrocode}
3166 declare keylist={proof tree ffurf}{},
3167 declare keylist={proof tree symud awto}{},
3168 declare keylist={proof tree creu nodiadau}{},
3169 declare keylist={proof tree nodiadau}{},
3170 % \end{macrocode}
3171 % \changes{v0.9.1}{2025-08-23}{New internal keylists.}
3172 % Additional internal keylists so we don't pollute \pkg{forest}'s and customisation is easier.
3173 % \begin{macrocode}
3174 declare keylist={before copying content}{},
3175 declare tagging keylist={proof tree copy content}{},
3176 % \end{macrocode}
3177 % Line nos and justifications don't exist yet, even if they are requested, so \texttt{proof tree wffs} is not an option, for instance.
3178 % \begin{macrocode}
3179 proof tree copy content processing order/.nodewalk style={unique={fake=root,descendants}},
3180 declare keylist={proof tree after copying content}{},
3181 declare keylist={proof tree before typesetting nodes}{},
3182 declare keylist={proof tree before packing}{},
3183 declare keylist={proof tree before computing xy}{},
3184 % \end{macrocode}
3185 % \changes{v0.9.2}{2026-01-19}{\texttt{proof tree before drawing tree} renamed \texttt{proof tree after annotations}.}
3186 % \begin{macrocode}
3187 declare keylist={proof tree after annotations}{},
3188 % \end{macrocode}
3189 % \changes{v0.9.1}{2025-08-23}{New public keylists.}
3190 % Empty by default.
3191 % Allow changes in between processing of standard keylists.
3192 % \begin{macrocode}
3193 declare keylist={before making annotations}{},
3194 declare keylist={before annotating}{},
3195 % \end{macrocode}
3196 % \changes{v0.9.1}{2025-08-25}{Additions for tagging:
3197 % tag, plug, tag check with, tag close with, tag subs with, tag to prove, proof tree get tags, before getting tags, before making tags, proof tree make tags, ttoks
3198 % }
3199 % \changes{v0.9.2}{2026-01-19}{Remove \texttt{before making tags}, \texttt{before getting tags}, \texttt{proof tree get tags}, \texttt{ttoks}.
3200 % See the \pkg{ext.tagging} library's \texttt{alt text}, \texttt{before tagging nodes}, \texttt{before collating tags} and \texttt{collate tags}.}
3201 % \changes{v0.9.2}{2026-01-19}{Remove \texttt{proof tree make tags}; use \texttt{tag nodes}.}
3202 % Additions for tagging.
3203 % These are not actually used yet, but make experimenting (with \pkg{prooftrees-debug} easier.
3204 % \begin{macrocode}
3205 declare boolean register={tag},
3206 tag=0,
3207 % ^^A declare toks register={plug},
3208 declare toks register={tag check with},
3209 tag check with={discharged},
3210 declare toks register={tag close with},
3211 tag close with={closed},
3212 declare toks register={tag subs with},
3213 tag subs with={substituted},
3214 declare toks register={tag to prove},
3215 tag to prove={To prove: },
3216 % ^^A declare keylist={before making tags}{},
3217 % ^^A declare keylist={proof tree tag nodes}{},
3218 % ^^A declare keylist={before getting tags}{},
3219 % ^^A declare keylist={proof tree get tags}{},
3220 % ^^A declare toks={ttoks}{},
3221 % \end{macrocode}
3222 % > indicates use of process when it is the first token, preceding a list of instructions as opposed to pgfmath stuff
3223 % \begin{macrocode}
3224 define long step={proof tree symud}{}{%
3225 root,sort by={>{O}{level},>{_O<}{1}{n children}},sort'=descendants
3226 },
3227 % \end{macrocode}
3228 % \begin{macrocode}
3229 define long step={proof tree cywiro symud}{}{%
3230 root,if line numbering={n=2}{n=1},sort by={>{O}{level},>{_O<}{1}{n children}},sort'=descendants
3231 },
3232 % \end{macrocode}
3233 % Updated version of defn. from saso's code (forest2-saso-ptsz.tex) \& \url{https://chat.stackexchange.com/transcript/message/28321501#28321501}
3234 % \begin{macrocode}
3235 define long step={proof tree camau}{}{%
3236 % \end{macrocode}
3237 % Angen +d - gweler \url{https://chat.stackexchange.com/transcript/message/28607212#28607212}
3238 % \begin{macrocode}
3239 root,sort by={>{O}{y},>{Ow1+d}{x}{-##1}},sort'={filter={descendants}{>{OO!&}{proof tree rhifo}{proof tree phantom}}}%
3240 },
3241 % \end{macrocode}
3242 % coeden brif yn unig ar ôl i greu nodiadau
3243 % \begin{macrocode}
3244 define long step={proof tree wffs}{}{%
3245 fake=root,if line numbering={n=2}{n=1},tree
3246 },
3247 % \end{macrocode}
3248 % \changes{v0.9.1}{2025-08-25}{New long step \texttt{proof tree every wff}.}
3249 % \changes{v0.9.1}{2025-08-31}{Renamed \texttt{every wff}.}
3250 % \changes{v0.9.2}{2026-01-14}{Use the \emph{tagging keylists} \texttt{tag nodes} and \texttt{collate tags} provided by the library \pkg{ext.tagging}, part of \pkg{forest-ext}.}
3251 % Unlike the previous step, this includes any proof statement and ensures nodes are only visited once, which we want for tagging.
3252 % \changes{v0.9.2}{2026-01-15}{Move \texttt{tag nodes processing order}, \texttt{collate tags processing order} into setup somewhere.
3253 % It doesn't seem to work here, which is bad, but, if it did work, it would clobber global settings, which would also be bad.}
3254 % \begin{macrocode}
3255 define long step={every wff}{}{%
3256 unique={name=proof statement,proof tree wffs}%
3257 },
3258 % \end{macrocode}
3259 % \changes{v0.9.1}{2025-08-30}{New long step \texttt{wff from proof line no to}.}
3260 % See \url{https://tex.stackexchange.com/a/749854/39222} for example usage.
3261 %
3262 % Cf.~Sašo Živanović: \url{https://tex.stackexchange.com/a/296771/}
3263 %
3264 % Cf.~Sašo Živanović: \url{https://chat.stackexchange.com/transcript/message/28484520#28484520}
3265 %
3266 % Is there any advantage to sorting here?
3267 % \begin{macrocode}
3268 define long step={wffs from proof line no to}{n args=2}{
3269 sort by={>O{proof tree proof line no}},
3270 sort={filter={proof tree wffs}{> nO< nO> O! &&{#1-1}{proof tree proof line no}{#2+1}{proof tree proof line no}{phantom}}}%
3271 },
3272 % \end{macrocode}
3273 % Mark discharge with optional name substituted into existential
3274 % \changes{v0.9.1}{2025-08-25}{Add checked markers to \texttt{ttoks} if tagging.}
3275 % \changes{v0.9.2}{2026-01-19}{Add checked markers to \texttt{alt text} if tagging.}
3276 % \changes{v0.9.3}{2026-01-19}{Additional space in tagged content.}
3277 %
3278 % For building \texttt{alt} text, we want to do this after content is copied but still before \texttt{before typesetting nodes} or \texttt{proof tree before typesetting nodes}.
3279 % \begin{macrocode}
3280 checked/.style={%
3281 proof tree after copying content={%
3282 if check right={%
3283 content+'={\ \forestregister{check with}#1},
3284 if tag={%
3285 alt text+/.process={Rw{tag check with}{\ ##1#1}},
3286 }{},
3287 }{%
3288 +content'={\forestregister{check with}#1\ },
3289 if tag={%
3290 +alt text/.process={Rw{tag check with}{##1#1\ }},
3291 }{},
3292 },
3293 },
3294 },
3295 % \end{macrocode}
3296 % Mark substitution of name into universal
3297 % \changes{v0.9.1}{2025-08-25}{Add substitution markers to \texttt{ttoks} if tagging.}
3298 % \changes{v0.9.2}{2026-01-19}{Add substitution markers to \texttt{alt text} if tagging.}
3299 % \changes{v0.9.3}{2026-01-19}{Additional space in tagged content.}
3300 % \begin{macrocode}
3301 subs/.style={%
3302 proof tree after copying content={%
3303 if subs right={%
3304 content+'={\ \forestregister{subs with}#1},
3305 if tag={%
3306 alt text+/.process={Rw{tag subs with}{\ ##1#1}},
3307 }{},
3308 }{%
3309 +content'={\forestregister{subs with}#1\ },
3310 if tag={%
3311 +alt text/.process={Rw{tag subs with}{##1#1\ }},
3312 }{},
3313 },
3314 },
3315 },
3316 % \end{macrocode}
3317 % This now uses nodes rather than a label to accommodate annotations; closing must be done before packing the tree to ensure that sufficient space is allowed for the symbol and any following annotation; the annotations must be processed before anything is moved to ensure that the correct line numbers are used later, even if the references are given as relative node names
3318 % \begin{macrocode}
3319 close/.style={%
3320 if={%
3321 >{__=}{#1}{}%
3322 }{}{%
3323 temptoksb={},
3324 temptoksa={#1},
3325 split register={temptoksa}{:}{proof tree close,temptoksb},
3326 if temptoksb={}{}{%
3327 split register={temptoksb}{,}{proof tree cref},
3328 },
3329 },
3330 % \end{macrocode}
3331 % \changes{v0.9.1}{2025-08-26}{Delay appending closures to avoid copying into \texttt{ttoks} when tagging.}
3332 % \changes{v0.9.2}{2026-01-19}{Delay appending closures to avoid copying into \texttt{alt text} when tagging.}
3333 % \begin{macrocode}
3334 proof tree after copying content={%
3335 % \end{macrocode}
3336 % This node holds the closure symbol
3337 % \begin{macrocode}
3338 append={%
3339 [\forestregister{close with},
3340 not proof tree rhifo,
3341 proof tree phantom,
3342 grouped,
3343 no edge,
3344 process keylist register=close with format,
3345 % \end{macrocode}
3346 % Adjust the distance between the closure symbol and any annotation
3347 % \begin{macrocode}
3348 proof tree before computing xy={%
3349 delay={%
3350 % \end{macrocode}
3351 % Cywiro? Fel arall, bydda'r peth byth yn cael ei wneud achos proof tree phantom? Dim yn siwr o gwbl.
3352 % \begin{macrocode}
3353 l'=\baselineskip,%
3354 for children={%
3355 l/.register=close sep,
3356 },
3357 },
3358 },
3359 proof tree after annotations={%
3360 if={>{RR|}{line numbering}{justifications}}{%
3361 proof tree proof line no/.option=!parent.proof tree proof line no,
3362 }{},
3363 },
3364 if={%
3365 >{__=}{#1}{}%
3366 }{}{%
3367 % \end{macrocode}
3368 % Don't create a second node if there's no annotation.
3369 % \begin{macrocode}
3370 delay={%
3371 append={%
3372 % \end{macrocode}
3373 % This node holds the annotation, possibly including cross-references which will be relative to the node's grandparent.
3374 % \begin{macrocode}
3375 [,
3376 not proof tree rhifo,
3377 proof tree phantom,
3378 grouped,
3379 no edge,
3380 process keylist register=close format,
3381 if={%
3382 >{O_=}{!parent,parent.proof tree close}{}%
3383 }{}{content/.option=!{parent,parent}.proof tree close},
3384 proof tree crefs/.option=!{parent,parent}.proof tree crefs,
3385 delay={%
3386 !{parent,parent}.proof tree crefs'={},
3387 },
3388 proof tree after annotations={%
3389 if={>{RR|}{line numbering}{justifications}}{%
3390 proof tree proof line no/.option=!{parent,parent}.proof tree proof line no,
3391 }{},
3392 },
3393 ]%
3394 },
3395 },
3396 },
3397 ]%
3398 },
3399 },
3400 },
3401 % \end{macrocode}
3402 % Creates the line numbers on the left; note that it *does* matter that these are part of the tree, even though they do not need to be packed or to have xy computed; moreover, it matters that each is the child of the previous line number... so it won't do for them to *remain* siblings, even though that's fine when they are created.
3403 % \begin{macrocode}
3404 proof tree line no/.style={%
3405 anchor=base west,
3406 no edge,
3407 proof tree line number,
3408 text width/.register=line no width,
3409 x'/.register=proof tree line no x,
3410 process keylist register=line no format,
3411 delay={%
3412 proof tree lcount'+=1,
3413 tempcounta/.process={RRw2+n}{proof tree lcount}{line no shift}{##1+##2},
3414 content/.process={Rw1}{tempcounta}{\linenumberstyle{##1}},% content i.e. the line number
3415 % \end{macrocode}
3416 % Name them so they can be moved later
3417 % \begin{macrocode}
3418 name/.expanded={line no \foresteregister{tempcounta}},%
3419 typeset node,
3420 % \end{macrocode}
3421 % The initial location of most line numbers is incorrect and they must be moved
3422 % \begin{macrocode}
3423 if proof tree lcount>=3{%
3424 % \end{macrocode}
3425 % Move the line number below the previous line number
3426 % \begin{macrocode}
3427 for previous={%
3428 append/.expanded={line no \foresteregister{tempcounta}}
3429 },
3430 }{},
3431 },
3432 },
3433 % \end{macrocode}
3434 % Creates the justifications on the right but does not yet specify any content
3435 % \begin{macrocode}
3436 proof tree line justification/.style={%
3437 anchor=base west,
3438 no edge,
3439 proof tree justification,
3440 x'/.register=proof tree justification x,
3441 process keylist register=just format,
3442 delay={%
3443 proof tree jcount'+=1,
3444 tempcounta/.process={RRw2+n}{proof tree jcount}{line no shift}{##1+##2},
3445 % \end{macrocode}
3446 % Name them so they can be moved
3447 % \begin{macrocode}
3448 name/.expanded={just \foresteregister{tempcounta}},
3449 % \end{macrocode}
3450 % Angen i osgoi broblemau 'da highlight just/line etc.
3451 % \begin{macrocode}
3452 typeset node,
3453 % \end{macrocode}
3454 % Correct the location as for the line numbers (cf. line no style)
3455 % \begin{macrocode}
3456 if proof tree jcount>=3{%
3457 for previous={%
3458 append/.expanded={just \foresteregister{tempcounta}},
3459 },
3460 }{},
3461 },
3462 },
3463 zero start/.style={%
3464 line no shift'+=-1,
3465 },
3466 % \end{macrocode}
3467 % Sets a proof statement
3468 % \begin{macrocode}
3469 to prove/.style={%
3470 for root={%
3471 proof tree before typesetting nodes={%
3472 content={#1},
3473 phantom=false,
3474 baseline,
3475 if line numbering={anchor=base west}{anchor=base},
3476 process keylist register=proof statement format,
3477 % \end{macrocode}
3478 % \changes{v0.9.1}{2025-08-25}{Add to \texttt{ttoks} if tagging.}
3479 % \changes{v0.9.2}{2026-01-19}{Add to \texttt{alt text} if tagging.}
3480 % \begin{macrocode}
3481 if={>R{tag}}{%
3482 %<debug> debug tagging=Copying to prove to alt text,
3483 alt text/.process={ORw2{content}{tag to prove}{##2\ \ensuremath{##1}}},
3484 %<debug> debug tagging/.option=alt text,
3485 % ^^A collate tags={%
3486 % ^^A %<debug> debug tagging=Pick up alt text from to prove,
3487 % \end{macrocode}
3488 % \changes{v0.9.2}{2026-01-19}{Use \texttt{collate} from \pkg{ext.tagging} instead of \texttt{pick up tags}.}
3489 % \begin{macrocode}
3490 % ^^A collate/.option=alt text,
3491 % ^^A },
3492 }{},
3493 % \end{macrocode}
3494 % \begin{macrocode}
3495 },
3496 proof tree before computing xy={%
3497 delay={%
3498 for children={%
3499 l=1.5*\baselineskip,
3500 },
3501 },
3502 },
3503 },
3504 },
3505 % \end{macrocode}
3506 % This style should **NOT** be used directly in a forest environment - see notes at top of this file.
3507 % \begin{macrocode}
3508 proof tree/.style={%
3509 for tree={%
3510 % \end{macrocode}
3511 % manual 64
3512 % \begin{macrocode}
3513 parent anchor=children,
3514 % \end{macrocode}
3515 % manual 64
3516 % \begin{macrocode}
3517 child anchor=parent,
3518 math content,
3519 delay={%
3520 % \end{macrocode}
3521 % If we've got justifications, make sure nodes are created for them later and split out cross-references so we identify the correct nodes before anything gets moved, allowing the use of relative node names.
3522 % \begin{macrocode}
3523 if just={}{}{%
3524 justifications,
3525 temptoksa={},
3526 split option={just}{:}{just,temptoksa},
3527 if temptoksa={}{}{%
3528 split register={temptoksa}{,}{proof tree jref},
3529 },
3530 },
3531 % \end{macrocode}
3532 %
3533 % \begin{macrocode}
3534 if content={}{% if there's no proof statement
3535 if level=0{}{%
3536 shape=coordinate,
3537 },
3538 }{},
3539 },
3540 },
3541 where level=0{%
3542 % \end{macrocode}
3543 % No edges from phantom root or proof statement to children.
3544 % \begin{macrocode}
3545 for children={%
3546 proof tree before typesetting nodes={%
3547 no edge,
3548 },
3549 },
3550 delay={%
3551 if content={}{phantom}{},
3552 % \end{macrocode}
3553 % Create the line numbers if appropriate.
3554 % \begin{macrocode}
3555 if line numbering={%
3556 parent anchor=south west,
3557 if line no width={0pt}{%
3558 line no width/.pgfmath={width("\noexpand\linenumberstyle{99}")},
3559 }{},
3560 }{},
3561 },
3562 % \end{macrocode}
3563 % This is processed after computing xy.
3564 % \begin{macrocode}
3565 proof tree creu nodiadau={%
3566 % \end{macrocode}
3567 % Count proof lines if necessary.
3568 % \begin{macrocode}
3569 if={>{RR|}{line numbering}{justifications}}{%
3570 proof tree rhif lefelau'/.register=line no shift,
3571 for proof tree camau={%
3572 if level>=1{%
3573 if={%
3574 >{OO<}{y}{!back.y}%
3575 }{%
3576 proof tree rhif lefelau'+=1,
3577 proof tree proof line no'/.register=proof tree rhif lefelau,
3578 }{%
3579 proof tree proof line no'/.register=proof tree rhif lefelau
3580 },
3581 }{},
3582 },
3583 proof tree inner proof midpoint/.min={%
3584 >{OOw2+d}{x}{min x}{##1+##2}%
3585 }{fake=root,descendants},
3586 proof tree inner proof width/.max={%
3587 >{OOw2+d}{x}{max x}{##1+##2}%
3588 }{fake=root,descendants},
3589 proof tree inner proof width-/.register=proof tree inner proof midpoint,
3590 proof tree inner proof midpoint+/.process={%
3591 Rw+d{proof tree inner proof width}{##1/2}%
3592 },
3593 }{},
3594 % \end{macrocode}
3595 % Get the x position of line numbers and adjust the location and alignment of the proof statement.
3596 % \begin{macrocode}
3597 if line numbering={%
3598 proof tree line no x/.min={>{OOw2+d}{x}{min x}{##1+##2}}{fake=root,descendants},
3599 if={%
3600 > Rd= {line no dist}{0pt}%
3601 }{%
3602 proof tree line no x-/.register=line no sep,
3603 }{%
3604 tempdima/.register=proof tree inner proof width,
3605 tempdima:=2,
3606 if={%
3607 > RR< {line no dist}{tempdima}%
3608 }{}{%
3609 proof tree line no x/.register=proof tree inner proof midpoint,
3610 proof tree line no x-/.register=line no dist,
3611 },
3612 },
3613 proof tree line no x-/.register=line no width,
3614 for root={%
3615 tempdimc/.option=x,
3616 x'+/.register=proof tree line no x,
3617 x'-/.option=min x,
3618 },
3619 % \end{macrocode}
3620 % create line numbers on left
3621 % \begin{macrocode}
3622 prepend={%
3623 [,
3624 proof tree line no,
3625 % \end{macrocode}
3626 % () to group are required here - otherwise, the -1 (or -2 or whatever) is silently ignored.
3627 % Most are created in the wrong place but proof tree line no moves them later.
3628 % \begin{macrocode}
3629 repeat={((proof_tree_rhif_lefelau)-1)-(line_no_shift)}{%
3630 delay n={proof_tree_lcount}{
3631 append={[, proof tree line no]},
3632 },
3633 },
3634 ]%
3635 },
3636 }{},
3637 % \end{macrocode}
3638 % Get the x position of justifications and create the nodes which will hold the justification content, if required.
3639 % \begin{macrocode}
3640 if justifications={%
3641 proof tree justification x/.max={%
3642 >{OOw2+d}{x}{max x}{##1+##2}%
3643 }{fake=root,descendants},
3644 if={%
3645 > Rd= {just dist}{0pt}%
3646 }{%
3647 proof tree justification x+/.register=just sep,
3648 }{%
3649 tempdima/.register=proof tree inner proof width,
3650 tempdima:=2,
3651 if={%
3652 > RR< {just dist}{tempdima}%
3653 }{}{%
3654 proof tree justification x/.register=proof tree inner proof midpoint,
3655 proof tree justification x+/.register=just dist,
3656 },
3657 },
3658 append={%
3659 [,
3660 proof tree line justification,
3661 % \end{macrocode}
3662 % Most are created in the wrong place but proof tree line justification moves them later.
3663 % \begin{macrocode}
3664 repeat={((proof_tree_rhif_lefelau)-1)-(line_no_shift)}{%
3665 delay n={proof_tree_jcount}{%
3666 append={[, proof tree line justification]},
3667 },
3668 }%
3669 ]%
3670 },
3671 }{},
3672 },
3673 }{%
3674 delay={%
3675 % \end{macrocode}
3676 % Automatically group lines if not using single branches.
3677 % \begin{macrocode}
3678 if single branches={}{%
3679 if n children=1{%
3680 for children={%
3681 grouped,
3682 },
3683 }{},
3684 },
3685 },
3686 % \end{macrocode}
3687 % Apply wff-specific highlighting and additional TikZ keys.
3688 % \begin{macrocode}
3689 proof tree before typesetting nodes={%
3690 process keylist register=wff format,
3691 if highlight wff={node options/.register=highlight format}{},
3692 node options/.option=wff options,
3693 },
3694 },
3695 % \end{macrocode}
3696 % Processed before proof tree symud auto: adjusts the alignment of lines when some levels of the tree are grouped together either whenever the number of children is only 1 or by applying the grouped style to particular nodes when specifying the tree.
3697 % \begin{macrocode}
3698 proof tree ffurf={%
3699 if auto move={%
3700 if single branches={%
3701 where={%
3702 >{O! _O< O &&}{grouped}{2}{level}{proof tree rhifo}%
3703 }{%
3704 if={%
3705 >{_O= _O< &}{1}{!parent.n children}{1}{!parent,parent.n children}%
3706 }{%
3707 not tempboola,
3708 for root/.process={Ow1}{level}{%
3709 for level={##1}{%
3710 if={%
3711 >{_O< _O= &}{1}{!parent.n children}{1}{n}%
3712 }{%
3713 tempboola,
3714 }{},
3715 },
3716 },
3717 if tempboola={%
3718 proof tree toing,
3719 }{},
3720 }{},
3721 }{},
3722 }{},
3723 where={%
3724 >{O _O< O &&}{grouped}{1}{level}{proof tree rhifo}%
3725 % \end{macrocode}
3726 % This searches for certain kinds of structural asymmetry in the tree and attempts to move lines appropriately in such cases - the algorithm is intended to be relatively conservative (not in the sense of 'cautious' or 'safe' but in the sense of 'reflection of the overlapping consensus of reasonable users' / 'what would be rationally agreed behind the prooftrees veil of ignorance'; however, I should have realised I actually had 'the overlapping concensus of reasonable Beamer users' in mind rather than 'the overlapping consensus of reasonable users', so there is now an option to turn it off; apologies if this comment previously misclassified you as 'unreasonable'; apologies for the inconvenience if you are an unreasonable user).
3727 % \begin{macrocode}
3728 }{%
3729 not tempboola,
3730 for root/.process={Ow1}{level}{%
3731 for level={##1}{%
3732 if={%
3733 >{_O< _O= &}{1}{!parent.n children}{1}{n}%
3734 }{%
3735 tempboola,
3736 }{},
3737 },
3738 % \end{macrocode}
3739 % Sašo: \url{https://chat.stackexchange.com/transcript/message/27874731#27874731}, see also \url{https://chat.stackexchange.com/transcript/message/27874722#27874722}.
3740 % \begin{macrocode}
3741 },%
3742 if tempboola={%
3743 if n children=0{%
3744 % \end{macrocode}
3745 % We're already moving the parent and the child will move with the parent, so we can just mark this and do nothing else.
3746 % \begin{macrocode}
3747 if={>{OO|}{!parent.proof tree toing}{!parent.proof tree toing with}}{%
3748 proof tree toing with,
3749 }{%
3750 % \end{macrocode}
3751 % Don't move a terminal node even in case of asymmetry: instead, create a separate proof line for terminal nodes on this level which are only children, by moving children with siblings on this level down a proof line, without altering their physical location.
3752 % \begin{macrocode}
3753 for root/.process={Ow1}{level}{%
3754 % \end{macrocode}
3755 % This makes the tree more compact and stops it looking silly.
3756 % \begin{macrocode}
3757 for level={##1}{%
3758 if={%
3759 >{_O< _O= &}{1}{!parent.n children}{1}{n}%
3760 }{%
3761 % \end{macrocode}
3762 % This just serves to keep the levels nice for the sub-tree and ensure things align. We need this because we want to skip a level here to allow room for the terminal node in the other branch.
3763 % \begin{macrocode}
3764 for parent={%
3765 % \end{macrocode}
3766 % We mark the parent to avoid increasing the line number of its descendants more than once.
3767 % \begin{macrocode}
3768 if proof tree rhiant cymysg={}{%
3769 proof tree rhiant cymysg,
3770 for descendants={%
3771 proof tree toing by'+=1,
3772 },
3773 },
3774 },
3775 }{},
3776 },
3777 % \end{macrocode}
3778 % Sašo: \url{https://chat.stackexchange.com/transcript/message/27874731#27874731}, see also \url{https://chat.stackexchange.com/transcript/message/27874722#27874722}.
3779 % \begin{macrocode}
3780 },%
3781 },
3782 no edge,
3783 }{%
3784 if={%
3785 >{_O= _O< &}{1}{!parent.n children}{1}{!parent,parent.n children}%
3786 % \end{macrocode}
3787 % Don't try to move if the node has more than 1 child or the grandparent has no more than that; otherwise, mark the node as one to move - we figure out where to move it later.
3788 % \begin{macrocode}
3789 }{%
3790 proof tree toing,
3791 }{no edge},
3792 },
3793 }{no edge},
3794 }{},
3795 }{},
3796 },
3797 % \end{macrocode}
3798 % Processed before typesetting nodes: if \emph{this} could be done during packing, that would be very nice, even if the previous stuff can't be.
3799 % \begin{macrocode}
3800 proof tree symud awto={%
3801 if auto move={%
3802 proof tree aros'=0,
3803 for proof tree symud={%
3804 % \end{macrocode}
3805 % This relies on an experimental feature of forest, which is anffodus.
3806 % \begin{macrocode}
3807 if proof tree toing={%
3808 for nodewalk={fake=parent,fake=sibling,descendants}{do dynamics},
3809 delay n={\foresteregister{proof tree aros}}{%
3810 tempcounta/.max={%
3811 >{OOOOw4+n}{level}{proof tree toing by}{proof tree toooing}%
3812 {proof tree rhifo}{(##1+##2+##3)*##4}%
3813 }{parent,sibling,descendants},
3814 if tempcounta>=1{%
3815 if={%
3816 >{Rw1+n OOw2+n >}{tempcounta}{##1+1}{level}{proof tree toing by}{##1+##2}%
3817 }{%
3818 tempcounta-/.option=level,
3819 tempcounta'+=1,
3820 move by/.register=tempcounta,
3821 }{no edge},
3822 }{no edge},
3823 },
3824 proof tree aros'+=4,
3825 }{},
3826 },
3827 }{},
3828 },
3829 % \end{macrocode}
3830 % Processed after proof tree creu nodiadau and before before drawing tree: creates annotation content which may include cross-references, applies highlighting and additional TikZ keys to line numbers, justifications and to wffs where specified for entire proof lines.
3831 % \begin{macrocode}
3832 proof tree nodiadau={%
3833 % \end{macrocode}
3834 % Resolve cross-refs in closures.
3835 % \begin{macrocode}
3836 where proof tree crefs={}{}{%
3837 split option={proof tree crefs}{,}{proof tree rhif llinell cau},
3838 if content={}{%
3839 content/.option=proof tree rhestr rhifau llinellau cau,
3840 }{%
3841 content+/.process={_O}{\ }{proof tree rhestr rhifau llinellau cau},
3842 },
3843 typeset node,
3844 },
3845 % \end{macrocode}
3846 % Apply highlighting and additional TikZ keys to line numbers; initial alignment of numbers with proof lines.
3847 % \begin{macrocode}
3848 if line numbering={%
3849 for proof tree wffs={%
3850 if highlight line no={%
3851 % \end{macrocode}
3852 % From Sašo's anti-pgfmath version - rhaid ddweud proof tree proof line no yn ddwywaith ?! dim yn bosibl i ailddefnyddio'r gyntaf ?!
3853 % \begin{macrocode}
3854 for name/.process={Ow1OOOw3}{proof tree proof line no}{line no ##1}{proof tree proof line no}{line no options}{y}{%
3855 node options/.register=highlight format,
3856 ##2,
3857 y'=##3,
3858 proof tree proof line no'=##1,
3859 typeset node,
3860 }%
3861 }{%
3862 if line no options={}{%
3863 if proof tree phantom={}{%
3864 for name/.process={Ow1OOw2}{proof tree proof line no}{line no ##1}{proof tree proof line no}{y}{%
3865 y'=##2,
3866 proof tree proof line no'=##1,
3867 }%
3868 },
3869 }{%
3870 for name/.process={Ow1OOOw3}{proof tree proof line no}{line no ##1}{proof tree proof line no}{line no options}{y}{%
3871 ##2,
3872 y'=##3,
3873 proof tree proof line no'=##1,
3874 typeset node,
3875 }%
3876 },
3877 },
3878 },
3879 }{},
3880 % \end{macrocode}
3881 % Initial alignment of justifications with proof lines, addition of content, resolution of cross-references and application of highlighting and additional TikZ keys.
3882 % \begin{macrocode}
3883 if justifications={%
3884 for proof tree wffs={%
3885 if just={}{%
3886 if proof tree phantom={}{%
3887 % \end{macrocode}
3888 % From Sašo's anti-pgfmath version - rhaid ddweud proof tree proof line no yn ddwywaith ?! dim yn bosibl i ailddefnyddio'r gyntaf ?!
3889 % \begin{macrocode}
3890 for name/.process={Ow1OOw2}{proof tree proof line no}{just ##1}{proof tree proof line no}{y}{%
3891 y'=##2,
3892 proof tree proof line no'=##1,
3893 }%
3894 },
3895 }{%
3896 % \end{macrocode}
3897 % Puts the content of the justifications into the empty justification nodes on the right; because this is done late, the nodes need to be typeset again.
3898 % \begin{macrocode}
3899 if proof tree jrefs={}{}{%
3900 % \end{macrocode}
3901 % Resolve cross-refs in justifications.
3902 % \begin{macrocode}
3903 split option={proof tree jrefs}{,}{proof tree rhif llinell},
3904 if just refs left={%
3905 +just/.process={O_}{proof tree rhestr rhifau llinellau}{\ },
3906 }{%
3907 just+/.process={_O}{\ }{proof tree rhestr rhifau llinellau},
3908 },
3909 },
3910 % \end{macrocode}
3911 % Apply highlighting and additional TikZ keys to justifications, set content and merge any conflicting specifications, warning user if appropriate.
3912 % \begin{macrocode}
3913 if highlight just={%
3914 % \end{macrocode}
3915 % From Sašo's anti-pgfmath version - rhaid ddweud proof tree proof line no yn ddwywaith ?! dim yn bosibl i ailddefnyddio'r gyntaf ?!
3916 % \begin{macrocode}
3917 for name/.process={Ow1OOOOw4}{proof tree proof line no}{just ##1}{proof tree proof line no}{just}{just options}{y}{%
3918 if={%
3919 >{O_= O_= |}{content}{}{content}{##2}%
3920 % \end{macrocode}
3921 % Gweler isod - o gôd Sašo.
3922 % \begin{macrocode}
3923 }{%
3924 content={##2},
3925 % \end{macrocode}
3926 % \changes{v0.9.1}{2025-09-03}{Avoid merging tags for merged justifications.}
3927 % Avoid merging tags for merged justifications.
3928 % We need this in four places: for merged and unmerged justifications with and without highlighting.
3929 % This would have been easier with Peter Smith's preferred design \dots.
3930 % \begin{macrocode}
3931 }{%
3932 content+'={\foresteregister{merge delimiter}##2},
3933 TeX={\PackageWarning{prooftrees}{Merging conflicting justifications for line ##1! Please examine the output carefully and use "move by" to move lines later in the proof if required. Details of how to do this are included in the documentation.}},
3934 % \end{macrocode}
3935 % Avoid merging tags for merged justifications.
3936 % \begin{macrocode}
3937 },
3938 node options/.register=highlight format,
3939 ##3,
3940 y'=##4,
3941 proof tree proof line no'=##1,
3942 typeset node,
3943 }%^^A do NOT put a comma here!
3944 }{%
3945 % \end{macrocode}
3946 % From Sašo's anti-pgfmath version - rhaid ddweud proof tree proof line no yn ddwywaith ?! dim yn bosibl i ailddefnyddio'r gyntaf ?!
3947 % \begin{macrocode}
3948 for name/.process={Ow1OOOOw4}{proof tree proof line no}{just ##1}{proof tree proof line no}{just}{just options}{y}{%
3949 if={%
3950 % \end{macrocode}
3951 % From Sašo's anti-pgfmath version - I appreciate this is faster, but why is it \textbf{required}?!
3952 % \begin{macrocode}
3953 >{O_= O_= |}{content}{}{content}{##2}%
3954 }{%
3955 content={##2},
3956 % \end{macrocode}
3957 % Avoid merging tags for merged justifications.
3958 % \begin{macrocode}
3959 }{%
3960 content+'={\foresteregister{merge delimiter}##2},
3961 TeX={\PackageWarning{prooftrees}{Merging conflicting justifications for line ##1! Please examine the output carefully and use "move by" to move lines later in the proof if required. Details of how to do this are included in the documentation.}},
3962 % \end{macrocode}
3963 % Avoid merging tags for merged justifications.
3964 % \begin{macrocode}
3965 },
3966 ##3,
3967 y'=##4,
3968 proof tree proof line no'=##1,
3969 typeset node,
3970 }%^^A do NOT put a comma here!
3971 }
3972 },
3973 },
3974 }{},
3975 % \end{macrocode}
3976 % Apply highlighting and TikZ keys which are specified for whole proof lines to all applicable wffs.
3977 % \begin{macrocode}
3978 for proof tree wffs={%
3979 if proof tree phantom={}{%
3980 if highlight line={%
3981 for proof tree wffs/.process={OOw2}{proof tree proof line no}{line options}{%
3982 if proof tree proof line no={##1}{%
3983 node options/.register=highlight format,
3984 ##2,
3985 }{}%
3986 },
3987 }{%
3988 for proof tree wffs/.process={OOw2}{proof tree proof line no}{line options}{%
3989 if proof tree proof line no={##1}{##2}{},
3990 },
3991 },
3992 delay={typeset node},
3993 },
3994 },
3995 },
3996 % \end{macrocode}
3997 % Initial alignment so we don't get proof line numbers incrementing due to varying height/depth of nodes, for example - when single branches is true and few nodes are grouped, this is also a reasonable first approximation.
3998 % \begin{macrocode}
3999 proof tree before packing={%
4000 for tree={%
4001 tier/.process={OOw2+nw1}{level}{proof tree toing by}{##1+##2}{tier ##1},
4002 },
4003 % \end{macrocode}
4004 % If there's no proof statement, adjust the alignment of the proof relative to the surrounding text.
4005 % \begin{macrocode}
4006 for root={%
4007 if content={}{%
4008 !{n=1}.baseline,
4009 }{},
4010 },
4011 },
4012 % \end{macrocode}
4013 % Adjust distance between levels for grouped nodes after tree is packed.
4014 % \begin{macrocode}
4015 proof tree before computing xy={%
4016 for tree={%
4017 if={%
4018 >{O _O< &}{grouped}{1}{level}%
4019 % \end{macrocode}
4020 % Osgoi overlapping nodes, if posibl: cwestiwn \url{https://tex.stackexchange.com/q/456254/}.
4021 % \begin{macrocode}
4022 }{%
4023 not tempboola,
4024 tempcounta/.option=level,
4025 tempcountb/.option=proof tree toing,
4026 tempcountb+/.option=proof tree toooing,
4027 for nodewalk={fake=root, descendants}{if={> RO= On> O! O! OOw2+nR= &&&&
4028 {tempcounta}{level} {!u.n children}{1} {proof tree arweinydd} {proof tree phantom} {proof tree toing by} {proof tree toooing}{##1+##2} {tempcountb}
4029 }{tempboola}{}},
4030 if tempboola={}{l'=\baselineskip},
4031 }{},
4032 },
4033 },
4034 % \end{macrocode}
4035 % Set final alignment for proof lines which have been moved by effectively grouping lead nodes and moving their subtrees accordingly - this requires that each line number and justification be the child of the previous one and that if justifications are used at all, then justifications exist for all proof lines, even if empty.
4036 % \begin{macrocode}
4037 proof tree after annotations={%
4038 % \end{macrocode}
4039 % Correct the alignment of move by lines when single branches is false - o fersiwn anti-pgfmath Sašo.
4040 % \begin{macrocode}
4041 if={>{RR|R!&}{line numbering}{justifications}{single branches}}{%
4042 % \end{macrocode}
4043 % Track cumulative adjustments to line numbers and justifications
4044 % \begin{macrocode}
4045 tempdimc'=0pt,
4046 for proof tree cywiro symud={%
4047 % \end{macrocode}
4048 % Only examine the lead nodes - their descendants need the same (cumulative) adjustments
4049 % \begin{macrocode}
4050 if proof tree arweinydd={%
4051 tempdima'/.option=y,
4052 % \end{macrocode}
4053 % If there are line numbers, we use the previous line number's vertical position
4054 % \begin{macrocode}
4055 if line numbering={%
4056 for name/.process={Ow1+nw1}{proof tree proof line no}{##1-1}{line no ##1}{% arafach ?
4057 tempdimb'/.option=y,
4058 }%
4059 % \end{macrocode}
4060 % If not, we use the previous justification's vertical position
4061 % \begin{macrocode}
4062 }{%
4063 for name/.process={Ow1+nw1}{proof tree proof line no}{##1-1}{just ##1}{% arafach ?
4064 tempdimb'/.option=y,
4065 }%
4066 },
4067 % \end{macrocode}
4068 % The parent (which will be a phantom) gets aligned with the previous line
4069 % \begin{macrocode}
4070 for parent={%
4071 y'/.register=tempdimb,
4072 },
4073 % \end{macrocode}
4074 % Adjust so we align this line below the previous one (assuming we're going down)
4075 % \begin{macrocode}
4076 if tempdimb<={0pt}{%
4077 tempdimb'-=\baselineskip,
4078 }{%
4079 tempdimb'+=\baselineskip,
4080 },
4081 % \end{macrocode}
4082 % How far are we moving?
4083 % \begin{macrocode}
4084 tempdimb'-/.register=tempdima,
4085 % \end{macrocode}
4086 % Adjust this node and all descendants
4087 % \begin{macrocode}
4088 for tree={%
4089 y'+/.register=tempdimb,
4090 },
4091 % \end{macrocode}
4092 % Deduct any tracked cumulative adjustments to line numbers and justifications
4093 % \begin{macrocode}
4094 tempdimb'-/.register=tempdimc,
4095 % \end{macrocode}
4096 % Adjust the line numbers, if any
4097 % \begin{macrocode}
4098 if line numbering={%
4099 for name/.process={Ow1}{proof tree proof line no}{line no ##1}{%
4100 for tree={%
4101 y'+/.register=tempdimb,
4102 },
4103 }%
4104 }{},
4105 % \end{macrocode}
4106 % Adjust the justifications, if any
4107 % \begin{macrocode}
4108 if justifications={%
4109 % \end{macrocode}
4110 % t. 60 manual 2.1 rc1
4111 % \begin{macrocode}
4112 for name/.process={Ow1}{proof tree proof line no}{just ##1}{%
4113 for tree={%
4114 y'+/.register=tempdimb,
4115 },
4116 }%
4117 }{},
4118 % \end{macrocode}
4119 % Add the adjustment just implemented to the tracked cumulative adjustments for line numbers and/or justifications
4120 % \begin{macrocode}
4121 tempdimc'/.register=tempdimb,
4122 }{},
4123 },
4124 }{},
4125 if={%
4126 > RR| {auto move}{single branches}%
4127 }{}{%
4128 where proof tree arweinydd={%
4129 for nodewalk={%
4130 save append={proof tree walk}{%
4131 current,
4132 do until={%
4133 > O+t_+t=! {content}{}%
4134 }{parent}%
4135 }%
4136 }{},
4137 }{},
4138 where level>=1{%
4139 if grouped={%
4140 if in saved nodewalk={current}{proof tree walk}{}{%
4141 no edge,
4142 },
4143 }{},
4144 }{},
4145 },
4146 },
4147 },
4148 % \end{macrocode}
4149 % This implements both the automated moves \pkg{prooftrees} finds necessary and any additional moves requested by the user - more accurately, it implements initial moves, which may get corrected later (e.g. to avoid skipping numbers or creating empty proof lines, which we assume aren't wanted).
4150 % \begin{macrocode}
4151 move by/.style={%
4152 if={
4153 >{_n<}{0}{#1}%
4154 % \end{macrocode}
4155 % Only try to move the node if the target line number exceeds the one i.e. the line number is to be positively incremented.
4156 % \begin{macrocode}
4157 }{%
4158 proof tree cadw toing by/.option=proof tree toing by,
4159 proof tree arweinydd,
4160 for tree={%
4161 if={%
4162 >{_n<}{1}{#1}%
4163 % \end{macrocode}
4164 % Track skipped lines for which we won't be creating phantom nodes
4165 % \begin{macrocode}
4166 }{%
4167 proof tree toing by+=#1-2,
4168 proof tree toooing'+=1,
4169 }{},
4170 },
4171 % \end{macrocode}
4172 % Insert our first phantom
4173 % \begin{macrocode}
4174 delay={%
4175 replace by={%
4176 [,
4177 if={%
4178 >{_n<}{1}{#1}%
4179 }{%
4180 child anchor=parent,
4181 parent anchor=parent,
4182 }{%
4183 child anchor=children,
4184 parent anchor=children,
4185 },
4186 proof tree phantom,
4187 % \end{macrocode}
4188 % Sašo Živanović: \url{https://chat.stackexchange.com/transcript/message/27990955#27990955}.
4189 % \begin{macrocode}
4190 edge path/.option=!last dynamic node.edge path,
4191 edge/.option=!last dynamic node.edge,
4192 append,
4193 proof tree after annotations={%
4194 if={>{RR|}{line numbering}{justifications}}{%
4195 proof tree proof line no/.process={Ow1+n}{!parent.proof tree proof line no}{##1+1},
4196 }{},
4197 },
4198 if={%
4199 >{_n<}{1}{#1}%
4200 % \end{macrocode}
4201 % If we are moving by more than 1, we insert a second phantom so that a node with siblings which is moved a long way will not get a unidirectional edge but an edge which looks similar to others in the tree (by default, sloping down a line or so and then plummeting straight down rather than a sharply-angled steep descent).
4202 % \begin{macrocode}
4203 }{%
4204 delay={%
4205 append={%
4206 [,
4207 child anchor=parent,
4208 parent anchor=parent,
4209 proof tree toing by=#1-2+proof_tree_cadw_toing_by,
4210 proof tree phantom,
4211 edge path/.option=!u.edge path,
4212 edge/.option=!u.edge,
4213 proof tree after annotations={%
4214 if={>{RR|}{line numbering}{justifications}}{%
4215 proof tree proof line no/.process={Ow1+n}{!n=1.proof tree proof line no}{##1-1},
4216 }{},
4217 },
4218 append=!sibling,
4219 ]%
4220 },
4221 },
4222 }{%
4223 if single branches={}{%
4224 delay={%
4225 for children={%
4226 no edge,
4227 },
4228 },
4229 },
4230 },
4231 ]%
4232 },
4233 },
4234 }{%
4235 TeX/.process={Ow1}{name}{\PackageWarning{prooftrees}{Line not moved! I can only move things later in the proof. Please see the documentation for details. ##1}},
4236 },
4237 },
4238 % \end{macrocode}
4239 % Get the names of nodes cross-referenced in closure annotations for use later
4240 % \begin{macrocode}
4241 proof tree cref/.style={%
4242 proof tree crefs+/.option=#1.name,
4243 },
4244 % \end{macrocode}
4245 % Get the proof line numbers of the cross-referenced nodes in closure annotations, using the list of names created earlier.
4246 % \begin{macrocode}
4247 proof tree rhif llinell cau/.style={%
4248 if proof tree rhestr rhifau llinellau cau={}{}{%
4249 proof tree rhestr rhifau llinellau cau+={,\,},
4250 },
4251 proof tree rhestr rhifau llinellau cau+/.option=#1.proof tree proof line no,
4252 },
4253 % \end{macrocode}
4254 % Get the names of nodes cross-referenced in justifications for use later.
4255 % \begin{macrocode}
4256 proof tree jref/.style={%
4257 proof tree jrefs+/.option=#1.name,
4258 },
4259 % \end{macrocode}
4260 % Get the proof line numbers of the cross-referenced nodes in justifications, using the list of names created earlier.
4261 % \begin{macrocode}
4262 proof tree rhif llinell/.style={%
4263 if proof tree rhestr rhifau llinellau={}{}{%
4264 proof tree rhestr rhifau llinellau+={,\,},
4265 },
4266 % \end{macrocode}
4267 % works according to Sašo's anti-pgfmath version
4268 % \begin{macrocode}
4269 proof tree rhestr rhifau llinellau+/.option=#1.proof tree proof line no,
4270 },
4271 % \end{macrocode}
4272 % 2018-02-19 ateb \url{https://tex.stackexchange.com/a/416037/}
4273 % \begin{macrocode}
4274 line no override/.style={%
4275 proof tree after annotations={
4276 for name/.process={Ow}{proof tree proof line no}{line no ##1}{
4277 content=\linenumberstyle{#1},
4278 typeset node,
4279 },
4280 },
4281 },
4282 % \end{macrocode}
4283 % 2018-02-19 gweler uchod
4284 % \begin{macrocode}
4285 no line no/.style={%
4286 proof tree after annotations={
4287 for name/.process={Ow}{proof tree proof line no}{line no ##1}{
4288 content=,
4289 typeset node,
4290 },
4291 },
4292 },
4293 % \end{macrocode}
4294 % \changes{v0.9.1}{2025-08-30}{Add \texttt{nodewalk node+}, \texttt{nodewalk node\textquotesingle}, \texttt{+nodewalk node}, \texttt{nodewalk node} and \texttt{nodewalk to node}.}
4295 % Styles to make facilitate drawing around nodewalks.
4296 % \begin{macrocode}
4297 prooftrees@nodewalk@node/.style={inner sep=0pt},
4298 nodewalk node+/.code={%
4299 \pgfqkeys{/forest}{prooftrees@nodewalk@node/.append style={#1}}%
4300 },
4301 +nodewalk node/.code={%
4302 \pgfqkeys{/forest}{prooftrees@nodewalk@node/.prepend style={#1}}%
4303 },
4304 nodewalk node'/.code={%
4305 \pgfqkeys{/forest}{prooftrees@nodewalk@node/.style={#1}}%
4306 },
4307 nodewalk node/.forward to=/forest/nodewalk node+,
4308 nodewalk to node/.style 2 args={%
4309 proof tree after annotations={%
4310 tikz+={%
4311 \node [fit to={#2},/forest/prooftrees@nodewalk@node] (#1) {};
4312 },
4313 },
4314 },
4315 % \end{macrocode}
4316 % ^^A dadfygio <<<
4317 % Two styles for debugging.
4318 % Despite the names, these are available in the non-debug package for largely historical reasons, but also because they probably do not cost much.
4319 %
4320 % Style for use in debugging moves which displays information about nodes in the tree.
4321 % \begin{macrocode}
4322 proof tree dadfygio/.style={%
4323 proof tree before packing={%
4324 for tree={%
4325 label/.process={OOOw3}{level}{proof tree toing by}{id}{%
4326 [red,font=\tiny,inner sep=0pt,outer sep=0pt, anchor=south]below:##1/##2/##3%
4327 },
4328 },
4329 },
4330 proof tree after annotations={%
4331 for tree={%
4332 delay={%
4333 tikz+/.process={Ow1}{proof tree proof line no}{%
4334 \node [anchor=west, font=\tiny, text=blue, inner sep=0pt] at (.east) {##1};
4335 },
4336 },
4337 },
4338 },
4339 },
4340 % \end{macrocode}
4341 % Debugging / dangos dimension stuff.
4342 % \begin{macrocode}
4343 proof tree alino/.style={%
4344 proof tree after annotations={%
4345 tikz+/.process={%
4346 RRRRw4{proof tree inner proof midpoint}{line no width}{line no dist}{just dist}
4347 {
4348 \begin{scope}[densely dashed]
4349 \draw [darkgray] (##1,0) coordinate (a) -- (a |- current bounding box.south);
4350 \draw [green] (current bounding box.west) -- ++(##2,0) coordinate (b);
4351 \draw [blue] (b) -- ++(##3,0) coordinate (c);
4352 \draw [magenta] (c) -- ++(##4,0);
4353 \end{scope}
4354 }%
4355 },
4356 },
4357 },
4358 % \end{macrocode}
4359 % ^^A dadfygio >>>
4360 % ^^A ttableau yn cynnwys dadfygio tagging <<<
4361 % \changes{v0.9.1}{2025-08-25}{Add ttableau style for experiments with tagging.}
4362 % \texttt{debug tagging} is more expensive, so split this out.
4363 %
4364 % ANGEN: dw i ddim yn meddwl bod crefs yn cynnwys explicit closures?
4365 % ^^A \begin{fstyle}{proof tree copy content to tags}
4366 % Reset \texttt{proof tree copy content}.
4367 % \changes{v0.9.2}{2026-01-19}{\texttt{proof tree copy content to tags} style.}
4368 % \begin{macrocode}
4369 proof tree copy content to tags/.style={%
4370 redeclare tagging keylist={proof tree copy content}{%
4371 %<debug> debug tagging=Copying node contents,
4372 if content={}{}{%
4373 %<debug> debug tagging=Copying node content to alt text,
4374 alt text+/.process={Ow{content}{\ensuremath{##1}}},
4375 %<debug> debug tagging/.process={Ow{alt text}{alt text is ##1}},
4376 },
4377 },
4378 },
4379 % \end{macrocode}
4380 % ^^A \end{fstyle}
4381 % ^^A \begin{fchoice}{tableaux alt text}
4382 % \textbf{This is not a choice key.}
4383 % It is an additional choice for the \texttt{tag nodes uses} key provided by \pkg{ext.tagging}.
4384 % Resets \texttt{tag nodes}.
4385 % \changes{v0.9.2}{2026-01-19}{Use \emph{tagging keylist} \texttt{tag nodes} from \pkg{ext.tagging}.
4386 % Replaces \texttt{proof tree tag nodes}.%
4387 % }
4388 % Adds an option to \texttt{tag nodes uses}.
4389 % \begin{macrocode}
4390 tag nodes uses/tableaux alt text/.style={%
4391 redeclare tagging keylist={tag nodes}{%
4392 %<debug> debug tagging/.process={Ow{id}{Making tags for node with id ##1:}},
4393 %<debug> debug tagging/.process={Ow{alt text}{alt text=##1}},
4394 %<debug> debug tagging/.process={Ow{content}{content=##1}},
4395 %<debug> debug tagging/.process={Ow{proof tree proof line no}{proof tree proof line no=##1}},
4396 %<debug> debug tagging/.process={Ow{just}{just=##1}},
4397 if={>OO!&{proof tree rhifo}{proof tree phantom}}
4398 {%
4399 if line numbering={%
4400 +alt text={\ },
4401 +alt text/.option=proof tree proof line no,
4402 }{},
4403 if justifications={%
4404 %<debug> debug tagging={Looking for a justification ...},
4405 % \end{macrocode}
4406 % Avoid merged justifications when tagging; duplicate shared justifications where possible.
4407 % \begin{macrocode}
4408 if just={}{%
4409 if={> O_= {!u.n children}{2}}{%
4410 if={>O_={!s.just}{}}{}{just/.option=!s.just,},
4411 %<debug> debug tagging/.process={Ow{just}{from sibling just is ##1}},
4412 }{%
4413 temptoksa=,
4414 for nodewalk={%
4415 while nodewalk valid={u}{%
4416 u,
4417 if proof tree phantom={}{%
4418 if n children=2{%
4419 back=1,
4420 s,
4421 temptoksa/.option=just%
4422 }{},
4423 break,
4424 }%
4425 }%
4426 }{},
4427 just/.register=temptoksa,
4428 %<debug> debug tagging/.process={Ow{just}{from ancestor sibling just is ##1}},
4429 },
4430 }{},
4431 if just={}{}{%
4432 alt text+/.process={%
4433 Ow{just}{\ ##1\ }%
4434 },
4435 },
4436 %<debug> debug tagging/.process={Ow{alt text}{alt text is now ##1}},
4437 }{},
4438 %<debug> debug tagging/.process={Ow{alt text}{alt text is now ##1}},
4439 % \end{macrocode}
4440 % \changes{v0.9.2}{2026-01-19}{Replace \texttt{pick up tags} by \texttt{collate}.}
4441 % \begin{macrocode}
4442 }{%
4443 if n children=0{%
4444 delay={%
4445 %<debug> debug tagging=Leaf node,
4446 %<debug> debug tagging=Get closure status,
4447 if={> O_=! O_=! | {proof tree crefs}{} {!uu.proof tree close}{}}
4448 {%
4449 %<debug> debug tagging=Branch is closed,
4450 %<debug> debug tagging/.process={Ow{proof tree crefs}{crefs: ##1}},
4451 %<debug> debug tagging/.process={Ow{!uu.proof tree close}{!uu.proof tree close: ##1}},
4452 %<debug> debug tagging/.process={Ow{content}{content: ##1}},
4453 !uu.alt text+/.process={ORw2{content}{tag close with}{\ ##2\ ##1\ }},
4454 %<debug> debug tagging/.process={Ow{!uu.alt text}{!uu.alt text is now ##1}},
4455 }{%
4456 %<debug> debug tagging=Branch is open,
4457 },
4458 },
4459 }{},
4460 },
4461 },
4462 },
4463 % \end{macrocode}
4464 % ^^A \end{fchoice}
4465 % \changes{v0.9.1}{2025-08-25}{Try to tag tableau.}
4466 % Note that this method would not work for many \pkg{forest} trees and may fail for some tableaux, but should work for most proofs, I think.
4467 % \changes{v0.9.2}{2026-01-19}{\texttt{tag tableau} replaced by \pkg{ext.tagging} library.}
4468 % \changes{v0.9.1}{2025-08-25}{\texttt{tag tableau stage} following \pkg{forest} pattern and noop default style.}
4469 % \changes{v0.9.1}{2025-08-25}{Experimental \texttt{alt} plug for tagging.}
4470 % \changes{v0.9.2}{2026-01-19}{\texttt{alt} plug renamed \texttt{tableaux/alt}.}
4471 % Note this is not just default.
4472 % It is the \textbf{only} option even vaguely compatible with tagging.
4473 % \begin{macrocode}
4474 %<debug> debug tagging/.code={},
4475 % ^^A dadfygio >>>
4476 }
4477 \bracketset{action character=@}
4478 % \end{macrocode}
4479 % \begin{environment}{prooftree}
4480 % \begin{environment}{tableau}
4481 % ^^A <<<
4482 % \cs{forest}/\cs{endforest} from egreg's answer at \url{https://tex.stackexchange.com/a/229608/}
4483 % \begin{macrocode}
4484 \NewDocumentEnvironment{\prooftrees@enw}{ m +b }
4485 {%
4486 \prooftrees@init
4487 \forest
4488 (%
4489 % \end{macrocode}
4490 % Customised definition of stages - we don't use any custom stages, but we do use several custom keylists, where the processing order of these is critical.
4491 %
4492 % Nothing is removed from the standard forest definition - we only change it by adding to it.
4493 % \begin{macrocode}
4494 stages={%
4495 for root'={%
4496 process keylist register=default preamble,
4497 process keylist register=preamble,
4498 },
4499 process keylist=given options,
4500 % \end{macrocode}
4501 % \changes{v0.9.1}{2025-08-23}{Adjust stage processing for new keylists.}
4502 % \texttt{proof tree before typesetting nodes},
4503 % \texttt{proof tree after copying content},
4504 % \texttt{proof tree before packing},
4505 % \texttt{proof tree before computing xy} and
4506 % \texttt{proof tree after annotations}
4507 % just avoid polluting \pkg{forest}'s keylists so they can be used to customise the tableau.
4508 % \texttt{proof tree copy content} is used only for tagging.
4509 % These are internal lists.
4510 % They should not generally be redefined or customised by users, as doing so may render the tree structure invalid or cause unexpected results.
4511 %
4512 % In addition to the keylists provided by \pkg{forest} and \pkg{ext.tagging},
4513 % \texttt{before copying content},
4514 % \texttt{before making annotations} and
4515 % \texttt{before annotating}
4516 % are intended for users to customise the tableau at these points, if required.
4517 % \begin{macrocode}
4518 process keylist=before copying content,
4519 process keylist=proof tree copy content,
4520 process keylist=proof tree after copying content,
4521 process keylist=proof tree before typesetting nodes,
4522 process keylist=before typesetting nodes,
4523 % \end{macrocode}
4524 % First two structural additions: process two custom keylists after before typesetting nodes and before typesetting nodes to shape the tree.
4525 % \begin{macrocode}
4526 process keylist=proof tree ffurf,
4527 process keylist=proof tree symud awto,
4528 typeset nodes stage,
4529 process keylist=proof tree before packing,
4530 process keylist=before packing,
4531 pack stage,
4532 process keylist=proof tree before computing xy,
4533 process keylist=before computing xy,
4534 compute xy stage,
4535 % \end{macrocode}
4536 % Second two structural/content additions: process two custom keylists after computing xy and before before drawing tree to create and attach the annotations.
4537 % \begin{macrocode}
4538 process keylist=before making annotations,
4539 process keylist=proof tree creu nodiadau,
4540 process keylist=before annotating,
4541 process keylist=proof tree nodiadau,
4542 % \end{macrocode}
4543 % Standardish
4544 % \begin{macrocode}
4545 process keylist=proof tree after annotations,
4546 % \end{macrocode}
4547 % Hopefully for doing something useful for tagging.
4548 % \texttt{proof tree tag nodes} and \texttt{collate tags} currently do nothing, but will hopefully eventually be used to collect information for tagging the tableau.
4549 % The ‘public’ keylists are described above.
4550 % \changes{v0.9.2}{2026-01-19}{\texttt{proof tree tag nodes} now a style setting \texttt{tag nodes}.}
4551 % \begin{macrocode}
4552 process keylist=before tagging nodes,
4553 process keylist=tag nodes,
4554 process keylist=before collating tags,
4555 process keylist=collate tags,
4556 % \end{macrocode}
4557 % \changes{v0.9.2}{2026-01-19}{Use \cs{LogTagForestId} and \cs{LogTagForestToks}.}
4558 % \begin{macrocode}
4559 %<debug> TeX={%
4560 %<debug> \if@ttableau@dadfygio
4561 %<debug> \typeout{[Tag tableau debug]:: ID:}%
4562 %<debug> \LogTagForestId
4563 %<debug> \typeout{[Tag tableau debug]:: Accumulated toks:}%
4564 %<debug> \LogTagForestToks
4565 %<debug> \fi
4566 %<debug> },
4567 % \end{macrocode}
4568 % Try to produce some kind of useful stuff for tagging, if active.
4569 % Does nothing right now.
4570 % \changes{v0.9.2}{2026-01-19}{Requires \pkg{forest-lib-ext.tagging}.}
4571 % \begin{macrocode}
4572 process keylist=before tagging tree,
4573 tag tree stage,
4574 % \end{macrocode}
4575 % Standard.
4576 % \changes{v0.9.2}{2026-01-19}{Move \texttt{before drawing tree} to allow user changes in more natural place.}
4577 % \begin{macrocode}
4578 process keylist=before drawing tree,
4579 draw tree stage,
4580 },
4581 )%
4582 % \end{macrocode}
4583 % Apply the proof tree style, which sets keylists from both forest's defaults and our custom additions.
4584 % \begin{macrocode}
4585 proof tree,
4586 % \end{macrocode}
4587 % \changes{v0.9.1}{2025-08-25}{Experimental tagging style, \texttt{ttableau}.}
4588 % \changes{v0.9.2}{2026-01-19}{Remove tagging style, \texttt{ttableau}.}
4589 % Tagging code still conditional, but no longer isolated, so the style which was here can disappear.
4590 %
4591 % Insert user's preamble, empty or otherwise - this allows the user both to override our defaults (e.g.~by setting a non-empty proof statement or a custom format for line numbers) and to customise the tree using forest's facilities in the usual way - BUT customisations of the latter kind may or may not be effective, may or may not have undesirable - not to say chaotic - consequences, and may or may not cause compilation failures (structural changes, in particular, should be avoided completely).
4592 %
4593 % Ref.\ re.\ ordering of \cs{prooftrees@end} before \cs{endforest}: sylwad David Carlisle: \url{https://chat.stackexchange.com/transcript/message/68681858#68681858}.
4594 % \begin{macrocode}
4595 #1,
4596 [, name=proof statement @#2]%
4597 %<debug> \typeout{[Tag tableau debug]:: Executing \prooftrees@end.}
4598 \prooftrees@end
4599 %<debug> \typeout{[Tag tableau debug]:: Executing \endforest.}
4600 \endforest
4601 }{}
4602 % \end{macrocode}
4603 % ^^A >>>
4604 % \end{environment}
4605 % \end{environment}
4606 % \begin{macrocode}
4607 \ExplSyntaxOn
4608 % \end{macrocode}
4609 % \changes{v0.9}{}{Add support for \pkg{memoize} and utilise for documentation.}
4610 % \changes{v0.9.2}{2026-01-19}{Rename internal function \ecs{@@_memoize:n} for consistency (because I named all the new ones with a different prefix \dots.}
4611 % \begin{macro}{\@@_memoize:n}
4612 % \begin{macro}{\@@_memoize:V}
4613 % ^^A memoize <<<
4614 % Internal macro so we don't memoize \pkg{bussproofs}'s \texttt{prooftree} by mistake.
4615 % \begin{macrocode}
4616 \cs_new_protected_nopar:Npn \@@_memoize:n #1
4617 {
4618 \mmzset{
4619 auto = { #1 } { memoize },
4620 }
4621 }
4622 \cs_generate_variant:Nn \@@_memoize:n { V }
4623 % \end{macrocode}
4624 % ^^A memoize >>>
4625 % \end{macro}
4626 % \end{macro}
4627 % ^^A delay to begindocument/before <<<
4628 % Paid â memoize \pkg{bussproofs} \texttt{prooftree} \dots.
4629 % \begin{macrocode}
4630 \hook_gput_code:nnn { begindocument / before } { . }
4631 {%
4632 \@ifpackageloaded{memoize}{
4633 \@@_memoize:V \prooftrees@enw
4634 % \end{macrocode}
4635 % \changes{v0.9.1}{2025-08-25}{Adapt \pkg{memoize} config if tagging or provide conditional.}
4636 % \begin{macrocode}
4637 }{}
4638 % \end{macrocode}
4639 % \begin{macro}{\checkmark}
4640 % \changes{v0.9.1}{2025-08-27}{Use \pkg{unicode-math} rather than \pkg{amssymb} and \pkg{amstext} on Unicode engines, but, in any case, only load what's needed.}
4641 % \changes{v0.9.2}{2026-01-19}{Don't load \pkg{unicode-math}/\pkg{amssymb} just to get \cs{checkmark}.}
4642 % Definition of \cs{checkmark} pilfered from \pkg{amsfonts}.
4643 % \begin{macrocode}
4644 \cs_if_exist:NF \checkmark
4645 {
4646 % \end{macrocode}
4647 % This is wasteful, but less wasteful.
4648 % \cs{DeclareSymbolFont} defines \verb|\csname sym#1\endcsname|.
4649 % \cs{mathhexbox}, \cs{hexnumber@} are in the format.
4650 % \begin{macrocode}
4651 \DeclareSymbolFont{AMSa}{U}{msa}{m}{n}
4652 \edef\checkmark{\noexpand\mathhexbox{\hexnumber@\symAMSa}58}
4653 }
4654 % \end{macrocode}
4655 % \end{macro}
4656 % \begin{macro}{\text}
4657 % \changes{v0.9.2}{2026-01-19}{Don't load \pkg{unicode-math}/\pkg{amstext} just to get \cs{text}.}
4658 % Definition of \cs{text} pilfered from \pkg{amstext}.
4659 % I think \cs{DeclareRobustCommand} is meant to be deprecated, but it still seems to be the go-to for font style definitions (also in the format as far as I know).
4660 % \begin{macrocode}
4661 \cs_if_exist:NF \text
4662 {
4663 \DeclareRobustCommand{\text}
4664 {
4665 \ifmmode\expandafter\text@\else\expandafter\mbox\fi
4666 }
4667 }
4668 % \end{macrocode}
4669 % \end{macro}
4670 % \changes{v0.9.1}{2025-08-28}{Add \cs{toksapp} using format definition of \cs{addto@hook}, in case this is not primitive/already defined.}
4671 % Copy of \LaTeX{}'s \cs{addto@hook}.
4672 % Not used if Lua\TeX{} is used, which defines it as a primitive, or if \pkg{collargs} is loaded (e.g.~for \pkg{memoize}), which provides a more complicated version.
4673 % David Carlisle: \url{https://chat.stackexchange.com/transcript/message/68194858#68194858}.
4674 % \changes{v0.9.2}{2026-01-19}{Remove \cs{toksapp} after moving to \pkg{forest-ext}.}
4675 % \begin{macrocode}
4676 }
4677 % \end{macrocode}
4678 % ^^A delay to begindocument/before >>>
4679 % \changes{v0.9.1}{2025-08-25}{Add \cs{prooftrees@tableau@id}.}
4680 % \changes{v0.9.2}{2026-01-19}{Remove \cs{prooftrees@tableau@id}.}
4681 % ^^A tagsupport <<<
4682 % \begin{macro}{\if@ttableau@dadfygio}
4683 % \changes{v0.9.1}{2025-08-25}{Add \cs{if@ttableau@dadfygio}.}
4684 % for debugging tagging
4685 % \begin{macrocode}
4686 \newif\if@ttableau@dadfygio
4687 \@ttableau@dadfygiofalse
4688 % \end{macrocode}
4689 % \end{macro}
4690 % \changes{v0.9.1}{2025-08-25}{Add \ecs{l_@@_toks_tl}.}
4691 % \changes{v0.9.2}{2026-01-19}{Remove \ecs{l_@@_toks_tl}.}
4692 % \changes{v0.9.1}{2025-08-25}{Add \cs{prooftrees@tableau@toks}.}
4693 % \changes{v0.9.2}{2026-01-19}{Remove \cs{prooftrees@tableau@toks}.}
4694 % \changes{v0.9.2}{2026-01-19}{Remove \ecs{@@_tag_suspend:n}, \ecs{@@_tag_resume:n.}}
4695 % Copied from \pkg{ext.tagging}.
4696 % \begin{macro}{\@@_noop:}
4697 % Something to \cs{let} the end function to.
4698 % \begin{macrocode}
4699 \cs_new_nopar:Npn \@@_noop: {}
4700 % \end{macrocode}
4701 % \end{macro}
4702 % \begin{macro}{\prooftrees@init}
4703 % \begin{macro}{\@@_init:}
4704 % \changes{v0.9.1}{2025-08-25}{Added \ecs{@@_ttableau_init:}.}
4705 % \changes{v0.9.2}{2026-01-19}{Remove \ecs{@@_ttableau_init:}, \cs{prooftrees@ttableau@init}; add \ecs{@@_init:}, \cs{prooftrees@init}.}
4706 % I think I don't really get the ‘plug’ concept.
4707 % It is surely pointless to assign and immediately use one in a package which defines the relevant socket?
4708 % That is, wouldn't a macro or just the code do equally well but faster?
4709 % \begin{macrocode}
4710 \cs_new_protected_nopar:Npn \@@_init:
4711 {
4712 \tag_if_active:TF{
4713 \forestset{
4714 tag=1,
4715 setup~plug=tableaux/alt,
4716 tag~plug=alt,
4717 }
4718 %<debug> \if@ttableau@dadfygio
4719 %<debug> \typeout{Tagging~is~active.}
4720 %<debug> \forestset{
4721 %<debug> debug~tagging/.code={
4722 %<debug> \typeout{[Tag~tableau~debug]::~##1}
4723 %<debug> },
4724 %<debug> }
4725 %<debug> \typeout{[Tag~tableau~debug]::~Assigning~setup~plug~
4726 %<debug> tableaux/alt~for~ext.tagging.}
4727 %<debug> \typeout{[Tag~tableau~debug]::~Using~hook~
4728 %<debug> env/forest/begin.}
4729 %<debug> \fi
4730 \cs_set_protected_nopar:Npn \@@_end:
4731 {
4732 %<debug> \if@ttableau@dadfygio
4733 %<debug> \typeout{[Tag~tableau~debug]::~Using~hook~
4734 %<debug> env/forest/end.}
4735 %<debug> \fi
4736 \hook_use:n {env/forest/end}
4737 }
4738 \hook_use:n {env/forest/begin}
4739 }{
4740 \forestset{tag=0}
4741 %<debug> \if@ttableau@dadfygio
4742 %<debug> \typeout{Tagging~is~not~active.}
4743 %<debug> \fi
4744 }
4745 }
4746 \cs_new_eq:NN \prooftrees@init \@@_init:
4747 % \end{macrocode}
4748 % \end{macro}
4749 % \end{macro}
4750 % \begin{macro}{\prooftrees@end}
4751 % \begin{macro}{\@@_end:}
4752 % \changes{v0.9.2}{2026-01-19}{Remove \ecs{@@_ttableau_end:}, \cs{prooftrees@ttableau@end}; add \ecs{@@_end:}, \cs{prooftrees@end}.}
4753 % From \pkg{ext.tagging}.
4754 % \begin{macrocode}
4755 \cs_new_eq:NN \@@_end: \@@_noop:
4756 \cs_new_protected_nopar:Npn \prooftrees@end { \@@_end: }
4757 % \end{macrocode}
4758 % \end{macro}
4759 % \end{macro}
4760 % \changes{v0.9.1}{2025-08-25}{Added \ecs{@@_ttableau:nnn}, \cs{prooftrees@ttableau}.}
4761 % \changes{v0.9.2}{2026-01-19}{Removed \ecs{@@_ttableau:nnn}, \cs{prooftrees@ttableau}.}
4762 % \changes{v0.9.2}{2025-09-04}{Purify \cs{the}\cs{prooftrees@tableau@toks} before setting \ecs{l_@@_toks_tl}.}
4763 % \changes{v0.9.2}{2026-01-19}{Use \pkg{ext.tagging} library for tagging.%
4764 % Many of the experimental functions/macros/sockets have either been moved there or removed altogether.%
4765 % }
4766 % Custom version of \texttt{alt} plugs for \texttt{tagsupport/forest/setup} and \texttt{tagsupport/forest/tag}.
4767 % The latter is only necessary because the library code insists the plug must exist.
4768 % I should probably change this.
4769 % The former is the only substantive difference: it populates an additional \emph{tagging keylist} and redefines another.
4770 % \begin{macrocode}
4771 \socket_new_plug:nnn {tagsupport/forest/setup}{tableaux/alt}
4772 {
4773 \forestset{
4774 %<debug> debug~tagging={Using~tagsupport/forest/setup~plug~tableaux/alt.},
4775 %<debug> debug~tagging={Executing~proof~tree~copy~content~to~tags.},
4776 proof~tree~copy~content~to~tags,
4777 %<debug> debug~tagging={Executing~tag~nodes~uses~with~value~tableaux~alt~text.},
4778 tag~nodes~uses=tableaux~alt~text,
4779 %<debug> debug~tagging={Executing~collate~tags~uses~with~value~alt~text.},
4780 collate~tags~uses=alt~text,
4781 %<debug> debug~tagging={Executing~tag~tree~uses~with~value~alt.},
4782 tag~tree~uses=alt,
4783 %<debug> debug~tagging={Resetting~tag~nodes~processing~order.},
4784 tag~nodes~processing~order/.nodewalk~style={unique=proof~tree~wffs},
4785 %<debug> debug~tagging={Resetting~collate~tags~processing~order.},
4786 collate~tags~processing~order/.nodewalk~style={every~wff},
4787 %<debug> debug~tagging={Finishing~plug~code.},
4788 }
4789 }
4790 \ExplSyntaxOff
4791 % \end{macrocode}
4792 %</sty>
4793 %^^A sty guards >>>
4794 %
4795 %^^A doc guards <<<
4796 %<*doc>
4797 % \begin{macrocode}
4798 \RequirePackage{svn-prov}
4799 \def\GetFileBaseName#1-#2\nil{#1}
4800 \edef\MyFileBaseName{\expandafter\GetFileBaseName\jobname\nil}
4801 \ProvidesFileSVN[\MyFileBaseName-doc]{$Id: prooftrees.dtx 11666 2026-02-21 01:53:54Z cfrees $}[v0.9.3 \revinfo]
4802 \DefineFileInfoSVN
4803 \AddToHook{begindocument}{\OnlyDescription}
4804 % \end{macrocode}
4805 % ^^A \expandafter\newif\csname ifprooftreescodetoo\endcsname
4806 % ^^A \prooftreescodetoofalse
4807 % \begin{macrocode}
4808 \input{\MyFileBaseName.dtx}
4809 % \end{macrocode}
4810 %</doc>
4811 %^^A doc guards >>>
4812 %
4813 %^^A doc-code guards <<<
4814 %<*doc-code>
4815 % \begin{macrocode}
4816 \RequirePackage{svn-prov}
4817 \def\GetFileBaseName#1-#2\nil{#1}
4818 \edef\MyFileBaseName{\expandafter\GetFileBaseName\jobname\nil}
4819 \ProvidesFileSVN[\MyFileBaseName-code]{$Id: prooftrees.dtx 11666 2026-02-21 01:53:54Z cfrees $}[v0.9.3 \revinfo]
4820 \DefineFileInfoSVN
4821 \AddToHook{begindocument}{\AlsoImplementation}
4822 % \end{macrocode}
4823 % ^^A \expandafter\newif\csname ifprooftreescodetoo\endcsname
4824 % ^^A \prooftreescodetootrue
4825 % \begin{macrocode}
4826 \input{\MyFileBaseName.dtx}
4827 % \end{macrocode}
4828 %</doc-code>
4829 %^^A doc-code guards >>>
4830 %
4831 % \loadgeometry{safonol}%
4832 % \fancyheadoffset[lh]{0pt}%
4833 %
4834 %\Finale
4835 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4836 %^^A vim: et:tw=0:sw=2:ts=2:foldmethod=marker:fmr=<<<,>>>: