0

I'm currently working on making proof trees for regular expressions in scheme. The suggested way of writing these in the course I'm taking is the following, which I've manually typed into TeX.

Proof Tree

This however, is a tedious process, especially for long expressions. So what I am looking for is a sneaky way to make the type of proof tree shown above, or maybe an alternative, that can accomplish the same.

Edit:

Here is my code, I don't mind typing in the tree, but this way is really, really slow. So if there is a package that can do some of the positioning work for me I'd be a happy camper.

\phantom{ATOM}\ \ \ \ \ 1 is a Scheme integer\qquad\qquad\qquad (\%regexp (atom 2))\\
ATOM ---------------------\qquad\qquad SEQ ------------------------------------------------------------\\
\phantom{ATOM} (\%regexp (atom 1)) \qquad\qquad\qquad\ \ (\%regexp (seq (atom 2) (seq (atom 3) (seq (atom 4) (empty)))\\
\phantom{A}SEQ ---------------------------------------------------------------------------------------------\\
\phantom{ATOM} (\%regexp (seq (atom 1) (seq (atom 2) (seq (atom 3) (seq (atom 4) (empty))))))

Edit 2: I've not kind of found a solution with the bussproofs package, but it's still not optimal, it gets a bit odd looking when the prooftrees get big.

Prooftree

My code for creating this is:

\begin{prooftree}
\def\ScoreOverhang{1pt} 
\def\extraVskip{6pt}
\def\defaultHypSeparation{\hskip .2in}
\def\ruleScoreFiller{\hbox to1.1mm{\hss\vrule width0.9mm height0.4pt depth0.0pt\hss}}
\AxiomC{1 is a Scheme integer}
\LeftLabel{ATOM}
\UnaryInfC{(\%regexp (atom 1))}
\AxiomC{2 is a Scheme integer}
\LeftLabel{ATOM}
\UnaryInfC{(\%regexp (atom 2))}
\AxiomC{3 is a Scheme integer}
\LeftLabel{ATOM}
\UnaryInfC{(\%regexp (atom 3))}
\AxiomC{4 is a Scheme integer}
\LeftLabel{ATOM}
\UnaryInfC{(\%regexp (atom 4))}
\AxiomC{}
\LeftLabel{EMPTY}
\UnaryInfC{(\%regexp (empty))}
\LeftLabel{SEQ}
\BinaryInfC{(\%regexp (seq (atom 4) (empty)))}
\LeftLabel{SEQ}
\BinaryInfC{(\%regexp (seq (atom 3) (seq (atom 4) (empty))))}
\LeftLabel{SEQ}
\BinaryInfC{(\%regexp (seq (atom 2) (seq (atom 3) (seq (atom 4) (empty)))))}
\LeftLabel{SEQ}
\BinaryInfC{(\%regexp (seq (atom 1) (seq (atom 2) (seq (atom 3) (seq (atom 4) (empty))))))}
\end{prooftree}
  • 1
    Could you provide the code you've actually typed to produce that? I'm not sure what you are looking for exactly. There are packages for this kind of tree, of course, but you still have to enter the code for the tree - TeX can't do that for you. Have you checked out the LaTeX for Logicians site? – cfr Apr 28 '17 at 00:03
  • @cfr I've now provided the code I'm using to create the output. –  Apr 28 '17 at 07:45
  • Did you look at this: https://tex.stackexchange.com/questions/468/what-is-the-best-package-out-there-to-typeset-proof-trees ? – Thruston Apr 28 '17 at 08:45
  • Please include the required preamble and document environment. At least 2 packages provide prooftree, for example. (I know you say you use bussproofs, but not everyone will know that's the package which provides prooftree, especially if they know prooftrees provides prooftree. – cfr Apr 28 '17 at 16:55
  • Have you looked at newer options such as ebproof? bussproofs is very popular, though. Also, could you be a bit more specific re. what you mean about them looking 'odd'. What would you like to be different? – cfr Apr 30 '17 at 21:20
  • Also, how would you feel about inputting proofs backwards i.e. conclusion first? – cfr Apr 30 '17 at 21:24

0 Answers0