Logical inference means to deduce logical propositions from a set of premises. The conventional way to solve logical problems is by truth tables, Boolean algebra (transformation laws), and by a well known tree searching procedure, called resolution. Another symbolic method to this inference problem is natural deduction. Still another way is to use numeric (or quantitative) methods to solve an inference problem; that is to convert the Boolean expressions into linear (or non-linear) constraints in order to prove the logical argument using mathematical programming. This has two advantages: (a) in some cases this leads to faster algorithms, (b) the analysis of the quantitative models leads to the unveiling of hidden mathematical structure. Two further advantages are: (c) symbolic (logical) and numeric (mathematical) knowledge can be mixed and represented in the same framework, (d) default or other non-monotonic knowledge can also be modeled using the same framework.
The satisfiability problem (SAT) is to decide whether a Boolean statement F follows from another statement E; or, in other words, whether E → F is valid. This problem was the first problem proven to be NP-complete. The model here is a small instance of the general satisbiability problem.
One way to solve this problem using mathematical programming is to translate E and F into two CNF. From these two CNFs it is easy to build the two linear system Ax ≥ a and Bx ≥ b. Then we solve the problem:
(where e is a column unit vector, x_{0} is an additional binary variable). If the minimum value x_{0} is 1, then E → F is valid, that is, E implies F.
Another method, that does not use an additional binary x_{0}, is to pick an arbitrary inequations (clause) within Bx ≥ b, say B^{(k)}x ≥ b_{ k}, and to solve the linear problem
If ⌈B^{(k)}x^{*}⌉≥ b_{ k} (with the optimal solution x^{*}), then E implies F. (LPL adopt the second method). Here is a small problem instance.
Is the following argument correct? “If fallout shelters are built, other countries will feel endangered and our people will get a false sense of security. If other countries will feel endangered they may start a preventive war. If our people will get a false sense of security, they will put less effort into preserving peace. If fallout shelters are not built, we run the risk of tremendous losses in the event of war. Hence, either other countries may start a preventive war and our people will put less effort into preserving peace, or we run the risk of tremendous losses in the event of war.” (see [1]).
The following 6 Boolean propositions (binary variables) are introduced:
p "fallout shelters are built" q "other countries will feel endangered" r "other people will get a false sense of security" s "other countries may start a preventive war" t "our people will put less effort into preserving pease" u "we run the risk of tremendous losses in the event of war"
Then the first statement can be formulated as: p → q ∧ r.
The second is to be formulated as: q → s.
The third is: r → t.
The fourth is: ¬p → u.
And the final last statement is: s ∧ t ∨ u.
We therefore have to prove E → F , with :
Transforming the expressions into CNFs gives:
We choose the first clause in F :
The other clause in F is B^{(i)}x ≥ b_{ i} ⇐⇒ u + t ≥ 1
The 5 clauses in E corresponds to the five inequalities as follows:
The complete optimization problem is:
model SAT1 "Satisfibility I";
binary variable
p "fallout shelters are built";
q "other countries will feel endangered";
r "other people will get a false sense of security";
s "other countries may start a preventive war";
t "our people will put less effort into preserving pease";
u "we run the risk of tremendous losses in the event of war";
constraint
s1: p -> q and r;
s2: q -> s;
s3: r -> t;
s4: ~p -> u;
minimize
s5: s and t or u;
Write('%s', if (s5,'The argumentation is correct','The argumentation is not correct'));
--Write('EQU');
end
The IP solver finds that u + s ≥ 1 – that is the objective function is larger or equal than 1. This means that the argument is correct.
The common technique to solve this problem is by resolution and unification, a technique well known in logic and in logic programming languages, such as Prolog. The first step is to negate the consequence and to transform the whole statement into a conjunctive (or disjunctive) normal form, then to prove a contradiction. The CNF of E →¬F of the problem is as follows:
A possible resolution sequence is:
(4) together with (5a) generates the resolvent: p ∨s (6),
(1a) together with (2) generates the resolvent: p ∨ s (7),
(6) together with (7) generates the resolvent: ∨ p.
which produces an empty clause, proving the contradiction. Hence the argument is valid.
Verify how LPL translates these formulae into 0-1-constraints by generating the EQU-file. (Add the Instruction Write(’EQU’);).
Form the LP relaxation of the linear problem generated by LPL and solve it. What do you observe?
The result of LPL is the same as derived above :
min s5: + u + s s1: + q - p >= 0 s2: + s - q >= 0 s3: + t - r >= 0 s4: + u + p >= 1 X37: + r - p >= 0 X38: + u + t >= 1
Solve the following LP relaxation
model x;
variable p;q;r;s;t;u;
minimize obj: + u + s;
constraint
s1: + q - p >= 0;
s2: + s - q >= 0;
s3: + t - r >= 0;
s4: + u + p >= 1;
X58X: + r - p >= 0;
X59X: + u + t >= 1;
end
The optimum is 1. Since we have ⌈B^{(k)}x^{*}⌉≥ 1 and b_{ k} = 1, we also have ⌈B^{(k)}x^{*}⌉≥ b_{ k}, and the argument has been proven using the LP relaxation only. By the way, all clauses are Horn clauses, therefore, the problem is solvable by the LP-relaxation.
[1] Williams H.P. Logical problems and integer programming. Bull. Inst. Math. Appl., 13:18–20, 1977.
[2] MatMod. Homepage for Learning Mathematical Modeling : https://matmod.ch.
[3] Hürlimann T. Reference Manual for the LPL Modeling Language, most recent version. https://matmod.ch/lpl/doc/manual.pdf.