Article · Wikipedia archive · Last revised Jun 20, 2026

RecycleUnits

In mathematical logic, proof compression by RecycleUnits is a method for compressing propositional logic resolution proofs. Its main idea is to make use of intermediate 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.

Last revised
Jun 20, 2026
Read time
≈ 7 min
Length
1,667 w
Citations
1
Source

In mathematical logic, proof compression by RecycleUnits1 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.

Algorithms

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
      
    
    {\displaystyle P}
  
):
2      Let 
  
    
      
        U
      
    
    {\displaystyle U}
  
 be the set of non leaf nodes representing unit clauses
3      for each 
  
    
      
        u
        
        U
      
    
    {\displaystyle u\in U}
  
 do
4          Mark the ancestors of u
5          for each unmarked 
  
    
      
        n
        
        P
      
    
    {\displaystyle n\in P}
  
 do
6              let 
  
    
      
        p
      
    
    {\displaystyle p}
  
 be the pivot variable of 
  
    
      
        n
      
    
    {\displaystyle n}
  

7              let 
  
    
      
        l
      
    
    {\displaystyle l}
  
 be the literal contained in the clause of 
  
    
      
        u
      
    
    {\displaystyle u}
  

8              if 
  
    
      
        p
        ==
        l
      
    
    {\displaystyle p==l}
  
 then
9                  replace the left parent of 
  
    
      
        n
      
    
    {\displaystyle n}
  
 with 
  
    
      
        u
      
    
    {\displaystyle u}
  

10             else if 
  
    
      
        ¬
        p
        ==
        l
      
    
    {\displaystyle \neg p==l}
  
 then
11                 replace the right parent of 
  
    
      
        n
      
    
    {\displaystyle n}
  
 with 
  
    
      
        u
      
    
    {\displaystyle 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
      
    
    {\displaystyle n}
  
):
3      if 
  
    
      
        n
      
    
    {\displaystyle n}
  
 is visited return
4      mark 
  
    
      
        n
      
    
    {\displaystyle n}
  
 as visited
5      if 
  
    
      
        n
      
    
    {\displaystyle n}
  
 has no parents return
6      else if 
  
    
      
        n
      
    
    {\displaystyle n}
  
 has only one parent 
  
    
      
        x
      
    
    {\displaystyle x}
  
 then
7          ReconstructProof(
  
    
      
        x
      
    
    {\displaystyle x}
  
)
8          
  
    
      
        n
      
    
    {\displaystyle n}
  
.Clause = 
  
    
      
        x
      
    
    {\displaystyle x}
  
.Clause
9      else
10         let 
  
    
      
        l
      
    
    {\displaystyle l}
  
 be the left and 
  
    
      
        r
      
    
    {\displaystyle r}
  
 the right parent node
11         let 
  
    
      
        p
      
    
    {\displaystyle p}
  
 be the pivot variable used to compute 
  
    
      
        n
      
    
    {\displaystyle n}
  

12         ReconstructProof(
  
    
      
        l
      
    
    {\displaystyle l}
  
)
13         ReconstructProof(
  
    
      
        r
      
    
    {\displaystyle r}
  
)
14         if 
  
    
      
        p
        
        l
        .
        C
        l
        a
        u
        s
        e
      
    
    {\displaystyle p\in l.Clause}
  
 and 
  
    
      
        p
        
        r
        .
        C
        l
        a
        u
        s
        e
      
    
    {\displaystyle p\in r.Clause}
  

15             
  
    
      
        n
      
    
    {\displaystyle n}
  
.Clause = Resolve(
  
    
      
        l
      
    
    {\displaystyle l}
  
,
  
    
      
        r
      
    
    {\displaystyle r}
  
,
  
    
      
        p
      
    
    {\displaystyle p}
  
)
16         else if 
  
    
      
        p
        
        l
        .
        C
        l
        a
        u
        s
        e
      
    
    {\displaystyle p\in l.Clause}
  
 and 
  
    
      
        p
        
        r
        .
        C
        l
        a
        u
        s
        e
      
    
    {\displaystyle p\notin r.Clause}
  

