This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

11institutetext: 11email: [email protected]

Verification Of Partial Quantifier Elimination

Eugene Goldberg
Abstract

Quantifier elimination (QE) is an important problem that has numerous applications. Unfortunately, QE is computationally very hard. Earlier we introduced a generalization of QE called partial QE (or PQE for short). PQE allows to unquantify a part of the formula. The appeal of PQE is twofold. First, many important problems can be solved in terms of PQE. Second, PQE can be drastically faster than QE if only a small part of the formula gets unquantified. To make PQE practical, one needs an algorithm for verifying the solution produced by a PQE solver. In this paper, we describe a very simple SAT-based verifier called 𝑉𝑒𝑟𝑃𝑄𝐸\mathit{VerPQE} and provide some experimental results.

1 Introduction

Earlier, we introduced a generalization of Quantifier Elimination (QE) called partial QE (or PQE for short) [1]. PQE allows to unquantify a part of the formula. So, QE is just a special case of PQE where the entire formula gets unquantified. The appeal of PQE is twofold. First, it can be much more efficient than QE if only a small part of the formula gets unquantified. Second, many known verification problems like SAT, equivalence checking, model checking and new problems like property generation can be solved in terms of PQE [1, 2, 3, 4, 5]. So, PQE can be used to design new efficient algorithms. To make PQE practical, one needs to verify the correctness of the solution provided by a PQE solver. Such verification is the focus of this paper.

We consider PQE on propositional formulas in conjunctive normal form (CNF)111Every formula is a propositional CNF formula unless otherwise stated. Given a CNF formula FF represented as the conjunction of clauses C1CkC_{1}\wedge\dots\wedge C_{k}, we will also consider FF as the set of clauses {C1,,Ck}\{C_{1},\dots,C_{k}\}. with existential quantifiers. PQE is defined as follows. Let F(X,Y)F(X,Y) be a propositional CNF formula where X,YX,Y are sets of variables. Let GG be a subset of clauses of FF. Given a formula X[F]\exists{X}[F], find a quantifier-free formula H(Y)H(Y) such that X[F]HX[FG]\mbox{$\exists{X}[F]$}\equiv H\wedge\mbox{$\exists{X}[F\setminus G]$}. In contrast to QE, only the clauses of GG are taken out of the scope of quantifiers here (hence the name partial QE). We will refer to HH as a solution to PQE. As we mentioned above, PQE generalizes QE. The latter is just a special case of PQE where G=FG=F and the entire formula is unquantified.

To verify the solution HH above one needs to check if X[F]HX[FG]\mbox{$\exists{X}[F]$}\equiv H\wedge\mbox{$\exists{X}[F\setminus G]$} indeed holds. If derivation of HH is done in some proof system, one can check the correctness of HH by verifying the proof (like it is done for SAT-solvers). Since, PQE is currently in its infancy and no well established proof system exists we use a more straightforward approach. Namely, we present a very simple SAT-based verification algorithm called 𝑉𝑒𝑟𝑃𝑄𝐸\mathit{VerPQE} that does not require any knowledge of how the solution HH is produced. A flaw of 𝑉𝑒𝑟𝑃𝑄𝐸\mathit{VerPQE} is that, in general, it does not scale well. Nevertheless, 𝑉𝑒𝑟𝑃𝑄𝐸\mathit{VerPQE} can be quite useful in two scenarios. First, 𝑉𝑒𝑟𝑃𝑄𝐸\mathit{VerPQE} is efficient enough to handle PQE problems formed from random formulas of up to 70-80 variables. Such examples can can be employed when debugging a PQE solver. Second, 𝑉𝑒𝑟𝑃𝑄𝐸\mathit{VerPQE} can efficiently verify even large PQE problems for a particular class of formulas described in Subsection 4.3.

The paper is structured as follows. Basic definitions are given in Section 2. Section 3 formally describes how a solution to PQE can be verified. The verification algorithm called 𝑉𝑒𝑟𝑃𝑄𝐸\mathit{VerPQE} is presented in Section 4. Section 5 gives experimental results. Some background is provided in Section 6 and conclusions are made in Section 7.

2 Basic Definitions

In this section, when we say “formula” without mentioning quantifiers, we mean “a quantifier-free formula”.

Definition 1

We assume that formulas have only Boolean variables. A literal of a variable vv is either vv or its negation. A clause is a disjunction of literals. A formula FF is in conjunctive normal form (CNF) if F=C1CkF=C_{1}\wedge\dots\wedge C_{k} where C1,,CkC_{1},\dots,C_{k} are clauses. We will also view FF as a set of clauses {C1,,Ck}\{C_{1},\dots,C_{k}\}. We assume that every formula is in CNF unless otherwise stated.

Definition 2

Let FF be a formula. Then 𝑽𝒂𝒓𝒔(𝑭)\mathit{Vars}(F) denotes the set of variables of FF and 𝑽𝒂𝒓𝒔(𝑿[𝑭])\mathit{Vars}(\mbox{$\exists{X}[F]$}) denotes 𝑉𝑎𝑟𝑠(F)X\mbox{$\mathit{Vars}(F)$}\!\setminus\!X.

Definition 3

