2017 2nd International Conference on Artificial Intelligence: Techniques and Applications (AITA 2017) ISBN: 978-1-60595-491-2
The Logical Difference Between Propositional Horn Theories
Hong LIU, Ren-yan FENG, Xu WANG and Yi-song WANG
*College of Computer Science & Technology, Guizhou University, Guiyang, China
*Corresponding author
Keywords: Horn theory, Logical difference, Forgetting.
Abstract. The logical difference between knowledge bases is an important issue for the dynamic update of knowledge base. Computing the logical difference for knowledge bases is intractable in general, and its result is not necessarily category in the sense that the logical difference between two theories in a class is possibly not in the same class any more. This paper proves that computing logical difference between Horn theories is easier than that of CNF theories, and its result is still Horn expressible, though some deciding problems relating to logical difference are still intractable for Horn theories. A preliminary experiment illustrates an interesting phenomenon for the size of logical differences.
Introduction
The logical difference between knowledge bases is an important issue for the dynamic update of knowledge base. It can be widely used in version control, extracting and reusing for knowledge bases [1,2]. Logical difference is a substantial supplement to the structure-based approach. In [3,4], researchers use a lightweight description logic DL-Lite to study the logic difference between ontologies. For the proposition logic, there is little literature on the notion of logical difference between two knowledge bases. An exception is the syntactic difference of Horn theories [5].
In this article, we investigate the problem of the logical difference of proposition theories, Horn theories in particular, which is an important tractable subclass of CNF theories from the perspective of satisfiability checking [6]. The logical difference of Horn theories may not be Horn, but its result is still Horn expressible. Various computational issues related to the logical difference are investigated and a preliminary experiment is conducted as well.
Preliminaries
We assume an underlying propositional language L over a signature A, written Atom(L). The complement of a set V⊆ Atom (L), written , is the set of atoms existed in Atom (L) but not in V. A
Literal is an atom x or its negated form ¬x. A clause is a disjunction of literals c=l1˅...˅ln where n is the length of the clause, while a term is a conjunction of literals t=l1˄... ˄lm where m is the length of the term. A conjunction of clauses is called a conjunctive normal form (CNF)Γ=˄ici. If a clause contains at most one positive literal, then the clause is called a Horn clause. A Horn formula is conjunction of Horn clauses. A Horn theory is also called a Horn formula.
Given a theory Γ, the set of all the atomic formulas occurring in it, is denoted by Atom(Γ). Let Ψ be a theory and c a clause, and A a set of atoms. If Ψ⊨c, then c is an implicate of Ψ. If c is an implicate of Ψ and Atom(c)⊆A then c is an A-implicate of Ψ. If c is an implicate of Ψ and for any implicate c' of
Ψ, c'⊭c holds, then c isa prime implicate of Ψ. If c is an A-implicate of Ψ and for any A-implicate c' of Ψ, c'⊭ c holds, then c is an A-prime implicate of Ψ. Overall, a prime implicate of Ψ is the strongest result clause of Ψ. We use PI(Ψ)(resp. PIAΨ) to express the set of prime implicates (resp. A-prime implicates) of Ψ.
For any proposition theory Γ and an atom x, forgetting x from Γ, written as Forget(Γ,{x}), is defined as Γ(x,true)˅Γ(x,false). For example, if Γ={(x1˅x2)˄x3} then Forget(Γ,x3)={x1˅x2}.
Forgetting a set of atoms from Γ is defined as Forget(Γ,V∪{p})=Forget(ForgetΓ, p,V).
i. φ≡PIφ (1)
ii. φ≡ψ iff PIψ≡PIφ. (2)
iii. Forget (φ,A)={ψ|Atom(ψ) ⊆A and φ⊨ψ}. (3)
iv. PIAφ≡Forgetφ,A. (4)
v. PIAφ≡PIAψ iff Forgetφ,A≡Forgetψ,A. (5)
Assume A⊆Atom (L), if we have a formula φ' which contains no atom in A such that φ'≡φ, then we say φ is A-irrelevant. It is known that φ is A-irrelevant iff φ≡Forget(φ,A), it means that φ⊨ψ iff Forget (φ,A)⊨ψ, and ψ is A-irrelevant [9]. If two clauses c1, c2 containing complementary literals p and ¬p respectively, we say that it is resolvable on p. The resolvent is denoted by Res(c1,c2,p), which is a clause obtained from the disjunction of c1 and c2 by removing both p and ¬p. Let Γ be a clausal theory, and p be an atom. The exhaustive resolution on p of Γ, written ExRes(Γ,p), consists of Res(c1,c2,p) for every c1 and c2 in Γ. For a set S of atoms, the exhaustive resolution of Γon S, written ExRes(Γ,S), is the set of clauses in ExRes(Γ,p) for each p in S. Logical Difference In this section, we recall the logical difference of proposition logic theories. In an intuitive sense, the logical difference between two theories Γ1 and Γ2 should be the set of all relevant formulas α such that Γ1⊨α and Γ2⊭α or Γ1⊭α and Γ2⊨α. The relativity of α relies on Γ1 and Γ2. Thus, we consider that A is a set of signature atoms and is relevant to Γ1 and Γ2, which means, A⊆Atom (L) and Atom (α)⊆A. Definition 1.(logical difference) For any proposition theories Γ1 and Γ2, A a signature atom set and A⊆Atom(L), the logical difference between them is a set of all clauses α such that Γ1⊨α and Γ2⊭α. We denote it as follows: DiffA(Γ1 ,Γ2)={α is a clause|Atom(α) ⊆ A, Γ1⊨α and Γ2⊭α} (6)
If DiffA(Γ1,Γ2)=DiffA(Γ2,Γ1)=∅, then there is no logical difference between Γ1 and Γ2. Note that in general, DiffA(Γ1,Γ2)≠ DiffA(Γ2,Γ1), and the clause included in DiffA(Γ1,Γ2) is not a tautology. Proposition 2. Let Γ1 and Γ2 be two propositional theories, and A⊆Atom(L). i. DiffA(Γ2,Γ1) is A-irrelevant. (7)
ii. Forget(Γ1,A)⊨ DiffA(Γ1,Γ2). (8)
iii. DiffA(Γ1,Γ2)≡∅ iff Γ2⊨ForgetΓ1,A. (9)
iv. Forget Γ1,A≡\DiffA(Γ1,Γ2) iff Γ2⊭α, for any α∈PIAΓ1. (10) Proof. Every clause in DiffA(Γ1,Γ2) is A-irrelevant as stated in the Definition 1, so we have (7).
Also under the Definition 1, Forget(Γ1,V)⊨α iff if α is V-irrelevant, then Γ1⊨α. So (8) is true. By the
Definition 1 and (8), we have (9).
Definition 2. Assume Γ and Σ are sets of clauses. If Γ⊆Σ and Γ≡Σ, then Γ is an approximation of
Σ. If Γ is an approximation of Σ and for any Γ'⊂Γ, Γ' is not an approximation of Σ, then Γ is the least approximation of Σ.
Since PI(Γ) is the minimal approximation of Γ, which is the set of prime implicates of Γ. It means that we can define the logical difference by the definition of prime implicate. Note that, given a propositional theory Γ and a clause α, Γ⊨α iff there is a clause β∈PIΓ1 s.t. β⊨α [8].
Proof. Forget(Γ,A) ⊨α
iff ∃β∈PIForget(Γ,A) s.t. β⊨α
iff ∃β∈PI(PIAΓ) s.t. β⊨α by Proposition 3.4 [8]
iff ∃β∈PIΓ s.t. β⊨α by Proposition 1.
Proposition 3. Let Γ1 and Γ2 be propositional theories and A⊆Atom(L).
i. (PIAΓ1)\{ α∈PIAΓ1|Γ2⊨α})⊆DiffA(Γ1,Γ2). (11)
ii. (PIAΓ1)\{ α∈PIAΓ1|Γ2⊨α})⊨DiffA(Γ1,Γ2). (12)
Proof. Clearly, since α∈ PIAΓ1 and Γ2⊭α, which means that α∈DiffA(Γ1,Γ2). Then, we have
(11). Assume α is a clause and α∈DiffA(Γ1,Γ2), thus we have Γ1⊨α, Γ2⊭α and Atom(α) ⊆ A.
Since Γ1⊨α and Forget Γ1,A≡PIAΓ1, then PIAΓ1⊨α. If α∈ PIAΓ1, then α∈ PIAΓ1\{ α∈
PIAΓ1|Γ2⊨α}. If α∉ PIAΓ1, then there is a clause β∈PIAΓ1 s.t. β⊨α by Lemma 1. Since Γ2⊭α
and Γ2⊭β, β∈PIAΓ1\{ α∈ PIAΓ1|Γ2⊨α}, which satisfies the condition β⊨α.
The following corollaries easily follows.
Corollary 1. (PIAΓ1)\{ α∈ PIAΓ1|Γ2⊨α}) is the least approximation of DiffA(Γ1,Γ2), and it is
the only one of it.
This corollary shows that (PIAΓ1)\{α∈ PIAΓ1|Γ2⊨α}) may be regarded as one of the least approximation of DiffA(Γ1,Γ2). Because DiffA(Γ1,Γ2) is not closed on logical consequence, that is,
DiffA(Γ1,Γ2)⊨α does not mean α∈ DiffA(Γ1,Γ2). We use DiffA ma
(Γ1,Γ2) to express the least
approximation (PIAΓ1)\{α∈ PIAΓ1|Γ2⊨α}) of DiffA(Γ1,Γ2).
Corollary 2. Let Γ1 and Γ2 be propositional theories and A⊆Atom (L). Then DiffA(Γ1,Γ2)= ∅ iff
DiffAma (Γ1,Γ2)= ∅.
Logical Difference of Horn Theories
As stated in the conception of Forgetting [7], one can use an equation Γ(T/p) ˅Γ(F/p) to express the concept of forgetting an atom p from a theory Γ. The formula Γ(α/p) means that every p occurring in
Γ is replaced by α. Forgetting a set of atoms V is to forget elements in V one by one. What’s more, for any formula Ψ containing no atom p, Γ⊨Ψ iff Γ(T/p)˅Γ(F/p) ⊨Ψ holds. Thus, the following lemma is obvious.
Lemma 2. Let Γ be a clausal theory and V a set of atoms. ExRes(Γ,V) is the result of forgetting V from Γ.
Note that, if Γ is a Horn theory, then Res(Γ,p) is still a Horn thory. According to Lemma 2, the next proposition follows.
Proposition 4. Let Γ1 and Γ2 be two Horn theories, and A⊆Atom (L). There is a Horn theory Γ such
that Γ≡ DiffA(Γ1,Γ2).
Proof.Assume there is a non-Horn clause c, and Atom (c) ⊆ A. We have c ∈ DiffA(Γ1,Γ2), that is,
Γ1⊨c and Γ2⊭c. Note that, since Atom (c)⊆A and Lemma 1, Γ1⊨c iff ExRes(Γ1,A)⊨c. Thus, there are
a Horn clause c', Atom (c')⊆A, ExRes(Γ1,A) ⊨ c', and c'⊨c. Clearly Γ2⊭c', otherwise due to c′ ⊨c,
we have Γ2⊭ c. Thus DiffA(Γ1,Γ2)-{c} is equivalent to DiffA(Γ1,Γ2). It means that we can remove all
non-Horn clauses from DiffA(Γ1,Γ2), then obtain a Horn theory Γ, and it is equivalent to the original
non-Horn theory DiffA(Γ1,Γ2).
Proposition 4 shows that even if Γ2 is not a Horn theory, there is still a Horn theory Γwhich is
equivalent to DiffA(Γ1,Γ2).
Example 1. Assume Γ1={ ¬x1˅¬x3,¬x1˅¬x2˅x3˅¬x4,x2˅¬x3˅¬x4 }, A={ x1,x2,x3,x4 }, Γ2={x1˅x3˅x4,¬x2˅¬x3˅x4,x1˅x2˅¬x4}.
By Definition 1, we can obtain a non-Horn clause ¬x1∨x2∨¬x3∨x4 in DiffA(Γ1,Γ2). But we have
Theorem 1. Let Γ1 and Γ2 be Horn theories, Γ a propositional CNF theory and A a signature which
is relevant to Γ1 and Γ2. Determining whether the clauses in Γ is contained in the logical difference of
Γ1 and Γ2 can be done in polynomial time.
Proof. Determining whether Γ is the logical difference of Γ1 and Γ2, i.e, for any clause α∈Γ,
Atom(α)⊆A, determining Γ1⊨α and Γ2⊭α. Clearly, Γ1⊨α and Γ2⊭α are equivalent to compute the
satisfiability of Γ1∧ ¬α and Γ2∧ ¬α. Note that these two formulas are still Horn theories. Thus
determining whether the clause α in Γ is contained in the logical difference can be switched to compute the satisfiability of Γ1∧ ¬α and Γ2∧ ¬α. Assume the number of clauses of Γ is n. This
problem can be resolved in polynomial time of O(N(|Γ1|+α)(|Γ2|+α)).
The Computational Complexity
In this section some basic complexity relating to logical difference for Horn theories are presented.
Theorem 2. The logical difference of Horn theories Γ1 and Γ2 can be computed in O(2n(|Γ1|+|
Γ2|+|α|+ n(n-|α|))).
Proof. Exhaustively enumerate the set of the candidate Horn clauses deriving from A can be done at most in O(2n) time, and the number of atoms of A is n. It is known [6] that, the problem of deciding whether a Horn theory is satisfiable takes O(N) time, where N is the number of literals occurring in the Horn theory. Then verifying whether Γ1⊨α and Γ2⊭α hold in order at most in O(2n(|Γ1|+| Γ2|+|α|+
n(n-|α|))).
Theorem 3. Let Γ1 and Γ2 be Horn theories, A⊆Atom(L) and α be a clause. (a) Deciding whether
DiffA(Γ1,Γ2)= ∅ is in co-NP. (b) Deciding whether α∈DiffA(Γ1,Γ2) can be done in polynomial time.
Proof. (a) If DiffA(Γ1,Γ2)≠∅, then there is a clause α and Atom(α)⊆A s.t. α∈DiffA(Γ1,Γ2), that is a)
Γ1⊨α and b)Γ2⊭α. Note that Γ1∧ ¬α is still a Horn theory, so its satisfiability can be done in
polynomial time, Γ1⊨α iff Γ1∧ ¬α is unsatisfiable, and Γ2⊭α iff Γ2∧ ¬α is satisfiable. Thus, we can
guess the clause α efficiently by an NP-Oracle and verify conditions a) and b) in polynomial time. Then this problem is in co-NP. (b) Since Γ1∧ ¬α and Γ2∧ ¬α are still Horn theories, deciding their
satisfiability can be done in polynomial time, so this problem is tractable.
Theorem 4. Let Γ1 and Γ2 be Horn theories, A⊆Atom (L) and l a literal. (a) Deciding whether l
occuring in a clause which is contained in DiffA(Γ1,Γ2) is in NP. (b) Deciding whether every clause in
DiffA(Γ1,Γ2) containing l is in co-NP.
Proof. (a) If there is a clause α∈DiffA(Γ1,Γ2) which contains a literal l, then guessing such a clause
and checking whether Atom (α) ⊆A, Γ1⊨α and Γ2⊭α are all tractable. For Γ1 and Γ2 are Horn theories,
then this problem is in NP.
(b) It is similar to the case of (a).
Experimental Results
To compute the logical difference between Horn theories, we implemented a prototype which makes use of the SAT solver minisat. The tested Horn theories and relevant signatures V are randomly
[image:4.612.109.505.647.746.2]generated, where each Horn clause has three literals. The experiment was conducted on Intel(R) Core(TM) i7-4770K CPU running at 3.50GHz with 32G of RAM and a 64 bits Linux system. In each case, 100 groups of Horn theories and relevant signature V are experimented. They all can be done in
Table 1. The number of clausal differences between two Horn theories with N Horn clauses over V varaibles.
N V 1 2 3 4 5 6 7 8 9 10
500 0 0 0 0.07 0.86 4.94 26.64 90.5 390.37 1127.08
a second within about 17M bytes memory. The average number of clauses in their logical difference is reported in Table 1.
It can be seen that the number of clausal differences increases quickly when the relevant variables increase. But when the size of relevant variables is fixed, the number of clausal difference illustrates some phase transition phenomena. In particular, when the number of variables is one or two, there seems no clausal difference.
Summary
In this paper we explore how to determine the existence of the logical difference between any two proposition theories, and if so, how to compute the logical difference. Based on this purpose, we have investigated the logical difference of Horn theories. In our work, we found that the logical difference of Horn theories is not necessarily Horn expressible, and we denote the result by a set of clauses. But there is still a Horn theory equivalent to the logical difference of two Horn theories. Besides, even if
Γ2 is not Horn theory, there is still a Horn theory Γwhich is equivalent to DiffA(Γ1,Γ2).
Several issues remain for further work. One is to conduct more detailed experiments on the logical difference of Horn theories. To improve the basic algorithm for computing logical difference is worthy of doing.
Acknowledgement
This work is partially supported by NSFC under grant 61370161, Stadholder Fund of Guizhou Province under grant (2012)62, Outstanding Young Talent Training Fund of Guizhou Province under grant (2015)01 and Science and Technology Fund of Guizhou Province under grant [2014]7640.
References
[1] B Konev, M Ludwig, D Walther. F Wolter. The Logical Difference for the Lightweight Description Logic EL. Journal of Artificial Intelligence Research, 2012, 44: 633-708.
[2] B Konev, D Walther, F Wolter. The Logical Difference Problem for Description Logic Terminologies //Automated Reasoning, 4th International Joint Conference. Sydney, Australia, 2008: 259-274.
[3] F Sha Sha. Research on Logical Difference of Ontologies. Jilin University, 2011.
[4] R Kontchakov, F Wolter, M Zakharyaschev. Can You Tell the Difference Between DL-Lite Ontologies? //Principles of Knowledge Representation and Reasoning: Proceedings of the Eleventh International Conference. Sydney, Australia, 2008: 285-295.
[5] T Eiter, T Ibaraki, K Makino. On the Difference of Horn Theories//16th Annual Symposium on Theoretical Aspects of Computer Science. Trier, Germany, 1999: 467-477.
[6] W F. Dowling, J H. Gallier: Linear-Time Algorithms for Testing the Satisfiability of Propositional Horn Formulae. Journal of Logic Programming. 1(3): 267-284 (1984).
[7] L. Fangzhen, and R. Reiter. Forget it! In Proceedings of the AAAI Fall Symposium on Relevance, pages 154–159, 1994.
[8] P. Marquis. Handbook of Defeasible Reasoning and Uncertainty Management Systems: Algorithms for Defeasible and Uncertain Reasoning, volume 5, chapter Consequence finding algorithms, pages 41–145. Kluwer Academic Publishers, 1999.
[9] J. Lang, P. Liberatore, and P. Marquis. Propositional independence: Formula-variable independence and forgetting. Journal of Artificial Intelligence Research, 18:391–443, 2003.