A logic-algebraic tool for reasoning with Knowledge-Based Systems
José A. Alonso-Jiménez, Gonzalo A. Aranda-Corral, Joaquín Borrego-Díaz, M. Magdalena Fernández-Lebrón, M. José Hidalgo-Doblado
AA logic-algebraic tool for reasoning withKnowledge-Based Systems , Gonzalo A. Aranda-Corral , Joaqu´ınBorrego-D´ıaz , M. Magdalena Fern´andez-Lebr´on , M. Jos´eHidalgo-Doblado Departamento de Ciencias de la Computaci´on e Inteligencia Artificial, E.T.S.Ingenier´ıa Inform´atica, Universidad de Sevilla, Avda. Reina Mercedes s.n.41012-Sevilla, Spain Department of Information Technology, Universidad de Huelva Crta. Palos de LaFrontera s/n. 21819 Palos de La Frontera. Spain Departamento de Matem´atica Aplicada I, E.T.S. Ingenier´ıa Inform´atica, Universidadde Sevilla, Avda. Reina Mercedes s.n. 41012-Sevilla, Spain
Abstract
A detailed exposition of foundations of a logic-algebraic model for reasoningwith knowledge bases specified by propositional (Boolean) logic is presented.The model is conceived from the logical translation of usual derivatives onpolynomials (on residue rings) which is used to design a new inference rule ofalgebro-geometric inspiration. Soundness and (refutational) completeness ofthe rule are proved. Some applications of the tools introduced in the paperare shown.
Keywords:
Polynomial Semantics, Symbolic Computing, AutomatedDeduction, Knowledge-Based Systems
1. Introduction
Algebraic models for logic have been revealed as a useful tool for know-ledge representation and mechanized reasoning. The relationship betweencertain algebraic structures and Computational Logic provides methods andtools for building, compiling and reasoning with Knowledge-Based Systems This work was partially supported by TIN2013-41086-P project (Spanish Ministry ofEconomy and Competitiveness), co-financed with FEDER funds.
Preprint submitted to Elsevier a r X i v : . [ c s . L O ] S e p KBS) (see e.g. [1] for an introduction). This relationship also providesmathematical foundations for a number of Knowledge Representation andReasoning (KRR) methods and algorithms, encompassing applications sincethe pioneer works for classical bivalued logic [2, 3] to extensions for multi-valued logics [4, 5, 6, 7]. The framework has also been extended to otherlogics for Artificial Intelligence (AI) as the paraconsistent logic [8], and eventowards other nonstandard reasoning tasks as the argument-based one (cf.[9]). One of the benefits of the interpretation of logic in polynomial rings isthat enables the use of powerful algebraic tools as Gr¨obner Basis to compileKBS, exploiting this way the use of advanced Computer Algebra Systems inKRR.Roughly speaking, algebraic models for logic are mainly based on to spec-ify, obtain and exploit solutions for the logical entailment problem and otherrelated ones. Recall that the entailment problem in logic is stated as follows:given a Knowledge Base (KB) K , and a formula F , to decide whether F isa logical consequence from K (denoted by K | = F ), that is, whether everymodel of K is also model of F .This paper is focused in to expound with detail an(other) algebraic modelfor KRR. Whilst aforementioned approaches do not need to design a new cal-culus (ideal membership translation -through Gr¨obner Basis- of entailmentquestion is sufficient), the approach presented here consists of to design aninference rule -called independence rule - from an algebraic operation on poly-nomials . This rule will allow address a number of other related problems.Although the independence rule is inspired in Algebra, the idea is in-timately related with KRR strategies which are oriented to mitigate thecomplexity and size of the KB (which may be of large size), with the hopeof reducing the computational cost of the deductive process when it is ap-plied into specialized contexts or use cases. Two strategies of this type areinteresting for the purposes of the paper and motivate this work.The first is to facilitate the design of divide-and-conquer strategies todeal with the entailment problem, a natural idea for managing KBs withhundreds of thousands of logical axioms with big size logical language (forexample the strategy based on the reasoning with microtheories [11]). Inthis case the problem of ensuring the completeness of the designed strategyarises, being a critical issue the selection/synthesis of sound sub-KBs. In [12] The part of the paper devoted to this is an extended version of [10]. K to K (cid:48) , where K | = K (cid:48) , andin K (cid:48) only the language of the goal formula F is used (thus it is expected thatthe size of K (cid:48) to be smaller than the size of K ). Then the entailment problemwith respect to K (cid:48) is considered. For this strategy to be successful -valid andcomplete- K must be a conservative extension of K (cid:48) (or, equivalently, K (cid:48) a conservative retraction of K [10]). A knowledge base K (cid:48) in the language L (cid:48) is a conservative retraction of K if K is an extension of K (cid:48) such that every L (cid:48) -f´ormula entailed by K is also entailed by K (cid:48) . Then the use of conservativeretraction allows to reduce the own KB we need to work, because it sufficesto conservatively retracts the original KB to the specialized language of theformula-goal. A key question is how to compute such kind of sub-KBs.Whilst conservative extensions have been deeply investigated in severalfields of Mathematical Logic and Computer Science (because they allow theformalization of several notions concerning refinements and modularity, seee.g. [13, 14, 15]), solutions focused on its dual notion, the conservative re-traction, are obstructed by its logical complexity (see e.g. [16]).Beside the analysis of above strategy, as a secondary motivation of theapproach, it is worth to mention the study of relevance in knowledge bases.To analyze, locate and remove redundancies in KB is a way to refine andimprove the efficiency of KBS. These type of analysis are important in topicssuch as probabilistic reasoning, information filtering, etc. (see also [16] for ageneral overview).The basic mechanism to obtain conservative retractions consists of elim-inating, step by step, the variables that we wish to eliminate from language.Such a mechanism is called variable forgetting. Since the first analysis incognitive robotics [17], the problem of variable forgetting is a widely stud-ied technique in IA. In particular the forgetting variable technique has beenused to update or refine (logical, rule-based, CSP) programs. For examplefor resolution-based reasoning in specialized contexts (see e.g. [18]), in CSPand optimization [19], for simplification of rules [20] (included Answer SetProgramming [21]). As it can be seen from these references, the interest intechniques for forgetting variables is not limited to classical (monotonous)3ogics. It has also received attention in the field of non-monotonous rea-soning (including the computational complexity of the problems). In the(epistemic) modal logics for (multi)agency this technique would be very use-ful to represent knowledge-based games [22, 23]. In addition, in the reasoningunder inconsistency the use of variable forgetting allows to weaken the KBto obtain consistent subKBs (eliminating the variables involved in the incon-sistency). This topic, discussed below, is studied as a tool for solving SAT.In this context, providing methods for variable forgetting is a step towardsthe availability of retraction algorithms for programming paradigms basedon logics of different nature.Taking into account the aforementioned motivations, the aim of this pa-per is twofold. First, we intend to present a complete and detailed expositionof the foundations of the independence rule (That can be considered a toolfor variable forgetting), whose basic ideas were published in [10], since nodetailed exposition has been published until now. In fact, we generalize thecited paper by stating the results for any operator that induces a conserva-tive retraction, leading as consequence that our case, the independence rule,is useful to compute the retractions. It is also illustrated how the rule isuseful to design methods for solving some questions on KB. In particular theredundancy problem can be handled by the independence rule and Booleanderivatives (an essential tool to design this rule).The structure of the paper is as follows. Section 2 is devoted to sum-marize the basics on the algebraic interpretation of propositional logics. InSect. 3 the notion of forgetting operator is introduced, and we show how con-servative retractions can be computed by means of these kind of operators,as well as logical calculus induced by them are sound and (refutationally)complete. Section 4 presents a forgetting operator inspired on the projectionof algebraic varieties. The logical translation of the operator is presented asa inference rule in Sect. 5. Boolean derivatives are used for characterizinglogical relevance (in the case of sensitive variables) in algebraic terms (insection 6, Prop. 6.3). Some illustrative applications of the tools presentedare described in Sect. 7. The paper finishes with a discussion on the resultspresented in the paper as well as some ideas about future work.
2. Background
In this section fundamental relations between propositional logic andpolynomials with coefficients in finite fields (in our case, the finite field with4 igure 1: The framework two elements, F ) are summarized. The main idea guiding the algebraic in-terpretation of logic is to identify a logical formula as a polynomial in sucha way that the truth-value function induced by the formula could be under-stood as a polynomial function on F .The diagram showed above (Fig. 1) depicts the relationship between bothstructures, whose elements will be detailed in the following subsections. Theideal I := (cid:104) x + x , . . . , x n + x n (cid:105) ⊆ F [ x ] -on which we will talk about later-is used, and the map proj is the natural projection on the quotient ring. Theremain elements of the diagram will be detailed bellow.We assume throughout the paper that the reader is familiar with proposi-tional logic as well as with basic principles on polynomial algebra on positivecharacteristics. A propositional language is a finite set L = { p , . . . , p n } of propositionalsymbols (also called propositional variables). The set of formulas F orm ( L )is built up from in the usual way, using the standard connectives ¬ , ∧ , ∨ , → and (cid:62) ( (cid:62) denotes the constant true , and ⊥ is ¬(cid:62) ). Given two formulas F, G and p ∈ L , we denote F { p/G } the formula obtained replacing everyoccurrence of p in F by the formula G .An interpretation (or valuation) v is a function v : L → { , } . Aninterpretation v is a model of F ∈ F orm ( L ) if it makes F true in the usualclassical truth functional way. Analogously, it is said that a v is a model of K ( v | = K ) if v is model of every formula in K . We denote by M od ( F ) theset of models of F (resp. M od ( K ) for the set of models of K ).5 formula F (or K a KB) is consistent if it exhibits at least one model.It is said that K entails F ( K | = F ) if every model of K is a model of F ,that is, M od ( K ) ⊆ M od ( F ). Both notions can be naturally generalized to aKB, preserving the same notation. It is said that K and K (cid:48) are equivalent, K (cid:48) ≡ K , if K | = K (cid:48) and K (cid:48) | = K . The same notation will also be used forthe equivalence with (and between) formulas.It is said that K is an extension of K (cid:48) if L ( K (cid:48) ) ⊆ L ( K ) and ∀ F ∈ F orm ( L ( K (cid:48) ))[ K (cid:48) | = F = ⇒ K | = F ] K is a conservative extension of K (cid:48) (or K (cid:48) is a conservative re-traction of K ) if it is an extension such that every logic consequence of K expressed in the language L ( K (cid:48) ) is also consequence of K (cid:48) , ∀ F ∈ F orm ( L ( K (cid:48) ))[ K | = F = ⇒ K (cid:48) | = F ]that is, K extends K (cid:48) but no new knowledge expressed by means of L ( K (cid:48) )is added by K .Given L (cid:48) ⊆ L ( K ), a conservative retraction on the language L (cid:48) alwaysexists. The canonical conservative retraction of K to L (cid:48) is defined as:[ K, L (cid:48) ] = { F ∈ Form( L (cid:48) ) : K | = F } That is, [ K, L (cid:48) ] is the set of L (cid:48) -formulas which are entailed by K . In fact anyconservative retraction on L (cid:48) is equivalent to [ K, L (cid:48) ]. The actual issue is topresent a finite axiomatization of such formula set. F [ x ]The ring F [ x ] is naturally chosen for working with algebraic interpreta-tions of logic. To clarify the notation, an identification p i (cid:55)→ x i (or p (cid:55)→ x p )between L and the set of indeterminates is fixed.Notation on polynomials is standard. Given α = ( α , . . . , α n ) ∈ N n , letus define | α | := max { α , . . . , α n } . By x α we denote the monomial x α · · · x α n n .The degree of a ( x ) ∈ F [ x ], is deg ∞ ( a ( x )) :=max {| α | : x α is a monomial of a } .If deg ∞ ( a ( x )) ≤
1, the polynomial a ( x ) we shall denote a polynomial for-mula . It is defined deg i ( a ( x )) as the degree w.r.t. x i .6 .3. Translation from formulas and vice versa The translation of Propositional Logics into Polynomial Algebra is basedon the following translation (see Fig. 1, left diagram):The map P : F orm ( L ) → F [ x ] is defined by: • P ( ⊥ ) = 0 , P ( p i ) = x i , P ( ¬ F ) = 1 + P ( F ) • P ( F ∧ F ) = P ( F ) · P ( F ) • P ( F ∨ F ) = P ( F ) + P ( F ) + P ( F ) · P ( F ) • P ( F → F ) = 1 + P ( F ) + P ( F ) · P ( F ), and • P ( F ↔ F ) = 1 + P ( F ) + P ( F )For the reciprocal translation (from poynomials to formulas) we use themap Θ : F [ x ] → F orm ( L ) defined by: • Θ(0) = ⊥ , Θ(1) = (cid:62) , Θ( x i ) = p i , • Θ( a · b ) = Θ( a ) ∧ Θ( b ), and Θ( a + b ) = ¬ (Θ( a ) ↔ Θ( b )).It can be proved that Θ( P ( F )) ≡ F and P (Θ( a )) = a . Sometimes, for thesake of readability, we will use the following property, that is a straightfor-ward consequence of the previous assertions:Θ(1 + a + ab ) ≡ Θ( a ) → Θ( b ) F n The similar functional behavior of the formula F and its polynomial trans-lation P ( F ) is the basis of the relationship between logical semantics andpolynomial functions. Let’s clarify what similar behavior means: • From valuations to points : Given a valuation v : L → { , } , the truthvalue of F with respect to v agrees with the value of P ( F ) on the pointof o v ∈ F n defined by the values provided by v : if ( o v ) i = v ( p i ) then v ( F ) = P ( F )(( o v ) , . . . ( o v ) n ) • From points to valuations : Each o = ( o , . . . , o n ) ∈ F n induces a valua-tion v o defined by: v o ( p i ) = 1 ⇐⇒ o i = 17his way v o | = F ⇐⇒ P ( F )( o v ) + 1 = 0 ⇐⇒ o v ∈ V (1 + P ( F ))where V ( . ) is the well-known algebraic vanishing operator (see e.g. [24]:given a ( x ) ∈ F [ x ], V ( a ( x )) = { o ∈ F n : a ( o ) = 0 } Summarizing we provide two maps among the set of valuations and pointsof F n , which are bijections between models of the formula F and points fromthe algebraic variety determined by 1 + P ( F ); M od ( F ) → V (1 + P ( F )) v (cid:55)→ o v V (1 + P ( F )) → M od ( F ) o (cid:55)→ v o For example, consider the formula F = p → p ∧ p . The associated poly-nomial is P ( F ) = 1 + x + x x x . The valuation v = { ( p , , ( p , , ( p , } is model of F and induces the point o v = (0 , , ∈ F , which belongs to V (1 + P ( F )) = V ( x + x x x ). Consider now the right-hand side diagram of Fig. 1. To simplify the re-lation between the semantics of propositional logic and geometry over finitefields we use the map Φ : F [ x ] → F [ x ]Φ( (cid:88) α ∈ I x α ) := (cid:88) α ∈ I x sg ( α ) being sg ( α ) := ( δ , . . . , δ n ), where δ i is 0 if α i = 0 and 1 otherwise.The map Φ selects the representative element of the equivalence classof the polynomial in F [ x ] / I that is a polynomial formula. So to associatea polynomial formula to a propositional formula F it suffices to apply thecomposition π := Φ ◦ P , that we will call polynomial projection . Forexample, P ( p → p ∧ p ) = 1 + x + x x whereas π ( p → p ∧ p ) = 1 + x + x x .6. Propositional Logic and polynomial ideals We recall here the well-known correspondence between algebraic sets andpolynomial ideals on the coefficient field F , and propositional logic KBs.Given a subset X ⊆ ( F ) n , we denote by I ( X ) the set (actually an alge-braic ideal) of polynomials of F [ x ] vanishing on X : I ( X ) = { a ( x ) ∈ F [ x ] : a ( u ) = 0 for any u ∈ X } Symmetrically, given J ⊆ F [ x ] it is possible to consider the previouslymentioned algebraic set V ( J ), the “vanishing set”: V ( J ) = { u ∈ ( F ) n : a ( u ) = 0 for any a ( x ) ∈ J } Nullstellensatz theorem for F is stated as follows (see e.g. [8]): Theorem 2.1. (Nullstellensatz theorem with the coefficient field F ) • If A ⊆ F n , then V ( I ( A )) = A , and • for every J ∈ Ideals ( F [ x ]) , I ( V ( J )) = J + I . From the Nullstellensatz theorem it follows that: F ≡ F (cid:48) if and only if P ( F ) = P ( F (cid:48) ) (mod I )Therefore F ≡ F (cid:48) if and only if π ( F ) = π ( F (cid:48) ).The following theorem summarizes the main relationship between propo-sitional logic and F [ x ]: Theorem 2.2. (see e.g. [4]) Let K = { F , . . . , F m } and G be a propositionalformula. The following conditions are equivalent: { F , . . . , F m } | = G .
2. 1 + P ( G ) ∈ (cid:104) P ( F ) , . . . , P ( F m ) (cid:105) + I . V (cid:104) P ( F ) , . . . , P ( F m ) (cid:105) ⊆ V (cid:104) P ( G ) (cid:105) Remark 2.3.
If the use of Gr¨obner basis is considered, above conditions areequivalent to: . NF (1 + P ( G ) , (cid:104) P ( F ) , . . . , P ( F m ) (cid:105) + I ) = 0 where GB ( I ) denotes the Gr¨obner basis of ideal I and NF ( p , B ) denotes a normal form of polinomial p respect to the Gr¨obner basis B . The completedescription on Gr¨obner basis is not within the scope of this paper. A generalreference for Gr¨obner Basis could be seen in [25]. Readers can find in [5] aquick tour on the use of Gr¨obner Basis in Propositional Logic. igure 2: Semantic interpretation of a forgetting operator for the variable r (LiftingLemma) Given K be a KB, let us define the ideal J K = ( { P ( F ) : F ∈ K } )Note that by Thm. 2.2 it is easy to see that v | = K ⇐⇒ o v ∈ V ( J K )
3. Conservative retractions by forgetting variables
In this section we present how to calculate a conservative retraction byusing forgetting operators. These operators are maps of type: δ : F orm ( L ) × F orm ( L ) → F orm ( L ) Definition 3.1.
Let be δ an operator: δ : F orm ( L ) × F orm ( L ) → F orm ( L \ { p } ) .It is said that δ is sound if { F, G } | = δ ( F, G ) , and a forgetting operator for the variable p ∈ L if δ ( F, G ) ≡ [ { F, G } , L \ { p } ]10n useful characterization of the operators can be deduced from the fol-lowing semantic property: If δ is a forgetting operator, the models of δ ( F, G )are precisely the projections of models of { F, G } (see Fig. 2). Lemma 3.2. (Lifting Lemma) Let v : L \ { p } → { , } be a valuation, F, G ∈ F orm ( L ) and δ a forgetting operator for p . The following conditionsare equivalent: v | = δ ( F, G )2.
There exists a valuation ˆ v : L → { , } such that ˆ v | = F ∧ G and ˆ v (cid:22) L\{ p } = v (that is, ˆ v extends v ).Proof. (1) = ⇒ (2): Given a valuation v , let us consider the formula H v = (cid:94) q ∈L\{ p } q v where q v is q if v ( q ) = 1 and ¬ q in other case. It is clear that v is the onlyvaluation on L \ { p } which is model of H v .Suppose that there exists a model of δ ( F, G ), v : L \ { p } → { , } , withno extension to a model of F ∧ G . In this case the formula H v → ¬ ( F ∧ G )is a tautology, in particular { F, G } | = H v → ¬ ( F ∧ G )Since { F, G } | = F ∧ G , by modus tollens { F, G } | = ¬ H v . So δ ( F, G ) | = ¬ H v because δ is a conservative retraction. This fact is a contradiction because v | = δ ( F, G ) ∧ H v .(2) = ⇒ (1): Such an extension ˆ v verifiesˆ v | = F ∧ G | = [ { F, G } , L \ { p } ] | = δ ( F, G )Since δ ( F, G ) ∈ F orm ( L \ { p } ), the valuation v = ˆ v L\{ p } is also a modelof δ ( F, G ). 11n particular the result is true for the canonical conservative retraction[ K, L \ { p } ], because [ K, L \ { p } ] ≡ δ p ( (cid:94) K, (cid:94) K )(being (cid:86) K := (cid:86) F ∈ K F )An interesting case appears when δ p ( F , F ) ≡ (cid:62) . In this case everypartial valuation on L \ { p } is extendable to a model of { F , F } .The following characterization will be used later: Corollary 3.3.
Let δ : F orm ( L ) × F orm ( L ) → F orm ( L \ { p } ) be a soundoperator. The following conditions are equivalent: δ is a forgetting operator for the variable p . For any
F, G ∈ F orm ( L ) and v | = δ ( F, G ) valuation on L \ { p } , thereexists an extension of v model of { F, G } .Proof. (1) = ⇒ (2): Is true by Lifting Lemma(2) = ⇒ (1). Let F, G be two formulas. Since δ is sound, it sufficesto see that δ ( F, G ) | = [ { F, G } , L \ { p } ]Suppose that is not true. In this case there exists H ∈ F orm ( L \ { p } )such that [ { F, G } , L \ { p } ] | = H (so { F, G } also entails H ), but there existsa valuation v satisfying v | = δ ( F, G ) ∧ ¬ H .By (2) there exists ˆ v extension of v which is model of { F, G } , so { F, G } (cid:54)| = H , that is, a contradiction. Corollary 3.4. If p / ∈ var ( F ) , and δ p is a forgetting operator for p , then δ p ( F, F ) ≡ F and δ p ( F, G ) ≡ { F, δ p ( G, G ) } Proof. If p / ∈ var ( F ), then { F } ≡ [ { F } , L \ { p } ] ≡ δ p ( F, F )On the other hand, δ p ( F, G ) ≡ [ { F, G } , L \ { p } ] | = { F, δ p ( G, G ) } . Toprove that actually it is an equivalence, it will be shown that they have thesame models.Let v a valuation on L \ { p } such that v | = { F, δ p ( G, G ) } . Then thereexists ˆ v , extension of v , such that ˆ v | = G . Since ˆ v | = F , then by Liftinglemma v | = δ ( F, G ). 12or forgetting operators as defined herein, the Lifting Lemma is a re-formulation of the observation made by J. Lang et al. [16] about variableforgetting. The authors present a characterization of forgetting by means ofQuantified Boolean Formulas (QBF), ∃ x ˆ F ( x ), where ˆ F is the interpretationof F as a Boolean formula whose free variables are the propositional variablesof F . In our case, δ p ( F, G ) could correspond to the QBF formula ∃ p ( F ∧ G ).Authors of the aforementioned article present a method of forgetting X (a variable set of a formula F ), denoted by f orget ( F, X ) by constructingdisjunctions in the following way: f orget ( F, ∅ ) = Ff orget ( F, { x } ) = F { x/ (cid:62)} ∨ F { x/ ⊥} f orget ( F, { x } ∪ Y ) = f orget ( f orget ( F, Y ) , { x } )Note that with this approach f orget ( F, Y ) can have high size. In ourcase we aim to simplify the representation by using algebraic operations onpolynomial projections.
We denote by 2 X the power set of X . By analogy with the classicalresolution-based saturation process (on CNF formulas), we will call satura-tion the process of applying the rule exhaustively until no new consequencesare obtained and observing the result (checking whether an inconsistency hasbeen obtained) . Definition 3.5. Let δ p be a forgetting operator for p . It is defined δ p [ · ] as δ p [ · ] : 2 F orm ( L ) → F orm ( L ) δ p [ K ] := { δ p ( F, G ) :
F, G ∈ K } Suppose we have a forgetting operator δ p for each p ∈ L . We will call saturation of K to the process of applying the operators δ p [ · ] (in someorder) by using all the propositional variables of L ( K ) , denoting theresult by sat δ ( K ) (which will be a subset of {⊥ , (cid:62)} ). igure 3: Deciding consistency by using a set of forgetting operators ∂ We will bellow see that the set sat δ ( K ) does not essentially depend ofthe order of applications of operators. Moreover, keep in mind that since theforgetting operators are sound, if K is consistent then necessarily sat δ ( K ) = {(cid:62)} .From forgetting operators a logical calculus can be defined in the usualway: Definition 3.6.
Let K be a KB and F ∈ F orm ( L ) and let { δ p : p ∈ L ( K ) } a family of forgetting operators. • A (cid:96) δ -proof in K is a formula sequence F , . . . F n such that for every i ≤ n F i ∈ K or exist F j , F k ( j, k < i ) such that F i = δ p ( F j , F k ) forsome p ∈ L . • K (cid:96) δ F if there exists (cid:96) δ -proof in K , F , . . . F n , with F n = F • A (cid:96) δ -refutation is a (cid:96) δ -proof of ⊥ . The (refutational) completeness of the calculus associated to forgettingoperators is stated as follows.
Theorem 3.7.
Let { δ p : p ∈ L} a family of forgetting operators. Then (cid:96) δ is refutationally complete: K is inconsistent if and only if K (cid:96) δ ⊥ . roof. The idea is to saturate the KB (Fig. 3). If sat δ ( K ) = {(cid:62)} , then,by repeating the application of Lifting Lemma, we can extend the emptyvaluation (which is model of {(cid:62)} ) to a model of K If ⊥ ∈ sat δ ( K ) then K is inconsistent, because K | = sat δ ( K ) by sound-ness of forgetting operators. The selection of a particular (cid:96) δ -refutation isstraightforward, as in the proof of the refutational completeness of resolu-tion calculus, for example. Corollary 3.8. δ p [ K ] ≡ [ K, L \ { p } ] Proof.
By soundness of the forgetting operator δ p ,[ K, L \ { p } ] | = δ p [ K ]holds. To prove the other direction, let F ∈ [ K, L \ { p } ], and let us supposethat δ p [ K ] (cid:54)| = F . Then δ p [ K ] + {¬ F } is consistent. In particular, if wesaturate, sat δ ( δ p [ K ] ∪ {¬ F } ) = {(cid:62)} .Since p / ∈ var ( ¬ F ), by Lemma 3.4 it holds that for any G ∈ K : δ p ( ¬ F, G ) ≡ {¬ F, δ p ( G, G ) } and δ p ( ¬ F, ¬ F ) ≡ ¬ F Therefore δ p [ K ∪ {¬ F } ] ≡ δ p [ K ] ∪ {¬ F } so, by applying saturation, starting with psat δ ( K ∪ {¬ F } ) ≡ sat δ ( δ p [ K ] ∪ {¬ F } ) = {(cid:62)} what indicates that K ∪ {¬ F } is consistent, thereupon K (cid:54)| = F , a contradic-tion.Given Q ⊆ L and a linear order q < · · · < q k on Q , we define the operator δ Q,< := δ q ◦ · · · ◦ δ q k In fact, if we dispense with making an order explicit, the operator is well-defined module logical equivalence, that is, any two orders on Q produceequivalent KBs. This is true because for each p, q ∈ L , using the previouscorollary it follows that δ p ◦ δ q [ K ] ≡ δ q ◦ δ p [ K ]15ue to the fact that both KBs are equivalent to [ K, L \ { p, q } ]. Therefore,for the sake of simplicity, we will write δ Q [ K ] when syntactic presentation ofthis KB does not matter.A consequence of corollary 3.8 and theorem 3.7 is that entailment problemcan be reduced to a similar problem but that it only uses variables of thegoal formula. This property is called the location property : the entailmentproblem can be simplified by eliminating propositional variables that do notappear in the target formula. Corollary 3.9. (Location Property, [10]) The following conditions are equi-valent: K | = F δ L\ var ( F ) [ K ] | = F Proof.
It is trivial, because δ L\ var ( F ) [ K ] ≡ [ K, var ( F )].
4. Boolean derivatives and independence rule on polynomials
In order to define our forgetting operator we will make use of derivationson polynomials, by translating the usual derivation on F [ x ] to an operatoron propositional formulas. We review here some basic properties. Recall thata derivation on a ring R is a map d : R → R verifying d ( a + b ) = d ( a ) + d ( b ) and d ( a · b ) = d ( a ) · b + a · d ( b ) for any a, b ∈ R The logical translation of derivations is builded as follows:
Definition 4.1. [10] A map ∂ : F orm ( L ) → F orm ( L ) is a Boolean deriva-tive if there exists a derivation d on F [ x ] such that the following diagram iscommutative: F orm ( L ) ∂ → F orm ( L ) π ↓ ↑ Θ F [ x ] d → F [ x ] That is, ∂ = Θ ◦ d ◦ π
16n this paper we are particularly interested in the Boolean derivative,denoted by ∂∂p , induced by the derivation d = ∂∂x p . The following resultshows a semantic equivalent expression of this derivative. Proposition 4.2. ∂∂p F ≡ ¬ ( F { p/ ¬ p } ↔ F ) Proof.
It is straightforward to see that π ( F { p/ ¬ p } )( x ) = π ( F )( x , . . . , x p + 1 , . . . , x n )On the other hand it is easy to see that ∂∂x a ( x ) = a ( x + 1) + a ( x )holds for polynomial formulas, hence ∂∂x p π ( F ) = π ( F )( x , . . . , x p + 1 , . . . , x n ) + π ( F )( x , . . . , x p , . . . , x n )Therefore, by applying Θ we conclude that ∂∂p F = Θ( ∂∂x p π ( F )) ≡ ¬ ( F { p/ ¬ p } ↔ F )Notice that truth value of ∂∂p F with respect to a valuation does not dependof the truth value on the own p ; hence, we can apply valuations on L \ { p } to this formula. In fact, we can describe the structure of F by isolating therole of p as follows: Lemma 4.3. [10] ( p -normal form). Let F ∈ F orm ( L ) and p be a proposi-tional variable. There exists F ∈ F orm ( L \ { p } ) such that F ≡ ¬ ( F ↔ p ∧ ∂∂p F ) Proof.
Since π ( F ) is a polynomial formula, we can suppose that π ( F ) = a + x p b with deg x p ( a ) = deg x p ( b ) = 0Therefore F ≡ Θ( π ( F )) ≡ ¬ ( θ ( a ) ↔ p ∧ Θ( b ))Then let F = Θ( a ), and, since b = ∂∂x p π ( F ), we have that Θ( b ) = ∂∂p F .17 igure 4: Geometric interpretation of independence rule For example, let F = p ∧ q → r . Then π ( F ) = 1 + x p x q + x p x q x r = 1 + x p ( x q + x q x r )Following the above proof, a = 1 and b = x q + x q x r (note that ∂∂x p ( π ( F )) = x q + x q x r ). Therefore Θ( a ) = (cid:62) and Θ( b ) = q ∧ ¬ r , so F ≡ ¬ ( (cid:62) ↔ p ∧ ( q ∧ ¬ r ))The forgetting operator that we are going to define next, called indepen-dence rule, aims to represent the models of the conservative retraction asthose that can be extended to models of F ∧ G (that is, the idea behind Lift-ing Lemma). Geometrically, if a and b are the polynomials π ( F ) and π ( G )respectively, then the vanishing set V (1 + a, b ) (which could correspondto the set of models both of F and G ) is projected by ∂ p (see Fig. 4). Thealgebraic expression of the projection is described as a rule. Definition 4.4.
The independence rule (or ∂ -rule) on polynomial formulasis defined as follows: given a , a ∈ F [ x ] and x an indeterminate a , a ∂ x ( a , a ) where ∂ x ( a , a ) = 1 + Φ (cid:2) (1 + a · a )(1 + a · ∂∂x a + a · ∂∂x a + ∂∂x a · ∂∂x a ) (cid:3) a i = b i + x p · c i , with deg x p ( b i ) = deg x p ( c i ) = 0 ( i = 1 , ∂ x p ( a , a ) = Φ [1 + (1 + b · b )[1 + ( b + c )( b + c )]]For example, to compute a = ∂ x (1 + x x x + x x , x x x x x + x x x x )we take b = 1 + x x , c = x x and b = 1 , c = (1 + x ) x x x so the result is a = 1 + x x x x + x x x . Note that independence rule is symmetric.
5. Independence rule and non-clausal theorem proving
The independence rule for formulas is defined as ∂ p ( F, G ) := Θ( ∂ x p ( π ( F ) , π ( G )))Following with above example, ∂ p ( p ∧ p → p , p ∧ p ∧ p ∧ p → p ) == Θ( ∂ x (1 + x x x + x x , x x x x x + x x x x )) == Θ(1 + x x x x + x x x ) = ¬ ( p ∧ p ∧ p ∧ p ↔ p ∧ p ∧ p ) ≡≡ p ∧ p ∧ p → p It is worthy to point out some interesting features of the rule ∂ p : if ∂ p ( F, G ) is a tautology, then ∂ p ( F, G ) = (cid:62) , and if ∂ p ( F, G ) is inconsistentthen ∂ p ( F, G ) = ⊥ . Both features are consequence of the translation to poly-nomials: polynomial formulas corresponds of tautologies and inconsistenciesare algebraically simplified to 1 and 0 in F [ x ] / I , respectively. In fact, wewill usually work with the polynomial projections to exploit these features. Proposition 5.1. ∂ p is sound roof. We have to prove F ∧ F | = ∂ p ( F , F ). Suppose that π ( F ) = b + x p · c , π ( F ) = b + x p · c According to Thm. 2.2.(3), it is enough to prove that V (1 + π ( F ) · π ( F )) ⊆ V (1 + ∂ x p ( π ( F ) , π ( F )))Let u ∈ V (1 + π ( F ) · π ( F )) ⊆ F n , that is,( b + x p c )( b + x p c ) | x = u = 1 ( † )(the notation used here is as usual: F ( x ) | x = u is F ( u )). Let us distinguishtwo cases: • If the p -coordinate of u is 0, then by ( † ) it follows that b | x = u = b | x = u = 1Therefore (1 + b b ) | x = u = 0. • The p -coordinate of u is 1. In this case ( b + c )( b + c ) | x = u = 1By examining the definition of ∂ p we conclude in both cases that ∂ x p ( π ( F ) , π ( F )) | x = u = 1so we have that u ∈ V (1 + ∂ x p ( π ( F ) , π ( F ))). Theorem 5.2. ∂ p is a forgetting operatorProof. The goal is to prove that[ { F , F } , L \ { p } ] ≡ ∂ p ( F , F )Let us suppose that F , F ∈ F orm ( L ) such that π ( F i ) = b i + x p c i i = 1 , b i , c i polynomial formulas without variable x p . Recall that in this casethe expression of the rule is ∂ x p ( π ( F ) , π ( F )) = Φ ((1 + b · b ) [1 + ( b + c )( b + c )])20ince the soundness of ∂ p has been proved by the previous proposition,by Corollary 3.3 it is sufficient to show that any valuation v on L \ { p } modelof ∂ p ( F , F ) can be extended to ˆ v | = { F , F } .Let v | = ∂ p ( F , F ). Let us consider the point from F n asociated to v , o v .It follows that o v ∈ V ( π ( ∂ p ( F , F )) + 1) = V ( ∂ x p ( π ( F ) , π ( F )) + 1) == V ((1 + b · b )[1 + ( b + c )( b + c )])so ((1 + b · b )[1 + ( b + c )( b + c )]) | x = o v = 0In order to build the required extension ˆ v , let us distinguish two cases: • If (1 + b · b ) | x = o v = 0 then ˆ v = v ∪ { ( x p , } | = F ∧ F . • If [1 + ( b + c )( b + c )] | x = o v = 0 thenˆ v = v ∪ { ( x p , } | = F ∧ F With some abuse of notation, we use the same symbol, (cid:96) ∂ , to denotesimilar notions that defined in Def. 3.6 but on polynomial formulas and rules ∂ x p . In that way we can describe (cid:96) ∂ -proofs on polynomials. For example, a ∂ -refutation for the set π [ { p → q, q ∨ r → s, ¬ ( p → s ) } ] is1. 1 + x + x x [[ π ( p → q )]]2. 1 + ( x + x + x x )(1 + x ) [[ π ( q ∨ r → s )]]3. x (1 + x ) [[ π ( ¬ ( p → s )]]4. 1 + x + x + x x + x x + x x + x x x [[ ∂ x to (1) , (2)]]5. 0 [[ ∂ x to (3) , (4)]] Corollary 5.3. [10] K is inconsistent if and only if K (cid:96) ∂ ⊥ .Proof. It is consequence of theorems 3.7 and 5.2The result, in algebraic terms, is as follows:21 orollary 5.4.
Let F ∈ F orm ( L ) and let K be a knowledge basis. Thefollowing conditions are equivalent: K | = F J K (cid:96) ∂ Proof. (1) = ⇒ (2): Let us suppose K | = F . Then K + {¬ F } is incon-sistent. Since ∂ p is refutationally complete, K + {¬ F } (cid:96) ∂ ⊥ . Thus { π ( G ) : G ∈ K } ∪ { π ( F ) } (cid:96) ∂ ⇒ (1): If a ∂ -refutation is founded on polynomials, then byabove theorem K ∪ {¬ F } is inconsistent. Remark 5.5.
To compute conservative retractions we use an implementation(in Haskell language) of ∂ p and ∂ x p . In order to simplify the presentation, weonly show the computation on polynomials (that is, the application of ∂ x p ),and we use the own propositional variables as polynomial variables (that is,we identify p and x p ) to facilitate the readibility.The software used in the examples and experiments can be downloadedfrom https: // github. com/ DanielRodCha/ SAT-Pol Example 5.6.
Let G = s → r and K be the KB K = t ∧ p ↔ st ∧ r → st ∧ q → sp ∧ q ∧ s ∧ t → r To decide whether K | = G -by applying location lemma- we have to com-pute ∂ L\{ r,s } [ K ] ≡ ∂ p [ ∂ q [ ∂ t [ K ]]] * [pqrst+pqst+1,pt+s+1,qst+qt+1,rst+rt+1] (projection)* [pqrs+pqs+ps+s+1, ps+s+1, 1] (forgetting t)* [ps+s+1, 1] (forgetting q)* [1] (forgetting p) herefore: [ K, L \ { r, s } ] ≡ {(cid:62)} (cid:54)| = G Consider now the formula F = p ∧ q ∧ t → s . In order to decide whether K | = F , by location lemma we have to compute [ K, L ( F )] ≡ ∂ r [ K ] * [pqrst+pqst+1,pt+s+1,qst+qt+1,rst+rt+1] (projection)* [pqst+pqt+pt+qst+qt+s+1,pt+s+1,qst+qt+1,1] (forgetting r) To see that ∂ r [ K ] | = F it is sufficient to show that ∂ r [ K ] ∪ {¬ F } isinconsistent. The computation is made in the projection set, by saturatingthe polynomial set: * [pt+s+1,qst+qt+1, pqst+pqt] (the retraction and ¬ F)* [0] (applying sat ∂ ) An approach to specify contexts in AI for reasoning is to determine whichset of variables Q ⊆ K provides information and which variables are irrel-evant for represent the specific context. In fact, in some approaches forformalizing context-based reasoning contexts are determined by this variableset. When K does not provide any specific information about the context inwhich it is to be used, it is natural to conclude [ K, Q ] should only containtautologies, that is, ∂ L\ Q [ K ] = {(cid:62)} . In the previous example K does notprovide relevant information about the context determined by { r, s } , because[ K, L \ { r, s } ] = {(cid:62)} .
6. Characterization sensitive implications
In addition to its use in the design and study of the independence rule,other use of Boolean derivatives is the detection of variables that are irrele-vant in a formula (or, in terms of [26], to study when a formula is independentof a variable), and more generally, when a variable is irrelevant in a formularelativized to a KB (that is, in the models of the own KB).We will say that a variable p is irrelevant in a formula F (or F isindependent of p ) if F is equivalent to a formula in which p does not occur.This concept can be generalized to a set of variables in the natural way, andit can be proved that a F formula is independent of a set of variables X ifand only if F is independent from each variable of X (see [26]). In this paperalso remarks the following result: 23 roposition 6.1. The following conditions are equivalent: F is independent from x F { x/ (cid:62)} ≡ F { x/ ⊥} F { x/ (cid:62)} ≡ F F { x/ ⊥} ≡ F To which we could add:5. | = ¬ ∂∂ p ( F )In this section we are interested in studying the notion of independencerelativized to a KB. Note that it may happen that a variable may be relevantin a formula but not in the KB models we are working with. To distinguishthe relativized notion from the original we will use the word sensitive . Definition 6.2.
A formula F is called sensitive in p with respect to aknowledge basis K if K (cid:54)| = F { p/ ¬ p } ↔ F . We say that F is sensitive w.r.t. K (or simply sensitive, if K is fixed) if F is sensitive in all its variables. The following result habilitates the use of Gr¨obner basis for determiningsensitiveness (by means of ideal membership test in condition (4)) or that ofour interest, by means of ∂ p -rules (condition (3)).It is straightforward to check that: Proposition 6.3.
Let p ∈ var ( F ) . The following conditions are equivalent: F is sensitive in p with respect to a knowledge basis K K ∪ { ∂∂ p ( F ) } is consistent sat ∂ [ K ∪ { ∂∂ p ( F ) } ] = {(cid:62)} ∂ x p π ( F ) / ∈ J K + I Proof. (1) = ⇒ (2): Since K (cid:54)| = F { p/ ¬ p } ↔ F , there exists v | = K where v | = ¬ ( F { p/ ¬ p } ↔ F ), that is, v | = K ∪ { ∂∂ p ( F ) } (2) = ⇒ (3) by completeness of (cid:96) ∂ (3) = ⇒ (4): Let v | = K ∪ { ∂∂ p ( F ) } (it is consistent by (3). Then π ( ∂∂ p ( F ))( o v ) = 1.Moreover π ( G )( o v ) = 1 for any G ∈ K hence o v ∈ J K . Therefore thepolynomial ∂∂ p π ( F ) does not belong to J K ⇒ (1): Suppose ∂∂ xp π ( F ) / ∈ J k + I so there exists o ∈ V ( J k ) suchthat ∂∂ xp π ( F )( o ) (cid:54) = 0. Then v o | = ∂∂ p ( F ) and v o | = K . Therefore K ∪ { ∂∂ p ( F ) } is consistent, so F is sensitive in p w.r.t. K .From the definition itself it follows that Boolean derivatives can be used totackle the problem of sensitive arguments in implications: F is not sensitive in p w.r.t. K iff K | = ¬ ∂∂p F . In this case, there exists G with var( G ) =var( F ) \{ p } such that K | = F ↔ G (e.g. F { p/ ⊥} ). Example 6.4.
Lets us consider the following consistent KB as a rule-basedsystem K = R p → p R p → p R ¬ p → p R ¬ p → p R p ∧ p ) → p R p → p R p → p R p → p R p → p R
10 : p → p Let us consider as a set of potential facts (potential inputs of the system) F = { p , . . . , p , ¬ p , . . . , ¬ p } We will say that a rule R ∈ K is sensitive in p w.r.t. to K and a subset ofpotential facts C if R is sensitive in p w.r.t. K ∪ C . Let us compute someexamples: • R is sensitive in p w.r.t. K and the potential fact set {¬ p } . ∂∂ p ( R
1) = θ ( ∂∂ x (1 + x (1 + x )) = ¬ p and K ∪ {¬ p } (cid:54)| = ¬ p This condition can be checked (by using condition (3) of above proposi-tion) showing that [ K ∪ {¬ p } , { p } ] ≡ ∂ L\{ p } [ K ∪ {¬ p } ] = { p } | = ¬ p he computation is: * [p1p10+p1+1, p1p11p7+p1p7+1, p1p9+p1+1, p10p2+p10+p2,p10p3+p3+1, p11p4+p4+1, p2p9+p2+p9, p2+1, p3p7+p3+1,p5p8+p5+1, p6p9+p6+1] (projection of K ∪ {¬ p } )* [p10p2+p10+p2,p10p3+p3+1,p11p4+p4+1,p2p9+p2+p9, p2+1,p3p7+p3+1, p5p8+p5+1,p6p9+p6+1,1] (forgetting p1)* [p10p3+p3+1,p10,p11p4+p4+1,p3p7+p3+1,p5p8+p5+1,p6p9+p6+1,p9,1] (forgetting p2)* [p10,p11p4+p4+1,p5p8+p5+1,p6p9+p6+1,p9,1] (forgetting p3)* [p10,p5p8+p5+1,p6p9+p6+1,p9,1] (forgetting p4)* [p10,p6p9+p6+1,p9,1] (forgetting p5)* [p10,p9,1] (forgetting p6)* [p10,p9,1] (forgetting p7)* [p10,p9,1] (forgetting p8)* [p9,1] (forgetting p10)* [p9,1] (forgetting p11) • R is not sensitive in p w.r.t. the set { p } : ∂∂ p ( R ) = Θ( ∂∂ x (1 + ( x x )(1 + x ))) = Θ( x (1 + x )) = p ∧ ¬ p and K ∪ { p } (cid:54)| = ∂∂ p ( R ) . In fact [ K ∪ { p } , { p , p } ] ≡ ∂ L\{ p ,p } [ K ∪ { p } ] = { p } | = ¬ ∂∂ p ( R )
7. Some applications
We will illustrate the usefulness of the tools presented to work on differenttypes of KRR-related tasks. For reasons of paper length we will only describetwo of them. 26 .1. Detecting potentially dangerous states
In [6] authors show an algebraic method for detecting potentially dan-gerous states in a Rule Based Expert System (RBES) whose knowledge isrepresented by Propositional Logic. Given K made up of rules, the idea is toconsider the potential facts that make K to infer an unwanted value (whichleads a danger or undesirable state). Formally, they specify both the set F ofpotential facts (potential input literals of the RBES) and dangerous states.Let us consider the following example, taken from the same [6], to showthat it avoids dangerous situations and K from example 6.4. Let F = { p , . . . , p , ¬ p , . . . , ¬ p } and let p be a warning variable of a dangerous state. We know the initialstate the information { p , ¬ p } , which is a secure information because K ∪{ p , ¬ p } (cid:54)| = p .In this case the question is to detect which potential facts lead us to thatdangerous state, i. e. which literals r ∈ F verifying that K ∪ { p , ¬ p } ∪ { r } | = p By deduction theorem it is equivalent to decide whether K | = p ∧ ¬ p ∧ r → p To apply Location Lemma it is sufficient to bear in mind that this will betrue if and only if[ K, { p , . . . p } ∪ { p } ] | = p ∧ ¬ p ∧ r → p ( †† )In this case, K (cid:48) = [ K, { p , . . . p } ∪ { p } ] ≡ ∂ L\ ( { p ,...,p ,p } ) [ K ]In poynomial terms, this KB is represented as J = { p1p11p3 + p1p3 + , p11p4 + p4 + , } In order to use the results of this paper it suffices to use Deduction The-orem for reducing condition ( †† ) to[ K, { p , . . . p } ∪ { p } ] ∪ { p , ¬ p } | = r → p igure 5: Knowledge Base A for an espresso machine from [12] and, by Reductio ab absurdum we have to find variables r from F such that[ K, { p , . . . p } ∪ { p } ] ∪ { p , ¬ p , ¬ p } | = ¬ r Obviously p , p do not satisfy this. • For i = 3 , K (cid:48) , { p i } ] ≡ {¬ p i } (because the polynomial pro-jection, computed using J , is + pi ), so they are dangerous variables • For i = 5 , K (cid:48) , { p i } ] ≡ {(cid:62)} , (because the polynomial projec-tion is ), so they are not dangerous variables This example is taken from [12]. Let us suppose we analyze the behaviorof an espresso machine whose functioning aspects are captured by the axiomsenumerated in Fig. 5. The first four axioms denote that if the machine pumpis OK and the pump is on, then the machine has a water supply. Alternately,the machine can be filled manually, but this never happens when the pumpis on. The next four axioms denote that there is some steam if and only ifthe boiler is OK and it is on and there is enough water supply. The last threeaxioms denote that there is always either coffee or tea, and that steam andcoffee (or tea) result in a hot drink. Let the knowledge base for an espressomachine described in Fig. 5. Although the example is very simple, it is veryuseful to show the applicability of the paper tools. We have relied on thecases of [12].Authors in [12] obtain the partition described in Fig. 6. The languagesfrom these partitions can be used to compute conservative retractions, in28 igure 6: Partition of Knowledge Base of Fig. 5, extracted from [12] order to check the completeness of the refined KB obtained in the above-mentioned paper. We compute the conservative retractions by using opera-tors ∂ p defined in this paper. • L ( A ) = { on pump, ok pump, water, man f ill } . The analogous one inour approach, [ A , L ( A )], is equivalent to A ,[ A , L ( A )] = (cid:26) ok pump ∧ on pump → water, man f ill → water,man f ill → ¬ on pump, ¬ man f ill → on pump (cid:27) • L ( A ) = { water, on boiler, ok boiler, steam } . The analogous one inour approach, [ A , L ( A )], is also equivalent A ,[ A , L ( A )] = (cid:26) steam → ok boiler, steam → on boiler, steam → water,ok boiler ∧ on boiler ∧ water → steam (cid:27) Finally L ( A ) = { steam, cof f ee, hot drink, teabag } . The analogousone in our approach, [ A , L ( A )], is also equivalent to A ,[ A , L ( A )] = (cid:26) cof f ee ∧ steam → hot drink, cof f ee ∨ teabag,steam ∧ teabag → hot drink, (cid:27)
8. Experiments
The proposal of this paper is of a general nature and is not specializedin specific fragments of propositional logic. Nevertheless, in this section weare going to experimentally compare saturation based on the independencerule with saturation based on the basic rule of forgetting variables (see [16]),which can be applied to propositional logic without syntactic restrictions,to which we add a simplification operator (we call canonical to this rule).We will formally see this idea in the next subsection. In adition, beforedescribing the experimental results, we will show in the second subsection arefinement of the retraction to decrease the number of rule applications (forany of them).
A specific syntactic feature of the forgetting operator ∂ p is that, if ∂ p ( F, G )is a tautology, then ∂ p ( F, G ) = (cid:62) , and if ∂ p ( F, G ) is inconsistent then δ p ( F, G ) = ⊥ . This characteristic is a consequence of the pre- and post-processing of formulas by means of polynomial translations and vice versa.Under this translation, tautologies and inconsistencies are algebraically sim-plified to (cid:62) and ⊥ respectively. It would not be true for any forgettingoperator in general, but at least you can achieve some simplification by elim-inating occurrences of (cid:62) , ⊥ , producing thus only reduced formulas (with nooccurrences of (cid:62) and ⊥ ). For this purpose we use a simplification operator : σ : F orm ( L ) → F orm r ( L )(where F orm r ( L ) is the set of reduced formulas) defined as:1. σ ( s ) = s if s ∈ {(cid:62) , ⊥} , σ ( ¬(cid:62) ) = ⊥ and σ ( ¬⊥ ) = (cid:62) ,2. σ ( F ) = F if ⊥ , (cid:62) do not occur in F , and in other case:(a) σ ( (cid:62) ∧ F ) = σ ( F ), σ ( (cid:62) ∨ F ) = (cid:62) (b) σ ( ⊥ ∧ F ) = ⊥ and σ ( ⊥ ∨ F ) = σ ( F )30c) σ ( (cid:62) → F ) = σ ( F ), σ ( F → (cid:62) ) = (cid:62) , σ ( ⊥ → F ) = (cid:62) and σ ( F → ⊥ ) = σ ( ¬ σ ( F ))(d) If F, G (cid:54) = (cid:62) , ⊥ , σ ( F ∗ G ) = σ ( σ ( F ) ∗ σ ( G )) for ∗ ∈ {∧ , ∨ , →} and σ ( ¬ F ) = σ ( ¬ σ ( F ))For example, σ (( ⊥ → p ) ∧ ( (cid:62)∧ q )) = σ ( σ ( ⊥ → p ) ∧ σ ( (cid:62)∧ q )) = σ ( σ ( p ) ∧ σ ( q )) = σ ( p ∧ q ) = p ∧ q It is straight to see that σ ◦ δ ≡ δ for any operator δ . Definition 8.1.
The canonical forgetting operator for a variable p isdefined as δ p = σ ◦ δ ∗ p where δ ∗ p ( F, G ) := ( F ∧ G ) { p/ (cid:62)} ∨ ( F ∧ G ) { p/ ⊥} Proposition 8.2. δ p is a forgetting operator for p Proof.
Easy by the Lifting Lemma
Example 8.3. F = p → q and G = p ∧ r → ¬ q : δ p ( p → q, p ∧ r → ¬ q ) = σ ( δ ∗ p ( p → q, p ∧ r → ¬ q )= σ ([( p → q ) ∧ ( p ∧ r → ¬ q )] { p/ (cid:62)}∨ [( p → q ) ∧ ( p ∧ r → ¬ q )] { p/ ⊥} ) == σ ([( (cid:62) → q ) ∧ ( (cid:62) ∧ r → ¬ q )] ∨ [( ⊥ → q ) ∧ ( ⊥ ∧ r → ¬ q )]) == σ ( σ [( (cid:62) → q ) ∧ ( (cid:62) ∧ r → ¬ q )] ∨ σ [( ⊥ → q ) ∧ ( ⊥ ∧ r → ¬ q )]) == σ ([ q ∧ ( r → ¬ q )] ∨ (cid:62) ) = (cid:62) Corollary 8.4.
Let δ : F orm ( L ) × F orm ( L ) → F orm ( L \ { p } ) . The fol-lowing conditions are equivalent: δ is a forgetting operator for p . δ ≡ δ p .2. Refining the process In order to make the implementation of the realistic algorithms, we willuse the following result that significantly reduces the number of applicationsof the variable forgetting rules in practice. Besides, using the fact that it’ssymmetrical, we can even further reduce the number of applications of theoperators:
Proposition 8.5.
In above conditions δ p [ K ] ≡ { F : p does not occur in F } ∪ δ p [ { F ∈ K : p occurs in F } ] Proof.
Let us denote by A the first set of formulas and by B the second one.We just have to prove that A ∪ B | = δ p [ K ].Let δ p ( F, G ) be a formula of δ p [ K ]. By symmetry, it is enough to consideronly three cases: • p / ∈ var ( F ) ∪ var ( G ). Then A | = F ∧ G ≡ δ p ( F, G ) • p ∈ var ( G ) \ var ( F ). Then A ∪ B | = F ∧ δ p ( (cid:62) , G ) ≡ δ p ( F, G ) • p ∈ var ( F ) ∩ var ( G ). Then δ p ( F, G ) ∈ B In this section, as an illustration, we will execute variable forgetting ona set of knowledge bases to show the efficiency of the rule proposed in thispaper with respect to the canonical rule in the processing of forgetting op-erations (fundamentally, we will focus on the cost in space, the number ofsymbols used in the representation). Each experiment has been performedby randomly choosing some variables present in the knowledge base and or-der on them (common for both operators) and we will progressively applythe corresponding operators . Below we describe the datasets and the resultsobtained.The examples are taken from the SAT Competition 2018 website . In Fig.7 their initial size (both in propositional logic and polynomial transformed) Although it is irrelevant to calculate the size of the knowledge bases, to estimate thetime we have used a MacBook Air with a 1.6 GHz Intel Core i5 processor and 8 GB 1600MHz DDR3 memory. The operating system is macOS High Sierra 10.13.5 http://sat2018.forsyte.tuwien.ac.at ame Size Size seconds Space (bytes) seconds Space (bytes)form. pol. Can. rule Can. Indep. Indep. mp1-bsat180-648 unsat250 mp1-squ any s09x07 c27 bail UNS g2-modgen-n200-m90860q08c40-13698 mp1-klieber2017s-1000-023-eq mp1-tri ali s11 c35 bail UNS mp1-Nb5T06 is shown. The total time used in each dataset experiment (i.e. in the ap-plication of all the corresponding operators chosen for that experiment) forboth the proposed and the canonical operator is also shown. In the follow-ing tables the results of the progressive implementation of the operators areshown. mp1-bsat180-6482 4 6 8 10123 · CanonicalIndep. rule
Size of KB Size of KBStep (Indep.(canonical) rule)1 15428 197572 16900 208763 25131 218664 26839 235165 34908 246126 36735 292697 54530 334908 55231 349859 57073 4785710 169330 5921511 384996 60313 nsat2502 4 6 8 102468 · CanonicalIndep. rule
Size of KB Size of KBStep (Indep.(canonical) rule)1 26280 340912 28906 354433 34141 358914 68952 377315 191069 392426 193949 403937 200293 546778 214468 568469 231861 6111910 407926 6233011 939192 64986 mp1-squ any s09x07 c27 bail UNS2 4 6 8 102468 · CanonicalIndep. rule
Size of KB Size of KBStep (Indep.(canonical) rule)1 37028 624982 37557 640583 38496 639214 53437 660355 411028 659076 589455 676317 731546 675128 825714 688849 890920 6877410 995522 69832 g2-modgen-n200-m90860q08c40-136982 4 6 8 10123 · CanonicalIndep. rule
Size of KB Size of KBStep (Indep.(canonical) rule)1 237141 3219262 242392 3260623 290876 3271714 319155 3324855 3339545 3345286 3340602 3411287 3346440 3442138 3362678 3483819 3367621 37329810 3390750 537880 p1-klieber2017s-1000-023-eq2 3 4 5 6246 · CanonicalIndep. rule
Size of KB Size of KBStep (Indep.(canonical) rule)1 351346 16155422 1176815 284185313 2233525 284185184 7599271 284185135 74792215 284190396 out of time 28419304 mp1-tri ali s11 c35 bail UNS2 3 4 5 6 70 . . · CanonicalIndep. rule
Size of KB Size of KBStep (Indep.(canonical) rule)1 37877 441272 38312 449433 38884 447714 50809 446345 54837 482006 213958 480727 237610 51134 mp1-Nb5T062 4 6 8 10 12 14 160 . . · CanonicalIndep. rule
Size of KB Size of KBStep (Indep.(canonical) rule)1 212003 2524002 213563 2525703 222107 2527244 222446 2528625 224030 2530006 232858 2534827 233189 2536208 234797 2541029 243909 25424010 294441 25437811 3975580 25451612 3975911 25499813 3977425 25513614 3985776 25527815 4033048 25576016 7353991 25589817 22919499 256036
35s we have observed in the experiments, despite the fact that initiallythe transformation to polynomials uses slightly more space, the growth inthe size of the knowledge base representation when progressively applied bythe operators improves considerably the resources needed with respect to thecanonical operator. Note, as we have already noted, that we have comparedour operator (not restricted to a sub-language of the propositional logic) withthe non-specialized operator.
9. Conclusions and future work
As we have already mentioned in the introduction, the algebraic inter-pretation of propositional logic represents a valuable bridge for applying al-gebraic techniques in KRR. In this paper we have proposed a new algebraicmodel to solve problems on KRR whose knowledge is represented by propo-sitional logic. We are not concerned here about the practical computationalcost of the use of independence rule, the aim of a next paper. We focused onits theoretical foundations and potential applications in KRR instead.The main technique introduced in the paper is the use of a new ruleinspired in the projection of algebraic varieties and polynomial derivatives.Also, it is justified that with Boolean derivatives is possible to determinespecific cases of conditional independence, the formula-variable independencerelativized to a KB. The tools have been used to solve questions relatedwith distilling KB to obtain relatively simpler KBs to solve context-basedquestions.Throughout the paper we have remarked some works related to the toolsused here. These works are driven to exploit the computation and use ofGr¨obner Basis, whilst in this paper a new method is proposed (specific for F ).With regard to the practical complexity of the proposed method, theapplication of the independence rule is reduced to the the algebraic simpli-fication of polynomials. Its calculation appears at two levels: first in themultiplication of Boolean polynomials (or in finite fields in general), sincethe rule of independence is reduced to products, and second in the transfor-mation of formulas into polynomials for a complete knowledge base.With respect to the first question, the product of Boolean polynomialsis a long-studied problem, for which refined algorithms exist (see e.g. [27]).The computational complexity of the application of the rule is irrelevant (itconsists mainly of four polynomial products) compared to the second issue,36he translation of formulas into polynomials. Such kind of transformation hasbeen widely used to compile and run (using Gr¨obner databases) rule-basedprograms, for example. The problems where the polynomial interpretationof the formulas (rules, for example) of a KB is used are problems where theformulas have very limited complexity. In this type of program, the num-ber of variables that appear in a rule is very small compared to the totalnumber (see e.g. [28, 29, 30]). Therefore the computation of conservativeretraction is feasible with our approach. Moreover, in the context of alge-braic interpretation of logic reasoning, the results shown in this article allowus to replace the use of ”black box” implementations (those that use a com-puter algebra system to compile and reason) with another also algebraic but”white box” type, which can be verified/certified. The complexity of alge-braic simplifications can be high when both the number of variables is largeand the number of variables that occur in each knowledge base formula isrelatively high (with respect to the size of the total set of variables). Howeverit is not common (nor advisable) in programming paradigms such as logicalprogramming (answer set or rule-based programming), DL ontologies, etc.With respect to the use of independence rule as SAT solver, although therule is (refutationaly) complete, its intended use in this article is to calculateconservative retractions, and we have not presented a SAT algorithm otherthan the intuitive one (rule application saturation). In the GitHub repository https://github.com/DanielRodCha/SAT-Pol , variants are being developedto solve more efficiently SAT problems. With regard to the complexity ofthe problem of the variable forgetting in the case of propositional logic, ithas been studied in considerable depth due to its relationship with the SATproblem (and, in general, with problems with Boolean functions) both forthe foundations on the complete logic and for various fragments of this logic(see e.g. [26, 31]). As we have shown in the section devoted to experiments,computational cost of polynomials computations are irrelevant in practice,bearing in mind that our method is nos specialized for fragments of proposi-tional logic, since it works on the full propositional logic. That section focuseson comparing the rule with the general rule of forgetting variables, since itdoes not seem appropriate to compare our proposal with other approachesspecialized in fragments of propositional logic.As future work we will intend to work in two complementary researchlines. On the one hand we intend to carry out the extension to many-valuedlogics and their applications [4, 5, 7] as well as to tackle the knowledge for-getting problem in modal logics [22]. If the underlying logic is many-valued,37he algebraic varieties of the polynomial translations of the propositions donot behave intuitively (see [1]). Therefore, we need to use an appropiateversion of the the Nullstellensatz Theorem. Also, for this research line, acareful generalization of the concept of Boolean derivatives, with nice logicalmeaning, has to be carried out [32]. On the other hand, it is possible to useour model - in a similar way to the applications presented in the paper- forimplementing expert systems based on the knowledge of different experts asin [9], for diagnosis (see [33]) or -in the behalf of authors- more promisingfield of inconsistency management [34].
10. Acknowledgements
This work was partially supported by TIN2013-41086-P project (SpanishMinistry of Economy and Competitiveness), co-financed with FEDER funds.We also acknowledge the reviewers and editors for their valuable commentsand suggestions, which have substantially improved the content of this article.
11. ReferencesReferences11. ReferencesReferences