17             
  
    
      
        n
      
    
    {\displaystyle n}
  
.Clause = 
  
    
      
        r
      
    
    {\displaystyle r}
  
.Clause
18             delete reference to 
  
    
      
        l
      
    
    {\displaystyle l}
  

19         else if 
  
    
      
        p
        
        r
        .
        C
        l
        a
        u
        s
        e
      
    
    {\displaystyle p\in r.Clause}
  
 and 
  
    
      
        p
        
        l
        .
        C
        l
        a
        u
        s
        e
      
    
    {\displaystyle p\notin l.Clause}
  

20             
  
    
      
        n
      
    
    {\displaystyle n}
  
.Clause = 
  
    
      
        l
      
    
    {\displaystyle l}
  
.Clause
21             delete reference to 
  
    
      
        r
      
    
    {\displaystyle r}
  

22         else
23             let 
  
    
      
        x
        
        {
        l
        ,
        r
        }
      
    
    {\displaystyle x\in \{l,r\}}
  
 and 
  
    
      
        y
        
        {
        l
        ,
        r
        }
        
        {
        x
        }
      
    
    {\displaystyle y\in \{l,r\}\setminus \{x\}}
  
 //choose x heuristically
24             
  
    
      
        n
      
    
    {\displaystyle n}
  
.Clause = 
  
    
      
        x
      
    
    {\displaystyle x}
  
.Clause
25             delete reference to 
  
    
      
        y
      
    
    {\displaystyle y}
  

Example

Consider the following resolution proof.
One intermediate result is C 8 {\displaystyle C_{8}} which is representing the unit clause (-1).

( 1 ) ( 2 ) ( 1 ) C 1 ( 1 , 3 ) C 2 ( 1 , 2 , 5 ) C 3 ( 2 , 3 , 5 ) C 4 ( 1 , 2 ) C 7 ( 1 , 3 , 5 ) ( 4 ) C 5 ( 1 , 4 ) C 6 ( 1 , 4 ) C 8 ( 1 ) C 9 ( 3 , 5 ) {\displaystyle (1){\cfrac {(2){\cfrac {(1){\cfrac {C_{1}(1,3)\qquad C_{2}(-1,2,5)}{C_{3}(2,3,5)}}\qquad C_{4}(1,-2)}{C_{7}(1,3,5)}}\qquad (4){\cfrac {C_{5}(-1,4)\qquad C_{6}(-1,-4)}{\color {red}C_{8}(-1)}}}{C_{9}(3,5)}}}

There is one non-ancestor node using the variable 1 as a pivot element: C 3 {\displaystyle C_{3}} .

( 1 ) ( 2 ) ( 1 ) C 1 ( 1 , 3 ) C 2 ( 1 , 2 , 5 ) C 3 ( 2 , 3 , 5 ) C 4 ( 1 , 2 ) C 7 ( 1 , 3 , 5 ) ( 4 ) C 5 ( 1 , 4 ) C 6 ( 1 , 4 ) C 8 ( 1 ) C 9 ( 3 , 5 ) {\displaystyle (1){\cfrac {(2){\cfrac {{\color {red}(1)}{\cfrac {C_{1}(1,3)\qquad C_{2}(-1,2,5)}{C_{3}(2,3,5)}}\qquad C_{4}(1,-2)}{C_{7}(1,3,5)}}\qquad (4){\cfrac {C_{5}(-1,4)\qquad C_{6}(-1,-4)}{C_{8}(-1)}}}{C_{9}(3,5)}}}

The literal -1 is contained in the right parent of this node and therefore this parent is replaced by C 8 {\displaystyle C_{8}} . The string C 8 {\displaystyle {C_{8}}^{*}} denotes a reference to the clause C 8 {\displaystyle C_{8}} (the structure is now a directed acyclic graph rather than a tree).

