In mathematical logic, proof compression by RecycleUnits[1] is a method for compressing propositional logic resolution proofs.Its main idea is to make use of intermediate (e.g. non input) proof results being unit clauses, i.e. clauses containing only one literal. Certain proof nodes can be replaced with the nodes representing these unit clauses.After this operation the obtained graph is transformed into a valid proof.The output proof is shorter than the original while being equivalent or stronger.
The algorithms treat resolution proofs as directed acyclic graphs, where each node is labeled by a clause and each node has either one or two predecessors called parents. If a node has two parents it is also labeled with a propositional variable called the pivot, which was used to compute the nodes clause using resolution.
The following algorithm describes the replacement of nodes.
It is assumed that in the resolution proof for all non leaf nodes with two parent nodes, the left parent node contains the positive and the right parent node the negative pivot variable.The algorithm first iterates over all non leaf unit clauses and then over all non ancestor nodes of the proof. If the node's pivot element is the variable of the present unit clause's literal, one of the parent nodes can be replaced by the node corresponding to the unit clause. Because of the above assumption, if the literal is equal to the pivot, the left parent contains the literal and can be replaced by the unit clause node. If the literal is equal to the negation of the pivot the right parent is replaced.
1 function RecycleUnits(Proof
P
U
u\inU
n\inP
p
n
l
u
p==l
n
u
\negp==l
n
u
In general after execution of this function the proof won't be a legal proof anymore.The following algorithm takes the root node of a proof and constructs a legal proof out of it.The computation begins with recursively calls to the children nodes. In order to minimize the algorithm calls, it is beingt kept track of which nodes were already visited. Note that a resolution proof can be seen as a general directed acyclic graph as opposed to a tree.After the recursive call the clause of the present node is updated. While doing so four different cases can occur.The present pivot variable can occur in both, the left, the right or in none of the parent nodes. If it occurs in both parent nodes the clause is calculated as resolvent of the parent clauses.If it is not present in one of the parent nodes the clause of this parent can be copied. If it misses in both parents one has to choose heuristically.
1 function ReconstructProof(Node
n
n
n
n
n
x
x
n
x
l
r
p
n
l
r
p\inl.Clause
p\inr.Clause
n
l
r
p
p\inl.Clause
p\notinr.Clause
n
r
l
p\inr.Clause
p\notinl.Clause
n
l
r
x\in\{l,r\}
y\in\{l,r\}\setminus\{x\}
n
x
y
Consider the following resolution proof.
One intermediate result is
C8
(1)\cfrac{ (2)\cfrac{ (1)\cfrac{C1(1,3) C2(-1,2,5)}{C3(2,3,5)} C4(1,-2) } {C7(1,3,5)} (4)\cfrac{C5(-1,4) C6(-1,-4)}{\color{red}C8(-1)} } { C9(3,5) }
There is one non-ancestor node using the variable 1 as a pivot element:
C3
(1)\cfrac{ (2)\cfrac{ {\color{red}(1)}\cfrac{C1(1,3) C2(-1,2,5)}{C3(2,3,5)} C4(1,-2) } {C7(1,3,5)} (4)\cfrac{C5(-1,4) C6(-1,-4)}{C8(-1)} } { C9(3,5) }
The literal -1 is contained in the right parent of this node and therefore this parent is replaced by
C8
* | |
{C | |
8} |
C8
(1)\cfrac{ (2)\cfrac{ (1)\cfrac{C1(1,3) {\color{red}
*}}{C | |
{C | |
3 |
(2,3,5)} C4(1,-2) } {C7(1,3,5)} (4)\cfrac{C5(-1,4) C6(-1,-4)}{C8(-1)} } { C9(3,5) }
This structure is not a legal proof anymore, because
C3
C1
C8
C3
C3
(1)\cfrac{ (2)\cfrac{ (1)\cfrac{C1(1,3)
*}{C | |
{C | |
3 |
{\color{red}(3)}} C4(1,-2) } {C7(1,3,5)} (4)\cfrac{C5(-1,4) C6(-1,-4)}{C8(-1)} } { C9(3,5) }
The left parent node of
C7
C7
C7
C4
C4
(1)\cfrac{ \cfrac{ (1)\cfrac{C1(1,3)
*}{C | |
{C | |
3 |
(3)} } {C7{\color{red}(3)}} (4)\cfrac{C5(-1,4) C6(-1,-4)}{C8(-1)} } { C9(3,5) }
Again the left parent of
C9
\cfrac{ \cfrac{ (1)\cfrac{C1(1,3) (4)\cfrac{C5(-1,4) C6(-1,-4)}{C8(-1)}}{C3(3)} } {C7(3)} } { C9{\color{red}(3)} }
Note: the reference
* | |
{C | |
8} |
C8