Let VV be a set of variables. An assignment \vvq\vv{q} to VV is a mapping V{0,1}V^{\prime}~{}\rightarrow\mbox{$\{0,1\}$} where VVV^{\prime}\subseteq V. We will denote the set of variables assigned in \vvq\vv{q}  as 𝑽𝒂𝒓𝒔(𝒒)\mathit{Vars}(\vec{q}). We will refer to \vvq\vv{q} as a full assignment to VV if 𝑉𝑎𝑟𝑠(q)=V\mbox{$\mathit{Vars}(\vec{q})$}=V. We will denote as \vv𝒒\vv𝒓\mbox{$\vv{q}$}\subseteq\mbox{$\vv{r}$} the fact that a) 𝑉𝑎𝑟𝑠(q)𝑉𝑎𝑟𝑠(r)\mbox{$\mathit{Vars}(\vec{q})$}\subseteq\mbox{$\mathit{Vars}(\vec{r})$} and b) every variable of 𝑉𝑎𝑟𝑠(q)\mathit{Vars}(\vec{q}) has the same value in \vvq\vv{q} and \vvr\vv{r}.

Definition 4

A literal and a clause are said to be satisfied (respectively falsified) by an assignment \vvq\vv{q} if they evaluate to 1 (respectively 0) under \vvq\vv{q}.

Definition 5

Let CC be a clause. Let HH be a formula that may have quantifiers, and \vvq\vv{q} be an assignment to 𝑉𝑎𝑟𝑠(H)\mathit{Vars}(H). If CC is satisfied by \vvq\vv{q}, then 𝑪𝒒𝟏\mbox{$C_{\vec{q}}$}\equiv 1. Otherwise, 𝑪𝒒C_{\vec{q}} is the clause obtained from CC by removing all literals falsified by \vvq\vv{q}. Denote by 𝑯𝒒H_{\vec{q}} the formula obtained from HH by removing the clauses satisfied by \vvq\vv{q} and replacing every clause CC unsatisfied by \vvq\vv{q} with CqC_{\vec{q}}.

Definition 6

Given a formula X[F(X,Y)]\exists{X}[F(X,Y)], a clause CC of FF is called quantified if 𝑉𝑎𝑟𝑠(C)\mathit{Vars}(C) X\cap~{}X~{}\neq~{}\emptyset.

Definition 7

Let G,HG,H be formulas that may have existential quantifiers. We say that G,HG,H are equivalent, written 𝑮𝑯G\equiv H, if Gq=Hq\mbox{$G_{\vec{q}}$}=\mbox{$H_{\vec{q}}$} for all full assignments \vvq\vv{q} to 𝑉𝑎𝑟𝑠(G)𝑉𝑎𝑟𝑠(H)\mbox{$\mathit{Vars}(G)$}\cup\mbox{$\mathit{Vars}(H)$}.

Definition 8

Let F(X,Y)F(X,Y) be a formula and GFG\subseteq F and GG\neq\emptyset. The clauses of GG are said to be redundant in 𝑿[𝑭]\exists{X}[F] if X[F]X[FG]\mbox{$\exists{X}[F]$}\equiv\mbox{$\exists{X}[F\setminus G]$}.

Definition 9

Given a formula X[F(X,Y))]\exists{X}[F(X,Y))] and GG where GFG\subseteq F, the Partial Quantifier Elimination (PQE) problem is to find H(Y)H(Y) such that𝑿[𝑭]𝑯𝑿[𝑭𝑮]\mbox{$\exists{X}[F]$}\equiv H\wedge\mbox{$\exists{X}[F\setminus G]$}. (So, PQE takes GG out of the scope of quantifiers.) The formula HH is called a solution to PQE. The case of PQE where G=FG=F is called Quantifier Elimination (QE).

Remark 1

For the sake of simplicity, we will assume that every clause of formula GG in Definition 9 is quantified.

Example 1

Consider the formula F=C1C2C3C4F=C_{1}\wedge C_{2}\wedge C_{3}\wedge C_{4} where C1=x¯3x4C_{1}=\overline{x}_{3}\vee x_{4}, C2=y1x3C_{2}\!=\!y_{1}\!\vee\!x_{3}, C3=y1x¯4C_{3}=y_{1}\vee\overline{x}_{4}, C4=y2x4C_{4}\!=\!y_{2}\!\vee\!x_{4}. Let YY denote {y1,y2}\{y_{1},y_{2}\} and XX denote {x3,x4}\{x_{3},x_{4}\}. Consider the PQE problem of taking C1C_{1} out of X[F]\exists{X}[F] i.e. finding H(Y)H(Y) such that X[F]HX[F{C1}]\mbox{$\exists{X}[F]$}\equiv H\wedge\mbox{$\exists{X}[F\setminus\mbox{$\{C_{1}\}$}]$}. One can show that X[F]y1X[F{C1}]\mbox{$\exists{X}[F]$}\equiv y_{1}\wedge\mbox{$\exists{X}[F\setminus\mbox{$\{C_{1}\}$}]$}. That is, H=y1H\!=\!y_{1} is a solution to the PQE problem above.

Proposition 1

Let HH be a solution to the PQE problem of Definition 9. That is X[F]HX[FG]\mbox{$\exists{X}[F]$}\equiv H\wedge\mbox{$\exists{X}[F\setminus G]$}. Then FHF\Rightarrow H (i.e. FF implies HH).

The proofs of propositions are given in Appendix 0.A.

3 Verification Of A Solution to PQE

Let H(Y)H(Y) be a solution found by a PQE solver when taking GG out of X[F(X,Y)]\exists{X}[F(X,Y)]. That is X[F]HX[FG]\mbox{$\exists{X}[F]$}\equiv H\wedge\mbox{$\exists{X}[F\setminus G]$} is supposed to hold. One can check if this is true (i.e. whether HH is correct) using the proposition below.

