Drawing proof trees easily


I have always wanted to draw proof trees in an intuitive and easy-to-edit way, like you can do with qtree for ordinary linguistic trees. And I have finally figured out a way to do that.

Suppose you want to draw a tree like the following:
           saw     Mary 
        ---------  ---- 
 John   (NP\S)/NP   NP 
 ----   ---------------  
  NP        NP\S
  --------------
       S 
 
Using semantic.sty, you need to write the following LaTeX code to produce the output. (There are other packages but complexities of the codes are similar.)
 \inference
    { \inference{John}{NP}
    & \inference{\inference{saw}{(NP \bsl S)/NP}
                 \inference{Mary}{NP}}
                {NP \bsl S}}
    {S}
 
This is just very unintuitive and difficult to edit.

So, I wrote an emacs lisp function that automatically converts trees written in the following simpler format to the above format:
%DERIV-BEGIN
[ [ John {NP}] 
  [ [ saw {(S{\bsl}NP)/NP}]  
    [ Bill {NP}] {S{\bsl}NP}] 
  {S}]
%DERIV-END
 
(The lines %DERIV-BEGIN and %DERIV-END are for marking the places for proof trees in the whole source file. The emacs lisp function applies only to regions marked by these tags.)

By calling the function my-infr-format, a new file filename.tex.tmp will be created (assuming that the original file was filename.tex) which is identical to the original source file except that all of the trees are converted to the semantic.sty format.


This document was translated from LATEX by HEVEA.