( 1 ) ( 2 ) ( 1 ) C 1 ( 1 , 3 ) C 8 C 3 ( 2 , 3 , 5 ) C 4 ( 1 , 2 ) C 7 ( 1 , 3 , 5 ) ( 4 ) C 5 ( 1 , 4 ) C 6 ( 1 , 4 ) C 8 ( 1 ) C 9 ( 3 , 5 ) {\displaystyle (1){\cfrac {(2){\cfrac {(1){\cfrac {C_{1}(1,3)\qquad {\color {red}{C_{8}}^{*}}}{C_{3}(2,3,5)}}\qquad C_{4}(1,-2)}{C_{7}(1,3,5)}}\qquad (4){\cfrac {C_{5}(-1,4)\qquad C_{6}(-1,-4)}{C_{8}(-1)}}}{C_{9}(3,5)}}}

This structure is not a legal proof anymore, because C 3 {\displaystyle C_{3}} is not the resolvent of C 1 {\displaystyle C_{1}} and C 8 {\displaystyle C_{8}} . Therefore it has to be transformed into one again.
The first step is to update C 3 {\displaystyle C_{3}} . As the pivot variable 1 appears in both parent nodes, C 3 {\displaystyle C_{3}} is computed as the resolvent of them.

( 1 ) ( 2 ) ( 1 ) C 1 ( 1 , 3 ) C 8 C 3 ( 3 ) C 4 ( 1 , 2 ) C 7 ( 1 , 3 , 5 ) ( 4 ) C 5 ( 1 , 4 ) C 6 ( 1 , 4 ) C 8 ( 1 ) C 9 ( 3 , 5 ) {\displaystyle (1){\cfrac {(2){\cfrac {(1){\cfrac {C_{1}(1,3)\qquad {C_{8}}^{*}}{C_{3}{\color {red}(3)}}}\qquad C_{4}(1,-2)}{C_{7}(1,3,5)}}\qquad (4){\cfrac {C_{5}(-1,4)\qquad C_{6}(-1,-4)}{C_{8}(-1)}}}{C_{9}(3,5)}}}

The left parent node of C 7 {\displaystyle C_{7}} does not contain the pivot variable and therefore the clause of this parent is copied into the clause of C 7 {\displaystyle C_{7}} . The link between C 7 {\displaystyle C_{7}} and C 4 {\displaystyle C_{4}} is removed and since there are no other links to C 4 {\displaystyle C_{4}} this node can be deleted.

( 1 ) ( 1 ) C 1 ( 1 , 3 ) C 8 C 3 ( 3 ) C 7 ( 3 ) ( 4 ) C 5 ( 1 , 4 ) C 6 ( 1 , 4 ) C 8 ( 1 ) C 9 ( 3 , 5 ) {\displaystyle (1){\cfrac {{\cfrac {(1){\cfrac {C_{1}(1,3)\qquad {C_{8}}^{*}}{C_{3}(3)}}}{C_{7}{\color {red}(3)}}}\qquad (4){\cfrac {C_{5}(-1,4)\qquad C_{6}(-1,-4)}{C_{8}(-1)}}}{C_{9}(3,5)}}}

Again the left parent of C 9 {\displaystyle C_{9}} does not contain the pivot variable and the same operation is performed as before.

( 1 ) C 1 ( 1 , 3 ) ( 4 ) C 5 ( 1 , 4 ) C 6 ( 1 , 4 ) C 8 ( 1 ) C 3 ( 3 ) C 7 ( 3 ) C 9 ( 3 ) {\displaystyle {\cfrac {\cfrac {(1){\cfrac {C_{1}(1,3)\qquad (4){\cfrac {C_{5}(-1,4)\qquad C_{6}(-1,-4)}{C_{8}(-1)}}}{C_{3}(3)}}}{C_{7}(3)}}{C_{9}{\color {red}(3)}}}}

Note: the reference C 8 {\displaystyle {C_{8}}^{*}} was replaced by the actual proof node C 8 {\displaystyle C_{8}} .
The result of this proof is the unit clause (3) which is a stronger result than the clause (3,5) of the original proof.

Notes

Notes

  1. Bar-Ilan, O.; Fuhrmann, O.; Hoory, S.; Shacham, O.; Strichman, O. Linear-time Reductions of Resolution Proofs. Hardware and Software: Verification and Testing, p. 114–128, Springer, 2011.