Proposition 2

Formula H(Y)H(Y) is a solution to the PQE problem of taking GG out of the scope of quantifiers in X[F(X,Y)]\exists{X}[F(X,Y)] if and only if

  1. a)

    HH is implied by FF;

  2. b)

    GG is redundant in HX[F]H\wedge\mbox{$\exists{X}[F]$} i.e. HX[F]HX[FG]H\wedge\mbox{$\exists{X}[F]$}\equiv H\wedge\mbox{$\exists{X}[F\setminus G]$}

Checking the first condition of Proposition 2 can be done by a SAT-solver. Namely, one just needs to check for every clause CC of HH if FC¯F\wedge\overline{C} is unsatisfiable. (If so, then FCF\Rightarrow C.) Below, we describe how one can check the second condition of Proposition 2 in terms of boundary points.

Definition 10

Let FF be a formula and GG be a non-empty subset of clauses of FF. A full assignment \vvp\vv{p} to 𝑉𝑎𝑟𝑠(F)\mathit{Vars}(F) is called a 𝑮G-boundary point of FF if it falsifies GG and satisfies FGF\setminus G.

The name “boundary point” is due to the fact that if the subset GG is small,\vvp\vv{p} can sometimes be close to the boundary between assignments satisfying and falsifying FF.

Definition 11

Let F(X,Y)F(X,Y) be a formula and GG be a non-empty subset of FF. Let (\vvx\vv{x},\vvy\vv{y}) be a GG-boundary point of FF where \vvx\vv{x} and \vvy\vv{y} are full assignments to XX and YY respectively. The GG-boundary point (\vvx\vv{x},\vvy\vv{y}) is called 𝒀Y-removable (respectively 𝒀Y-unremovable) if formula FyF_{\vec{y}} is unsatisfiable (respectively satisfiable).

Recall that FyF_{\vec{y}} describes the formula FF in subspace \vvy\vv{y}. So the fact that FyF_{\vec{y}} is unsatisfiable (or satisfiable) just means that FF is unsatisfiable (respectively satisfiable) in subspace \vvy\vv{y}. We use the name “YY-removable boundary point” since such a boundary point can be eliminated by adding a clause implied by FF that depends only on variables of YY. Indeed, suppose that (\vvx\vv{x},\vvy\vv{y}) is a YY-removable GG-boundary point. Then FyF_{\vec{y}} is unsatisfiable and hence there is a clause C(Y)C(Y) falsified by \vvy\vv{y} and implied by FF. Note that (\vvx\vv{x},\vvy\vv{y}) is not a GG-boundary point of F{C}F\cup\mbox{$\{C\}$} because it falsifies the formula (F{C})G(F\cup\mbox{$\{C\}$})\setminus G. So, adding CC to FF eliminates the GG-boundary point (\vvx\vv{x},\vvy\vv{y}). On the contrary, a YY-unremovable boundary point (\vvx\vv{x},\vvy\vv{y}) cannot be eliminated by adding a clause falsified by \vvy\vv{y} and implied by FF.

Proposition 3

Let F(X,Y)F(X,Y) be a formula. Let GG be a non-empty subset of clauses of GG. The formula GG is redundant in X[F]\exists{X}[F] if and only if every GG-boundary point of FF (if any) is YY-unremovable.

So, to check the second condition of Proposition 2 one needs to show that every GG-boundary point of HFH\wedge F (if any) is YY-unremovable.

4 Description of 𝑉𝑒𝑟𝑃𝑄𝐸\mathit{VerPQE}

