There are a couple of weeks that I am trying to understand how I can eliminate/remove from the analysis some clauses in a propositional formula. For example, I have this formula:
$\phi_m = x \wedge (\neg y \vee x) \wedge (\neg x \vee y) \wedge (\neg c \vee x) \wedge (\neg d \vee x) \wedge (\neg a \vee y) \wedge (\neg b \vee y) \wedge (a \vee b \vee \neg y) $
I want to evaluate only those clauses that contain variables $\mathcal{Select} = \{y, a, b\}$, i.e., the $\phi_m$ becomes
$\phi_m' = (\neg y \vee x) \wedge (\neg x \vee y) \wedge (\neg a \vee y) \wedge (\neg b \vee y) \wedge (a \vee b \vee \neg y)$
As you can see, I keep the clauses as they are, I do not remove the other (not to be selected) variables if there is at least one variable in that clause that is required to be selected. E.g., the first 2 clauses contain the variable $x$ (not required to be selected) because those clauses contain the variable $y$ which is specified to be selected.
Well, till now, what I am doing is generating a new formula $\phi_m'$ by removing those clauses that do not have any variable specified in the $\mathcal{Select}$ set.
But, as I would like to operate in the same formula $\phi_m$, I tried to adapt the idea of assumptions, or selector variables. To apply this idea, I inserted a selector variable in each clause, as in the following (see the variables $\mathcal{A} = \{p, q, r, s, t, u, v, n\})$:
$\phi_m = (p \vee x) \wedge (q \vee \neg y \vee x) \wedge (r \vee \neg x \vee y) \wedge (s \vee \neg c \vee x) \wedge (t \vee \neg d \vee x) \wedge (u \vee \neg a \vee y) \wedge (v \vee \neg b \vee y) \wedge (n \vee a \vee b \vee \neg y) $
As I have understand, and tried in a solver so many times using the assumptions, when I assume that the selector variables from $\mathcal{A}$ are $false$ then those clauses are selected. Which is Cool. But, when I give any assumtion to $true$ and I analyse the generated models from the formula (and these models are very important for me, as they help me to analyse the semantics of my problems) then I get far more models as the other variables in the clause that is meant to be eliminated, they are becoming free (taking values $true$ and $false$).
For example, if I assume that the selector variable $s = true$ then the 4rth clause in $\phi_m$ insetad of becoming $TRUE$, the variables $\{c, x\}$ are still shown in my models and taking once with values $true$ then $false$.
Sorry, for a long explanation, but I need to know what I am missing when I want to apply the method of selector variables? Is there a way to really eliminate the clauses like commenting it, or removing physically as I am doing, while we use only a single formula $\phi_m$?
Thanks for any help, or references.
Edit.
I saw another method for eliminating the variables (not specifically clauses, as I have written here), using existential quantifications. For example, in your case (@Bram28 - most probably you know but just to demonstrate here), if we want to remove the variable B, then we quantify it with values $T$ for True then $F$ for False as in the following:
$\phi = (a \vee b) \wedge (\neg a \vee b) \wedge \neg b$
$\phi_{remove B}' = ((a \vee T) \wedge (\neg a \vee T) \wedge \neg T) \vee ((a \vee F) \wedge (\neg a \vee F) \wedge \neg F) $
$\phi_{remove B}' = F \vee (a \wedge \neg a \wedge T) = a \wedge \neg a$ which, in this case is UnSat, but just for demonstration.
Well, there are some reasons why I avoided this solution:
The formula is becoming twice longer, and should be iterated for each variable that has to be removed,
I am analyzing quite large formulas, and I wanted to analyze only excerpts of this large formula (let say in an incremental way!). The selected excerpts are really small parts of this large formula, so I wanted to
selectthose relevant clauses instead of processing the whole formula toremoveso many variables.I wanted to keep the dependency of a selected variable with another unselected variable that is in the same clause. By removing clauses (not variables as with the existential quantifiers) I am still keeping a kind of dependency between the variables $A$ and $B$.
I am trying to avoid writing another algorithm, as I have then to measure still it's efficiency, and it's not my primary interest :( - that's why I started to use an existing solver.