Compute a clausal normal form of the above formula by applying the CNF transformation algorithm with naming and optimisation based on polarities of subformulas.
(2) Compute a clausal normal form of the above formula by applying the CNF transformation algorithm with naming and optimisation based on polarities of subformulas.
Label
Counterpart
Polarity
Raw
+
-
+
-
-
+
+
,
The clausal normal form of the above is therefore:
Formalise the following argument and verify whether it is correct:
If I stay late at work today, then I finish my assignments.
Either I stay late at work or I walk my dog, and I cannot do both.
Therefore, I either walk my dog or finish my assignments.
Note that verifying whether an argument is correct means proving a statement of the form: from the hypotheses , the conclusion follows. That is, you need either to formally prove or exhibit a counterexample for the statement.
Solution
Formalising:
Transforming:
forces . Assuming simplifies both and :
which are contradictory statements, meaning is UNSAT. Therefore, the entailment holds:
Problem 3. (20 points)
Problem 3. (20 points)
Let be a set of clauses such that each clause in contains at most one negative literal. Give an algorithm that decides the satisfiability of in polynomial time. Justify the correctness of your algorithm and explain the polynomial-time decidability of your solution.
Solution
Let be a clause. Given our constraint, has one of two forms:
;
.
In the first case, we can rewrite as the implication
If all are false, the clause reduces to and therefore forces .
Algorithm:
Let be the set of atoms which have been forced to be false.
Correctness: Whenever the algorithm adds an atom to , every model of must assign . This follows by induction over the additions to .
Initially, is added only if . Every model of must therefore assign .
Suppose that the claim holds for all atoms already in . If the algorithm adds because
and , then every model assigns all by the induction hypothesis. The clause can then only be satisfied by , so every model must assign .
If the algorithm returns UNSAT, it has found a positive clause
with . Every model would have to assign all literals in this clause to false, contradicting that it satisfies the clause. Hence, is unsatisfiable.
Otherwise, consider the interpretation returned by the algorithm:
Every positive clause contains some ; otherwise, the algorithm would have returned UNSAT. Therefore, and the clause is satisfied.
Consider a clause . If , then and satisfies the clause. If , then some ; otherwise, the propagation rule would have added to . Thus, and the clause is again satisfied.
Hence, satisfies every clause in , so is a model of . The algorithm therefore returns SAT if and only if is satisfiable.
Polynomial-time decidability: Let be the set of atoms in and let be the total number of literal occurrences. One complete scan of takes time. Every scan either adds at least one new atom to or terminates, and each atom can be added to at most once. Therefore, there are at most scans, giving the running time
where are constants, is a unary function symbol, is an array constant, are interpreted in the array theory, and are interpreted in the standard way over the integers.