𝑉𝑒𝑟𝑃𝑄𝐸(X[F],G,H)\mbox{$\mathit{VerPQE}$}(\mbox{$\exists{X}[F]$},G,H) {
1 for every CHC\in H {
2 \vvp:=𝑆𝑎𝑡(FC¯)\mbox{$\vv{p}$}:=\mathit{Sat}(F\!\wedge\!\overline{C})
3 if (\vvp𝑛𝑖𝑙\mbox{$\vv{p}$}\neq\mathit{nil})
4 return(false)}
       ————
5 for every CGC\in G {
6 𝑜𝑘:=𝐶ℎ𝑘𝑅𝑒𝑑(X[FH],C)\mathit{ok}\!:=\!\mathit{ChkRed}(\mbox{$\exists{X}[F\!\wedge\!H]$},C)
7 if (𝑜𝑘=𝑓𝑎𝑙𝑠𝑒\mathit{ok}=\mathit{false}) return(false)
8 F:=F{C}F:=F\setminus\mbox{$\{C\}$} }
9 return(true)
Figure 1: 𝑉𝑒𝑟𝑃𝑄𝐸\mathit{VerPQE}

In this section, we describe the algorithm for verification of PQE called 𝑉𝑒𝑟𝑃𝑄𝐸\mathit{VerPQE}.

4.1 High-level view of 𝑉𝑒𝑟𝑃𝑄𝐸\mathit{VerPQE}

A high-level view of 𝑉𝑒𝑟𝑃𝑄𝐸\mathit{VerPQE} is given in Fig. 1. 𝑉𝑒𝑟𝑃𝑄𝐸\mathit{VerPQE} accepts formula X[F]\exists{X}[F], a subset GFG\in F of clauses to take out of the scope of quantifiers and a solution HH to this PQE problem. That is X[F]\exists{X}[F] is supposed to be logically equivalent to HX[FG]H\wedge\mbox{$\exists{X}[F\setminus G]$}. 𝑉𝑒𝑟𝑃𝑄𝐸\mathit{VerPQE} returns true if this equivalence holds and so, HH is a correct solution. Otherwise, 𝑉𝑒𝑟𝑃𝑄𝐸\mathit{VerPQE} returns false.

𝑉𝑒𝑟𝑃𝑄𝐸\mathit{VerPQE} consists of two parts separated by a solid line. In the first part (lines 1-4), 𝑉𝑒𝑟𝑃𝑄𝐸\mathit{VerPQE} just checks if HH is implied by FF. This is done by checking for every clause CHC\in H if FC¯F\wedge\overline{C} is satisfiable. If so, CC is not implied by FF and the solution HH is incorrect. Hence, 𝑉𝑒𝑟𝑃𝑄𝐸\mathit{VerPQE} returns false (line 4). In the second part (lines 5-9), for every clause CGC\in G, the algorithm checks if CC is redundant in X[FH]\exists{X}[F\wedge H] by calling the function 𝐶ℎ𝑘𝑅𝑒𝑑\mathit{ChkRed} (line 6). Namely, 𝐶ℎ𝑘𝑅𝑒𝑑\mathit{ChkRed} checks if X[FH]X[(F{C})H]\mbox{$\exists{X}[F\wedge H]$}\equiv\mbox{$\exists{X}[(F\setminus\mbox{$\{C\}$})\wedge H]$}. If so, CC is removed from FF (line 8). Otherwise, CC is not redundant in X[FH]\exists{X}[F\wedge H] and 𝑉𝑒𝑟𝑃𝑄𝐸\mathit{VerPQE} returns false (line 7). If all clauses of GG can be removed from X[FH]\exists{X}[F\wedge H], then HH is a correct solution and 𝑉𝑒𝑟𝑃𝑄𝐸\mathit{VerPQE} returns true.

4.2 Description of 𝐶ℎ𝑘𝑅𝑒𝑑\mathit{ChkRed}

𝐶ℎ𝑘𝑅𝑒𝑑(X[FH],C)\mbox{$\mathit{ChkRed}$}(\mbox{$\exists{X}[F\wedge H]$},C) {
1 Y:=𝑉𝑎𝑟𝑠(F)XY:=\mbox{$\mathit{Vars}(F)$}\setminus X
2 𝑃𝑙𝑔:=\mbox{$\mathit{Plg}$}:=\emptyset
3 while (true) {
4 F:=(F{C})HF^{\prime}:=(F\setminus\mbox{$\{C\}$})\wedge H
5 (\vvx,\vvy):=𝑆𝑎𝑡(𝑃𝑙𝑔FC¯)(\mbox{$\vv{x}$},\mbox{$\vv{y}$})\!:=\!\mathit{Sat}(\mbox{$\mathit{Plg}$}\!\wedge F^{\prime}\wedge\!\overline{C})
6 if ((\vvx,\vvy)=𝑛𝑖𝑙(\mbox{$\vv{x}$},\mbox{$\vv{y}$})=\mathit{nil})
7 return(true)
8 \vvx:=𝑆𝑎𝑡(FyHy)\mbox{$\vv{x}$}^{*}:=\mathit{Sat}(\mbox{$F_{\vec{y}}$}\wedge\mbox{$H_{\vec{y}}$})
9 if (\vvx=𝑛𝑖𝑙\mbox{$\vv{x}$}^{*}=\mathit{nil})
10 return(false)
11 D:=PlugCls(\vvy,\vvx,F,H)D\!:=\!PlugCls(\mbox{$\vv{y}$},\!\mbox{$\vv{x}$}^{*},\!F,\!H)
12 𝑃𝑙𝑔:=𝑃𝑙𝑔{D}\mbox{$\mathit{Plg}$}:=\mbox{$\mathit{Plg}$}\cup\mbox{$\{D\}$}}   }}
Figure 2: 𝐶ℎ𝑘𝑅𝑒𝑑\mathit{ChkRed}

The pseudocode of 𝐶ℎ𝑘𝑅𝑒𝑑\mathit{ChkRed} is shown in Fig. 2. 𝐶ℎ𝑘𝑅𝑒𝑑\mathit{ChkRed} accepts the formula X[F(X,Y)H(Y)]\exists{X}[F(X,Y)\wedge H(Y)] and a quantified clause CC to be checked for redundancy. 𝐶ℎ𝑘𝑅𝑒𝑑\mathit{ChkRed} returns true if CC is redundant in X[FH]\exists{X}[F\wedge H]. Otherwise, it returns false. To verify redundancy of CC, 𝐶ℎ𝑘𝑅𝑒𝑑\mathit{ChkRed} checks if FHF\wedge H has a YY-removable CC-boundary point. If not, CC is redundant. Otherwise, CC is not redundant.

