0
Danny King (kxrs26): Automated Reasoning
Page 1 of 6
04/02/2012
Danny King (kxrs26): Automated Reasoning 1.
Apply resolution to prove that Β¬π is a logical consequence of the following set of propositional formulas π = {π β ((π β¨ π) β§ Β¬(π β§ π)), π β ((π β¨ π ) β§ Β¬(π β§ π)), π β π, Β¬π β π, π β π}.
A formula is a logical consequence of an axiom set if and only if the union of the negation of that formula with the axiom set is unsatisfiable. More concisely; If π βͺ {π} is unsatisfiable then {Β¬π} is a logical consequence of π. First, each formula must be converted into conjunctive normal form. Let π¨ = π β ((π β¨ π) β§ Β¬(π β§ π)) β‘ Β¬π β¨ ((π β¨ π) β§ Β¬(π β§ π)) β‘ Β¬π β¨ ((π β¨ π) β§ (Β¬π β¨ Β¬π)) β‘ Β¬π β¨ π β¨ π β§ Β¬π β¨ (Β¬π β¨ Β¬π) β‘ (Β¬π β¨ π β¨ π β§ (Β¬π β¨ Β¬π β¨ Β¬π)
Let πͺ = π β π β‘ Β¬π β¨ π
Let π© = π β
Let π¬ = π β π β‘ Β¬π β¨ π
Let π« = Β¬π β π β‘ πβ¨π
π β¨ π β§Β¬ π β§π
β‘ Β¬π β¨ π β¨ π β§ Β¬ π β§ π β‘ Β¬π β¨ ((π β¨ π) β§ (Β¬π β¨ Β¬π)) β‘ Β¬π β¨ π β¨ π β§ Β¬π β¨ (Β¬π β¨ Β¬π) β‘ (Β¬π β¨ π β¨ π β§ (Β¬π β¨ Β¬π β¨ Β¬π)
So π βͺ {π} can be expressed as the following clause set:
π βͺ {π} = { π, π, π , π, π, π , π, π, π , π, π, π , π, π , π, π , π, π , {π©}}
Applying resolution on the first two clauses we can obtain Β¬π:
π, π, π , {π, π, π} Β¬π
Applying resolution on the last clause and on the resulting Β¬π from the previous resolution step we obtain the empty set. π, Β¬π
Hence π βͺ π is unsatisfiable and therefore Β¬π is a logical consequence of π.
Danny King (undergraduate of Computer Science at Durham University)
[email protected] www.dannyking.eu
Danny King (kxrs26): Automated Reasoning
0
Page 2 of 6
04/02/2012
2a. Consider the following clause-set F and select appropriate polynomial-time algorithms to decide whether it is renamable Horn.
π = {{Β¬π, π, Β¬π}. {Β¬π, π}, {Β¬π, π, π}, {π}, {π, π, π}, {Β¬π, Β¬π}}
Unit propagation on π has no effect because it contains no unit clauses so first we must define a clause set πβ² consisting of all clauses π, π in π such that the literals π and π are contained in a clause in π.
πβ² = { π, π , π, π , π, π , π, π , π, π , π, π , π, π , π, π , π, π , π, π , π, π }
π is renamable Horn if and only if πβ² is satisfiable. Since πβ² is an instance of 2-SAT it is therefore possible to determine in polynomial time whether it is satisfiable and hence to determine whether π is renamable Horn in polynomial time. We can construct a directed graph π«(πβ² ) where the nodes of π«(πβ² ) are all literals occurring in πβ² and where there is an edge between nodes π and π if and only if πβ² contains the clause π, π . Consider π«(πβ² ) (figure 1). πβ² is unsatisfiable if and only if there exists a variable π of πβ² such that π«(πβ² ) contains a directed path from π to π and a directed path from π to π. If for all variables in πβ² this is not possible then πβ² is satisfiable and therefore π would be renable Horn. Note that directed paths between two nodes can be found in polynomial time and that there are ππ paths to be checked, hence we have a polynomial-time algorithm for 2-SAT. Figure 2 shows the edges reachable from each node in π«(πβ² ). For each node π β {π, π, π, π} there is no path to π. For the node π, there is a path to π, however there is no path from π to π. Therefore there is no path from any variable of πβ² to its complement and back again and hence, π is renamable Horn.
Figure1: π«(πβ² ). Danny King (undergraduate of Computer Science at Durham University)
[email protected] www.dannyking.eu
Danny King (kxrs26): Automated Reasoning
0
04/02/2012
Figure 2: edges reachable from each positive literal in π«(πβ² ). Danny King (undergraduate of Computer Science at Durham University)
[email protected] www.dannyking.eu
Page 3 of 6
0
Danny King (kxrs26): Automated Reasoning
Page 4 of 6
04/02/2012
2b. Consider the same clause-set F and select appropriate polynomial-time algorithms to decide whether it is satisfiable.
To determine whether a formula is satisfiable using a polynomial-time algorithm we must first rename it Horn as the satisfiability of a formula consisting only of horn clauses can be checked in polynomial-time using only unit propagation (UP). In the case of F, we only need to apply UP exhaustivly to determine satisfiability which only takes polynomial time. Consider π: π = {{Β¬π, π, Β¬π}. {Β¬π, π}, {Β¬π, π, π}, {π}, {π, π, π}, {Β¬π, Β¬π}}
All clauses in π are Horn except for {Β¬π, π, π} and {π, π, π}. Renaming π to π and π to π results in:
πβ² = {{Β¬π, π, Β¬π}. {Β¬π, Β¬π}, {Β¬π, Β¬π, π}, {π}, {π, π, Β¬π}, {π, Β¬π}}
All clauses in πβ² are Horn except for {π, π, Β¬π}. Renaming π to π and π to π results in:
πβ²β² = {{Β¬π, Β¬π, Β¬π}. {Β¬π, Β¬π}, {π, Β¬π, π}, {π}, {π, Β¬π, Β¬π}, {π, Β¬π}}
All clauses in πβ²β² are Horn except for {π, Β¬π, π}. Renaming π to π and π to π results in:
πβ²β²β² = {{Β¬π, Β¬π, Β¬π}. {π, Β¬π}, {π, Β¬π, Β¬π}, {π}, {π, Β¬π, Β¬π}, {π, Β¬π}}
All clauses in πβ²β²β² are Horn clauses. As there are no pure literals in πβ²β²β² we need only to apply exhaustive application of unit propagation to determine whether it is satisfiable because unit propagation will never result in a new pure literal. ππ πβ²β²β² = {{Β¬π, Β¬π}. {π, Β¬π}, {π, Β¬π, Β¬π}, {π, Β¬π, Β¬π}, {π}} ππ ππ πβ²β²β²
= {{Β¬π, Β¬π}. {π}, {π, Β¬π}, {π, Β¬π}}
ππ ππ ππ πβ²β²β²
= {{Β¬π, Β¬π}, {π}, {π, Β¬π}}
ππ ππ ππ ππ πβ²β²β² ππ ππ ππ ππ ππ πβ²β²β²
= {{Β¬π}, {π}} = {{
}}
Exhaustive application of unit propagation has resulted in the empty clause and therefore π is unsatisfiable. A renamable Horn clause-set (i.e. F) is unsatisfiable if and only if F |-UR
Danny King (undergraduate of Computer Science at Durham University)
[email protected] www.dannyking.eu
.
Danny King (kxrs26): Automated Reasoning
0
Page 5 of 6
04/02/2012
3.
Recall that PL and UP denote the result of exhaustive application of pure literal elimination and unit propagation, respectively. Give an example of a clause-set F such that π·π³(πΌπ·(π·π³(π))) β πΌπ·(π·π³(π)), with full justification.
Consider the clause set π:
π = {{π, π}, {π, π, π, π}, {π, π}, {π}, {π, π, π, π, π}} πβ² = ππΏ π = {{π, π}, {π, π, π, π}, {π, π}, {π}} πβ²β² = ππ(ππΏ(π)) = {{π, π}, {π, π, π}} πβ²β²β² = ππΏ(ππ(ππΏ(π))) = {{π, π}}
This provides an example of where ππΏ(ππ(ππΏ(π))) β ππ(ππΏ(π)) as πβ²β²β² β πβ²β². Notice that unit propagation on a clause π only has an effect when π contains a unit clause. Also notice that pure literal elimination only removes clauses (not literals) and therefore can never cause new unit clauses to appear in πβ² = ππΏ(π). Unit propagation can however cause pure literals to appear in πβ² = ππ(π) because it can both lead to clause and literal removal in π. In the given example, in πβ²β², unit propagation had caused π to become a pure literal and so in the final step, pure literal elimination resulting in πβ²β²β², the clause containing π was removed.
4. Transform the following FO formula into clausal normal form. (Here R, S are predicate symbols, π is a function symbol, and x, y, z are variables.) Show all steps in your computation.
π = βπβπβπ[πΉ(π, π) β βπβπ(πΊ(π, π) β§ πΉ(π, π(π)))] = βπβπβπ[Β¬πΉ(π, π) β¨ βπβπ(πΊ(π, π) β§ πΉ(π, π(π)))] (Implication removed) = βπβπβπ[Β¬πΉ π, π β¨ βπβπ(πΊ(π, π) β§ πΉ(π, π(π)))] (Renamed inner bound variables: π₯ to π and π¦ to π) = βπβπβπβπβπ[Β¬πΉ π, π β¨ (πΊ(π, π) β§ πΉ(π, π(π)))] (Moved inner quantifiers outward) = βπβπ[Β¬πΉ π, π β¨ (πΊ(π, π(π, π)) β§ πΉ(π(π, π), π(π(π)))] (Skolemised: π becomes the constant π, π becomes π(π) and π becomes π(π, π).)
= βπβπ[(Β¬πΉ(π, π) β¨ πΊ(π, π(π, π))) β§ (Β¬πΉ(π, π) β¨ πΉ(π(π, π), π(π(π))))] (Converted to conjunctive normal form)
= {{Β¬πΉ(π, π), πΊ(π, π(π, π)}, {Β¬πΉ(π, π), πΉ(π(π, π), π(π(π)))}} (Converted to clausal normal form)
Danny King (undergraduate of Computer Science at Durham University)
[email protected] www.dannyking.eu
Danny King (kxrs26): Automated Reasoning
0
Page 6 of 6
04/02/2012
5. Give a closed semantic tree for the following FO clause-set where S; T are predicate symbols, f is a function symbol, a is a constant, and x, y are variables.) Explain your construction.
π = {{π»(π(π))}, {πΊ(π, π(π) ), Β¬π»(π)}, {Β¬πΊ(π, π)}} We construct a semantic tree from the ground atoms of π where each node π has exactly 0 or 2 complimentary ground atoms as children. Also, the child nodes of π do not belong to a lower level of the Herband universe than π and each path from the root node to π (i.e. each Herbrand interpretation) contains no complementary pair of ground atoms. The tree is a closed semantic tree if each branch terminates at a failure vertex, i.e. the nodes on the path from the root to each leaf node falsifies a ground instance of a clause in π.
π―πππππππ
πΌπππππππ ππ π = {π, π(π), π(π(π) ), π(π(π(π) ) ), β¦ } π―πππππππ
π©πππ ππ π = {π»(π), πΊ(π, π), πΊ(π(π), π), πΊ(π, π(π)), πΊ(π(π), π(π)), π»(π(π)), β¦ } π¬πππππππ ππ ππππππ
πππππππππ ππ πππππππ ππ π = {π» π , π»(π(π), π(π, π), π(π, π(π) ), β¦ }
Figure 3: Closed semantic tree for π.
The two leaves labelled πΊ(π, π) falsify the ground instance {Β¬πΊ(π, π)}} of the third clause in π: {Β¬πΊ(π, π)}}. The two leaves labelledΒ¬π»(π(π)) falsify the ground instance {π»(π(π))} of the first clause in π: {π»(π(π)}. The two leaves labelled πΊ(π, π(π)) falsify ground instance {Β¬πΊ(π, π(π))}} of the third clause in π: {Β¬πΊ(π, π)}}. The two leaves labelled Β¬πΊ(π, π(π)) falsify ground instance {πΊ(π, π(π)), Β¬π»(π)}} of the third clause in π: {Β¬πΊ(π, π)}}.
Danny King (undergraduate of Computer Science at Durham University)
[email protected] www.dannyking.eu