Warning: this is an htmlized version!
The original is across this link,
and the conversion rules are here.
Lua 5.1.5  Copyright (C) 1994-2012 Lua.org, PUC-Rio
> dofile "rect.lua"
> tree = { [0]="P&Q->P&R", label="1", 
>>          { [0]="P&R",
>>            { [0]="P", "[P&Q]^1" },
>>            { [0]="R", {[0]="Q", "[P&Q]^1"}, "Q->R" }
>>          } }                                        
> = dedtorect(tree)
         [P&Q]^1
         -------
[P&Q]^1  Q        Q->R
-------  -------------
P        R
----------
P&R
--------1
P&Q->P&R
> tree = {[0]="P&Q->P&Q", label="1", {[0]="P&R", "P", {[0]="R", bar=":", {[0]="Q", "[P&Q]^1"}}}}
> = dedtorect(tree)
   [P&Q]^1
   -------
   Q
   :
P  R
----
P&R
--------1
P&Q->P&Q
> PP(tree)
 {0="P&Q->P&Q", 1={0="P&R", 1="P", 2={0="R", 1={0="Q", 1="[P&Q]^1"}, "bar"=":"}}, "label"="1"}
> 
> tree = {[0]="P&Q->Q&P", bar="=", "?"}
> = dedtorect(tree)
?
========
P&Q->Q&P
> tree = {[0]="P&Q->Q&P", bar="="}
> = dedtorect(tree)

========
P&Q->Q&P
> 
>