𝐶ℎ𝑘𝑅𝑒𝑑\mathit{ChkRed} starts with computing the set YY of unquantified variables (line 1). Then it initializes the set of “plugging” clauses (see below). The main work is done in the while loop (lines 3-12). 𝐶ℎ𝑘𝑅𝑒𝑑\mathit{ChkRed} starts with checking if formula FHF\wedge H has a CC-boundary point (lines 4-5) i.e. checking if there is an assignment (\vvx\vv{x},\vvy\vv{y}) satisfying 𝑃𝑙𝑔(F{C})HC¯\mathit{Plg}\wedge(F\setminus\mbox{$\{C\}$})\wedge H\wedge\overline{C}. The formula Plg is used here to exclude the CC-boundary points examined in the previous iterations of the loop. If no (\vvx\vv{x},\vvy\vv{y}) exists, the clause CC is redundant and 𝐶ℎ𝑘𝑅𝑒𝑑\mathit{ChkRed} returns true (line 7).

If the assignment (\vvx\vv{x},\vvy\vv{y}) above exists, 𝐶ℎ𝑘𝑅𝑒𝑑\mathit{ChkRed} checks if formula FyHy\mbox{$F_{\vec{y}}$}\wedge\mbox{$H_{\vec{y}}$} is satisfiable i.e. whether FHF\wedge H is satisfiable in subspace \vvy\vv{y} (lines 8-10). If not, the CC-boundary point (\vvx\vv{x},\vvy\vv{y}) is YY-removable. This means that CC is not redundant in X[FH]\exists{X}[F\wedge H] and 𝐶ℎ𝑘𝑅𝑒𝑑\mathit{ChkRed} returns false (line 10). Otherwise, (\vvx\vv{x},\vvy\vv{y}) is a YY-unremovable boundary point and 𝐶ℎ𝑘𝑅𝑒𝑑\mathit{ChkRed} calls the function PlugCls to build a plugging clause D(Y)D(Y). The latter is falsified by \vvy\vv{y} and so excludes re-examining CC-boundary points in the subspace \vvy\vv{y}. After that, 𝐶ℎ𝑘𝑅𝑒𝑑\mathit{ChkRed} adds DD to the formula Plg and starts a new iteration of the loop.

The simplest way to build DD is to form the longest clause falsified by \vvy\vv{y}. One can try to make DD shorter to exclude a greater subspace from future considerations. Suppose there is \vvy\vvy\mbox{$\vv{y}$}^{*}\subset\mbox{$\vv{y}$} such that the assignment \vvx\mbox{$\vv{x}$}^{*} satisfying FyHy\mbox{$F_{\vec{y}}$}\wedge\mbox{$H_{\vec{y}}$} (found in line 8) still satisfies FyHyF_{\vec{y}^{*}}\wedge H_{\vec{y}^{*}}. This means that every CC-boundary point of the larger subspace \vvy\mbox{$\vv{y}$}^{*} is YY-unremovable too. So, one can add to Plg a shorter plugging clause DD falsified by \vvy\mbox{$\vv{y}$}^{*} rather than \vvy\vv{y}.

4.3 Scalability issues

As we mentioned earlier, 𝑉𝑒𝑟𝑃𝑄𝐸\mathit{VerPQE} consists of two parts. The first part of 𝑉𝑒𝑟𝑃𝑄𝐸\mathit{VerPQE} checks if every clause of the solution HH is implied by FF. In the second part, for every clause CGC\in G, the function 𝐶ℎ𝑘𝑅𝑒𝑑\mathit{ChkRed} checks if CC is redundant in X[FH]\exists{X}[F\wedge H]. (Recall that GG is the subset of clauses that one must take out of X[F]\exists{X}[F].) The first part reduces to |H||H| calls to a SAT-solver. So, it is as scalable as SAT-solving (unless HH blows up as the size of the PQE problem grows). The second part of 𝑉𝑒𝑟𝑃𝑄𝐸\mathit{VerPQE} scales much poorer. The reason is that this part requires enumeration of YY-unremovable CC-boundary points and the number of such points is typically grows exponentially. Besides, the plugging clauses produced by 𝐶ℎ𝑘𝑅𝑒𝑑\mathit{ChkRed} are long. So, adding a plugging clause cannot exclude a big chunk of CC-boundary points at once. So, the size of formulas that can be efficiently handled by 𝑉𝑒𝑟𝑃𝑄𝐸\mathit{VerPQE} is limited by 70-80 variables.

There is however an important case where 𝑉𝑒𝑟𝑃𝑄𝐸\mathit{VerPQE} can efficiently verify large formulas. This is the case where FHF\wedge H does not have any YY-unremovable GG-boundary points. (Since FF and FHF\wedge H have the same YY-unremovable GG-boundary points, this means that FF has no such boundary points either.) Then for every clause CGC\in G, the function 𝐶ℎ𝑘𝑅𝑒𝑑\mathit{ChkRed} immediately finds out that the formula (F{C})HC¯(F\setminus\mbox{$\{C\}$})\wedge H\wedge\overline{C} is unsatisfiable. So, the verification of solution HH reduces to |H|+|G||H|+|G| SAT-checks.

5 Experimental Results

In this section, we experimentally evaluate our implementation of 𝑉𝑒𝑟𝑃𝑄𝐸\mathit{VerPQE}. In this implementation, we used Minisat [6] as an internal SAT-solver. The source of 𝑉𝑒𝑟𝑃𝑄𝐸\mathit{VerPQE} and some examples can be downloaded from [7]. We conducted three experiments in which we verified solutions obtained by the PQE algorithm called 𝐸𝐺\mathit{EG}-𝑃𝑄𝐸+\mathit{PQE}^{+} [5]. In the experiments we solved the PQE problem of taking a clause CC out of formula X[F(X,Y)]\exists{X}[F(X,Y)] i.e. finding a formula H(Y)H(Y) such that X[F]HX[F{C}]\mbox{$\exists{X}[F]$}\equiv H\wedge\mbox{$\exists{X}[F\setminus\mbox{$\{C\}$}]$}. In Subsections 5.1 and 5.2 we consider large formulas appearing in the process of “property generation”. Namely, these formulas were constructed when generating properties of circuits from the HWMCC-13 set as described in [5]. In Subsection 5.3, we consider small random formulas. In the experiments we used a computer with Intel® CoreTM i5-10500 CPU @ 3.10GHz.

5.1 Formulas where all boundary points are removable

In this subsection, we consider the PQE problems of taking CC out of X[F(X,Y)]\exists{X}[F(X,Y)] where all CC-boundary points of FF are YY-removable. In [5], we generated 3,736 of such formulas. In Table 1, we give a sample of 7 formulas. The first column of the table gives the name of the circuit of the HWMCC-13 set used to generate the PQE problem. (The real names of circuits exmp1, exmp2 and examp3 in the HWMCC-13 set are mentorbm1, bob12m08m, and bob12m03m respectively.)

Table 1: 𝑉𝑒𝑟𝑃𝑄𝐸\mathit{VerPQE} on formulas where all boundary points are removable
name cla- vari- size size EG-PQE+ VerPQE
of uses ables of set of HH run run
circ. of FF of FF   YY time (s) time (s)
exmp1 64,365 26,998 4,376  1    0.2    0.03
6s207 73,457 30,540 3,012  6    0.2    0.04
exmp2 84,009 32,147 1,994  1    0.1    0.1
exmp3 94,523 41,354 5,174  825    11    0.4
6s249 226,666 78,289 1,111  1    0.4    0.1
6s428 231,506 92,274 3,790  118    2.8    0.2
6s311 259,086 87,974 519  80    2.0    0.1

The second and third co-lumns give the number of clauses and variables of formula FF. The fourth column shows the size of the set YY i.e. the number of unquantified variables in X[F(X,Y)]\exists{X}[F(X,Y)]. The next column gives the number of clauses in the solution HH found by 𝐸𝐺\mathit{EG}-𝑃𝑄𝐸+\mathit{PQE}^{+}. The last two columns show the time taken by 𝐸𝐺\mathit{EG}-𝑃𝑄𝐸+\mathit{PQE}^{+} and 𝑉𝑒𝑟𝑃𝑄𝐸\mathit{VerPQE} (in seconds) to finish the PQE problem and verify the solution. As we mentioned in Subsection 4.3, if all CC-boundary points of FF are YY-removable the same applies to formula FHF\wedge H. So, 𝑉𝑒𝑟𝑃𝑄𝐸\mathit{VerPQE} should be very efficient even for large formulas. Table 1 substantiates this intuition.

5.2 Formulas with unremovable boundary points

Table 2: 𝑉𝑒𝑟𝑃𝑄𝐸\mathit{VerPQE} on formulas with unremovable boundary points. The time limit is 600 sec.
name cla- vari- size size EG-PQE+ VerPQE
of uses ables of set of HH run run
circ. of FF of FF  YY time (s) time (s)
6s209 25,086 14,868 5,759  5    0.1 >>600
6s413 29,321 14,063 4,343  18    0.2 >>600
6s276 35,810 17,631 3,201  11    0.1 >>600
6s176 39,704 15,754 1,566  0    0.9 >>600
6s207 73,457 30,540 3,012  20    0.5 >>600
6s110 83,396 34,165 807  6    0.2   0.1
6s275 109,328 49,130 3,196  2    0.1 >>600

Here we consider the same PQE problems as in the previous subsection. The only difference is that the formula FF contains CC-boundary points that are YY-unremovable. In [5], we generated 3,094 of such formulas. In Table 2, we give a sample of 7 formulas. The name and meaning of each column is the same as in Table 1.

Table 2 shows that 𝑉𝑒𝑟𝑃𝑄𝐸\mathit{VerPQE} failed to verify 6 out of 7 solutions in the time limit of 600 sec. whereas the corresponding problems were easily solved by 𝐸𝐺\mathit{EG}-𝑃𝑄𝐸+\mathit{PQE}^{+}. (The reason is that 𝐸𝐺\mathit{EG}-𝑃𝑄𝐸+\mathit{PQE}^{+} uses a more powerful technique of proving redundancy of CC than plugging unremovable boundary points as 𝑉𝑒𝑟𝑃𝑄𝐸\mathit{VerPQE} does.) So, solutions HH obtained for large formulas X[F]\exists{X}[F] where FF has a lot of unremovable boundary points cannot be efficiently verified by 𝑉𝑒𝑟𝑃𝑄𝐸\mathit{VerPQE}.

5.3 Random formulas

In this subsection, we continue consider formulas with YY-unremovable CC-boundary points. Only, in contrast to the previous subsection, here we consider small random formulas. In this experiment we verified solutions obtained for formulas whose number of variables ranged from 70 to 85. To get more reliable data, for each size we generated 100 random PQE problems and computed the average result. For each example, the formula FF had 20% of two-literal and 80% of three-literal clauses.

Table 3: 𝑉𝑒𝑟𝑃𝑄𝐸\mathit{VerPQE} on random formulas
num- cla- vari- size size EG-PQE+ VerPQE
ber of uses ables of set of HH run run
prob. of FF of FF  YY time (s) time (s)
 100 140  70  35  28    0.01    1.0
 100 150  75  37  41    0.01    4.7
 100 160  80  40  69    0.03    11.5
 100 170  85  42  63    0.03    98.3

The results of this experiment are shown in Table 3. Let us explain the meaning of each column of this table using its first line. The first column indicates that we generated 100 PQE problems of the same size shown in the next three columns. That is for all 100 problems corresponding to the first line of Table 3 the number of clauses, variables and the size of the set YY was 140, 70 and 35 respectively. The last three columns of the first line show the average results over 100 examples. For instance, the first column of the three says that the average size of the solution HH found by 𝐸𝐺\mathit{EG}-𝑃𝑄𝐸+\mathit{PQE}^{+} was 28 clauses. Table 3 shows that the performance of 𝑉𝑒𝑟𝑃𝑄𝐸\mathit{VerPQE} drastically drops as the number of variables grows due to the exponential blow-up of the set of YY-unremovable CC-boundary points.

6 Some Background

In this section, we give some background on boundary points. The notion of a boundary point with respect to a variable was introduced in [8]. (At the time it was called an essential point). Given a formula F(X)F(X), a boundary point with respect to a variable xXx\in X is a full assignment \vvp\vv{p} to XX such that each clause falsified by \vvp\vv{p} contains xx. Later we showed a relation between a resolution proof and boundary points [9]. Namely, it was shown that if FF is unsatisfiable and contains a boundary point with respect to a variable xx, any resolution proof that FF is unsatisfiable has to contain a resolution on xx. In [10], we presented an algorithm that performs SAT-solving via boundary point elimination.

In [11, 12], we introduced the notion of a boundary point with respect to a subset of variables rather than a single variable. Using this notion we formulated a QE algorithm that builds a solution by eliminating removable boundary points. In [5], we formulated two PQE algorithms called 𝐸𝐺\mathit{EG}-𝑃𝑄𝐸\mathit{PQE} and 𝐸𝐺\mathit{EG}-𝑃𝑄𝐸+\mathit{PQE}^{+}. The algorithm 𝐸𝐺\mathit{EG}-𝑃𝑄𝐸\mathit{PQE} is quite similar to 𝑉𝑒𝑟𝑃𝑄𝐸\mathit{VerPQE} and implicitly employs the notion of a boundary point we introduced here i.e. the notion formulated with respect to a subset of clauses rather than variables. In this report, when describing 𝑉𝑒𝑟𝑃𝑄𝐸\mathit{VerPQE} we use this notion of a boundary point explicitly.

7 Conclusions

We present an algorithm called 𝑉𝑒𝑟𝑃𝑄𝐸\mathit{VerPQE} for verifying a solution to Partial Quantifier Elimination (PQE). The advantage of 𝑉𝑒𝑟𝑃𝑄𝐸\mathit{VerPQE} is that it does need to know how this solution was obtained (e.g. if a particular proof system was employed). So, 𝑉𝑒𝑟𝑃𝑄𝐸\mathit{VerPQE} can be used to debug an any PQE algorithm. A flaw of 𝑉𝑒𝑟𝑃𝑄𝐸\mathit{VerPQE} is that its performance strongly depends on the presence of so-called unremovable boundary points of the formula at hand. If this formula has no such points, 𝑉𝑒𝑟𝑃𝑄𝐸\mathit{VerPQE} can efficiently verify solutions to very large PQE problems. Otherwise, its performance is, in general, limited to small problems of 70-80 variables.

References

  • [1] E. Goldberg and P. Manolios, “Partial quantifier elimination,” in Proc. of HVC-14.   Springer-Verlag, 2014, pp. 148–164.
  • [2] ——, “Software for quantifier elimination in propositional logic,” in ICMS-2014,Seoul, South Korea, August 5-9, 2014, pp. 291–294.
  • [3] E. Goldberg, “Equivalence checking by logic relaxation,” in FMCAD-16, 2016, pp. 49–56.
  • [4] ——, “Property checking without inductive invariant generation,” Tech. Rep. arXiv:1602.05829 [cs.LO], 2016.
  • [5] ——, “Partial quantifier elimination and property generation,” Tech. Rep. arXiv:2303.13811 [cs.LO], 2023.
  • [6] N. Eén and N. Sörensson, “An extensible sat-solver,” in SAT, Santa Margherita Ligure, Italy, 2003, pp. 502–518.
  • [7] The source of 𝑉𝑒𝑟𝑃𝑄𝐸\mathit{VerPQE}, http://eigold.tripod.com/software/ver-pqe.1.0.tar.gz.
  • [8] E. Goldberg, M. Prasad, and R. Brayton, “Using problem symmetry in search based satisfiability algorithms,” in DATE ’02, Paris, France, 2002, pp. 134–141.
  • [9] E. Goldberg, “Boundary points and resolution,” in Proc. of SAT.   Springer-Verlag, 2009, pp. 147–160.
  • [10] E. Goldberg and P. Manolios, “Sat-solving based on boundary point elimination,” in Proc. of HVC-10.   Springer-Verlag, 2011, pp. 93–111.
  • [11] ——, “Removal of quantifiers by elimination of boundary points,” Tech. Rep. arXiv:1204.1746 [cs.LO], 2012.
  • [12] ——, “Quantifier elimination by dependency sequents,” Formal Methods in System Design, vol. 45, no. 2, pp. 111–143, 2014.

Appendix

Appendix 0.A Proofs Of Propositions

Proposition 1

Let HH be a solution to the PQE problem of Definition 9. That is X[F]HX[FG]\mbox{$\exists{X}[F]$}\equiv H\wedge\mbox{$\exists{X}[F\setminus G]$}. Then FHF\Rightarrow H (i.e. FF implies HH).

Proof

By conjoining both sides of the equality with HH one concludes thatHX[F]HX[FG]H\wedge\mbox{$\exists{X}[F]$}\equiv H\wedge\mbox{$\exists{X}[F\setminus G]$}, which entails HX[F]X[F]H\wedge\mbox{$\exists{X}[F]$}\equiv\mbox{$\exists{X}[F]$}. ThenX[F]H\mbox{$\exists{X}[F]$}\Rightarrow H and thus FHF\Rightarrow H.

Proposition 2

Formula H(Y)H(Y) is a solution to the PQE problem of taking GG out of the scope of quantifiers in X[F(X,Y)]\exists{X}[F(X,Y)] if and only if

  1. a)

    HH is implied by FF;

  2. b)

    GG is redundant in HX[F]H\wedge\mbox{$\exists{X}[F]$} i.e. HX[F]HX[FG]H\wedge\mbox{$\exists{X}[F]$}\equiv H\wedge\mbox{$\exists{X}[F\setminus G]$}

Proof

The if part. Given the two conditions above, one needs to prove that X[F]HX[FG]\mbox{$\exists{X}[F]$}\equiv H\wedge\mbox{$\exists{X}[F\setminus G]$}. Assume the contrary i.e. X[F]HX[FG]\mbox{$\exists{X}[F]$}\not\equiv H\wedge\mbox{$\exists{X}[F\setminus G]$}. Consider the two possible cases. The first case is that there exists a full assignment \vvy\vv{y} to YY such that FF is satisfiable in subspace \vvy\vv{y} whereas H(FG)H\wedge(F\setminus G) is unsatisfiable in this subspace. Since FGF\setminus G is satisfiable in the subspace \vvy\vv{y}, HH is unsatisfiable in this subspace. So, FF does not imply HH and we have a contradiction.

The second case is that FF is unsatisfiable in the subspace \vvy\vv{y} whereasH(FG)H\wedge(F\setminus G) is satisfiable there. Then HFH\wedge F is unsatisfiable in subspace \vvy\vv{y} too. So, HX[F]HX[FG]H\wedge\mbox{$\exists{X}[F]$}\neq H\wedge\mbox{$\exists{X}[F\setminus G]$} in subspace \vvy\vv{y} and hence GG is not redundant in HX[F]H\wedge\mbox{$\exists{X}[F]$}. So, we have a contradiction again.

The only if part. Given X[F]HX[FG]\mbox{$\exists{X}[F]$}\equiv H\wedge\mbox{$\exists{X}[F\setminus G]$}, one needs to prove the two conditions above. The first condition (that HH is implied by FF) follows from Proposition 1. Now assume that the second condition (that GG is redundant in HX[F]H\wedge\mbox{$\exists{X}[F]$}) does not hold. That is HX[F]HX[FG]H\wedge\mbox{$\exists{X}[F]$}\not\equiv H\wedge\mbox{$\exists{X}[F\setminus G]$}. Note that if HFH\wedge F is satisfiable in a subspace \vvy\vv{y}, then H(FG)H\wedge(F\setminus G) is satisfiable too. So, the only case to consider here is that HFH\wedge F is unsatisfiable in a subspace \vvy\vv{y} whereas H(FG)H\wedge(F\setminus G) is satisfiable there. This means that FF is unsatisfiable in the subspace \vvy\vv{y}. Then X[F]HX[FG]\mbox{$\exists{X}[F]$}\neq H\wedge\mbox{$\exists{X}[F\setminus G]$} in this subspace and we have a contradiction.

Proposition 3

Let F(X,Y)F(X,Y) be a formula. Let GG be a non-empty subset of clauses of GG. The formula GG is redundant in X[F]\exists{X}[F] if and only if every GG-boundary point of FF (if any) is YY-unremovable.

Proof

The if part. Given that every GG-boundary point of FF is YY-unremovable, one needs to show that GG is redundant in X[F]\exists{X}[F] i.e. X[F]X[FG]\mbox{$\exists{X}[F]$}\equiv\mbox{$\exists{X}[F\setminus G]$}. Assume that this is not true. Then there is a full assignment \vvy\vv{y} to YY such that FF is unsatisfiable in subspace \vvy\vv{y} whereas FGF\setminus G is satisfiable there. This means that there is an assignment (\vvx\vv{x},\vvy\vv{y}) falsifying FF and satisfying FGF\setminus G. Since this assignment falsifies GG, it is a GG-boundary point. This boundary point is YY-removable, because FF is unsatisfiable in subspace \vvy\vv{y}. So, we have a contradiction.

The only if part. Given that GG is redundant in X[F]\exists{X}[F], one needs to show that every GG-boundary point of FF is YY-unremovable. Assume the contrary i.e. there is a YY-removable GG-boundary point of FF. This means that there is an assignment (\vvx\vv{x},\vvy\vv{y}) falsifying GG and satisfying FGF\setminus G such that FF is unsatisfiable in subspace \vvy\vv{y}. Then X[F]X[FG]\mbox{$\exists{X}[F]$}\neq\mbox{$\exists{X}[F\setminus G]$} in subspace \vvy\vv{y} and so, we have a contradiction.