Articles

Logical derivation search with assumption traceability

Loginio išvedimo paieška su prielaidu˛ atsekamumu

Adomas Birštunas
Vilnius University, Lituania
Elena Reivytyte
Vilnius University, Lituania

Logical derivation search with assumption traceability

Lietuvos matematikos rinkinys, vol. 62 Ser. A, pp. 16-22, 2021

Vilniaus Universitetas

Recepción: 01 Septiembre 2021

Publicación: 15 Diciembre 2021

Abstract: In this paper authors research the problem of traceability of assumptions in logical derivation. The essence of this task is to trace which assumptions from the available knowledge base of assumptions are necessary to derive a certain conclusion. The paper presents a new derivation procedure for propositional logic, which ensures traceability feature. For the derivable conclusion formula derivation procedure also returns the smallest set of assumptions those are enough to get derivation of the conclusion formula. Verification of the procedure were performed using authors implementation.

Keywords: propositional logic, traceability, loop checking.

Summary: Šiame darbe autoriai nagrine˙ja loginio išvedimo iš prielaidu˛ atsekamumo problemą. Šio uždavinio esme˙ yra atsekti, kurios prielaidos iš turimos prielaidu˛ žiniu˛ baze˙s yra bu¯tinos tam tikros išvados išvedimui. Darbe pristatoma nauja teiginiu˛ logikai skirta išvedimo procedu¯ra užtikrinanti prielaidu˛ atsekamumo savybę. Išvedamai formulei išvedimo procedu¯ra grąžina ir mažiausią prielaidu˛ aibę, kurios užtenka išvados formule˙s išvedimui gauti. Procedu¯ra verifikuota su autoriu˛ realizacija.

Keywords: teiginiu˛ logika, atsekamumas, ciklu˛ aptikimas.

Introduction

In the recent decades artificial intelligence is increasingly used by software developers to provide more and more smart systems. One of the areas of the artificial intelligence is formal logics. There are lots of classical methods for logical derivation. Some of them are applicable for particular logic, some of them are universal methods, those may be applied for a big set of logics. The most widely used methods are sequent calculi, resolution methods, tableaux methods [5]. The logic to be chosen depends on the application scope and may vary from the propositional logic, predicate logic, descriptive logic and different modal logics. The goal of these methods is to determine if given formula (conclusion) is derivable from the set of assumption formulas. Different provers based on the different calculi or derivation procedures are already implemented and used in real word applications.

In the real applications we use knowledge bases, those contain hundreds, thousands or even much more assumptions. Most of the assumptions are not related to the particular goal formula. Usually prover, especially if we take a general-purpose prover, returns simple result – if given conclusion formula is derivable or non-derivable. For the most applications such a simple result is enough. For some application we also need the smallest set of assumptions, those are enough to get a derivation of given conclusion formula.

For example, suppose we have logic-based intelligent system for reasoning on requirements of legal acts. Our knowledge base is a set of assumptions (logic formulas), those describe particular requirements, restrictions presented in the legal acts. Suppose, our system may check if some given restriction, requirement shall be applied or not, or some action, operation is legal or not in the particular situation. Using classical prover, we will be able to provide the main answer – is it applicable or not. But in the example case, it is not enough. The system user should be able to explain the decision correctness – to present the set of legal act requirements, those leads to the decision. Therefore, we also need the set of assumptions (related to particular legal requirements) used to derive our conclusion.

General purpose calculi and decision procedures do not care about assumption traceability. Usually they may by modified to return used assumptions. Unfortunately, the returned set of assumptions may contain unnecessary assumptions, those are not needed for the derivation, but they were used during derivation. There can be few different derivation trees based on the different assumptions, classical methods will return only one of them. As a result, we may get the set of used assumptions containing 50 or 100 assumptions, even if there exist a small set of 5 or 10 assumptions, those are enough to prove a goal formula. Therefore, we need methods those ensure assumption traceability feature – returning the smallest set of assumptions for provided formula derivation.

There is also other research area of the traceability. When a set of used assumptions to derive some goal and derivation tree is already presented, we may analyse the decision tree itself to get even more useful information. Sometimes formal logics are also used for such a reasoning. Such a research may be found in [3].

In the next section we will introduce a new propositional logic method with assumption traceability feature. We will call it “Decision procedure with assumption traceability for the propositional logic”, or shortly PWATPL procedure. For creating PWATPL procedure some techniques were used – indexing formulas and loop checking. Indexing formulas are widely used in logical calculi for different modal logics. Usually indexing formulas are used to show finality, completeness or soundness of the calculus (see [4, 6]). We use indexed formulas for the different purpose. We will introduce 2 level indexes: the first is used to ensure the smallest set of assumptions, the second – to ensure traceability itself. Loop checking technique for some modal logics are used to achieve the finality of the calculus (see [1]). We will use loop checking to ensure completeness and soundness of our method.

1 Derivation procedure

Suppose we have the set of premises { φ 1 , . . . , φ n } (assumption formulas) and the goal formula ψ .

Definition 1. Suite is a structure: [ i 1 , i 2 , i 3 , . . . , i n ; s t a t e ; q 1 , q 2 , . . . , q k ] , where:

Example 1. Suite [ 2 . 2 , 3 . 1 , 3 . 2 ; l o o p ; p , ¬ q ] is a loop suite (with looping literals p and ¬ p ), containing indeces, those refer to clauses D 2 . 2 , D 3 . 1 , D 3 . 2 from 2 premises φ 2 , φ 3 .

Definition 2. Joint (union) suite of the suites S 1 = [ i 1 , i 2 , . . . , i n ; s t 1 ; q 1 , q 2 , . . . , q k ] and S 2 = [ j 1 , j 2 , . . . , j m ; s t 2 ; p 1 , p 2 , . . . , p r ] is a new suite S = S 1 S 2 = [ { i 1 , i 2 , . . . , i n } { j 1 , j 2 , . . . , j m } , s t , { q 1 , q 2 , . . . , q k } { p 1 , p 2 , . . . , p r } ] , where state st= closed if s t 1 = s t 2 = closed, and, otherwise, st= loop.

Definition 3. Literal structure LS = ⟨state,setOfSuites⟩, where:

Initialization:

  1. 1. Convert every premise into conjunctive normal form (CNF): , where D i . j is a disjunctive clause (further clause).
  2. 2. For every obtained clause D i . j give a two level index – i . j The first index part refers to the premise, and the second part refers to the particular clause.
  3. 3. Create set S of all clauses (clause indexes) obtained from every premise.
  4. 4. For every literal used in any clause create a structure LS.

PWATPL procedure for the goal formula G derivation follows:

  1. 1. Convert goal formula G into disjunctive normal form (DNF): G = F 1 F 2 . . . F s , where F l conjunctive clause (further conjunct).
  2. 2. For every conjunct F l perform derivation procedure deriveConjunct( F l ).
  3. 3. Put obtained suite into the set of good suites – GoodSuites.
  4. 4. Choose the smallest suite from the GoodSuites. Note: only the first level indices should be taken into consideration during suite comparison, since they define real premises, not their parts only.

Conjunct derivation procedure deriveConjunct( F ) follows:

  1. 1. For every literal p j perform procedure getSuitesFor( p j ). As the result we get the set of suites R ' ( p j ) for the literal p j . R ' ( p j ) will contain closed suites and loop suites as well.
  2. 2. Obtain the set of the closed suites R ( p j ) R ' ( p j ) – remove every loop suite from R ' ( p j ) and leave only the closed ones. R ( p j ) contains suites, from which literal p j is derivable.
  3. 3. Join all the obtained set of suites for single literals p j ( j = 1 , 2 , . . . , k ) into the one set of closed suites R ( F ) for conjunct

    R ( F ) is obtained similar to getting Cortesian product – every suite form R ( p 1 ) should be joint (union operation) with every suite from R ( p 2 ) and the result suites – with every suite from R ( p 2 ) , and so on. If R ( p j ) = , for any j , R ( F ) is also an empty set. R ( F ) contains suites, from which conjunct F is derivable.

  4. 4. Choose the smallest suite from the set R ( F ) . Note: only the first level indices should be taken into consideration during suite comparison, since they define real premises, not their parts only.
  5. 5. The smallest suite from the set R ( F ) is a result of deriveConjunct( F ).

Now we introduce helper suite generation procedure genSuites(suiteMap,C(p)). It generates suites for the literal p from suites of the literals containing in the same clause.

Suppose clause C ( p ) = p ∨¬ c 1 . . . ∨¬ c m , and suite map for literals is suiteMap = { c 1 { S 1 . 1 , . . . , S 1 . k 1 } , . . . , c m { S m . 1 , . . . , S m . k m } } . { S x . 1 , . . . , S x . k x } is a set of the suites of the literal c x .

Procedure genSuites(suiteMap,C(p)) generates new suites for literal p as follows:

  1. 1. Create set of union suites

    S = { S 1 . 1 S 2 . 1 . . . S m . 1 , . . . , S 1 . k 1 S 2 . k 2 . . . S m . k m , } – all posible unions of m suites taking one suite per one literal (like Cartesian product).

  2. 2. Add C(p) index into every suite of the set S.
  3. 3. Remove litaral p from looping literals from every suite of the set S.
  4. 4. From the suite set S remove duplicates and supersuites (leave only subsuites).

Finally, we present the main procedure getSuitesFor( p j ). It returns the set of suites literal p j is derivable from.

For the further text, by the ¬c we denote the opposite literal to c: if c = q , then ¬ c = ¬ q , if c = ¬ q then ¬ c = q . Therefore, ¬ c does not mean, that literal has negation.

Procedure getSuitesFor( p j ) follows:



The following examples explain the main idea of the used loop-checking (good and bad loops) in the procedure.

Example 2 |Good-loop|. Suppose we have the set of clauses

S = { D 1 . 1 = p ¬ q ¬ z , D 2 . 1 = q ¬ y , D 3 . 1 = y p , D 4 . 1 = z ¬ p , D 5 . 1 = ¬ z p }

Clauses p ∨¬ q ∨¬ z , q ∨¬ y . y p creates “good-loop” for y, since for deriving p using D 1 . 1 it is enough to derive qp (and z): to derive p from the p ∨ ¬q ∨ ¬z, we need to derive q and z, to derive q, we need to derive y, to derive y, we need to derive ¬p. Since p is our goal, there is no need to eliminate p at all – we leave it in a loop suite.

Clauses p ∨ ¬q ∨ ¬z,z ∨ ¬p creates another “good-loop” for z.

Therefore, we create loop suites: [3.1;loop;p] for y and, as a result, we create loop suite [2.1,3.1;loop;p] for q, and [4.1;loop;p] for z.

Finally, from loop suites [2.1,3.1;loop;p] and [4.1;loop;p] we generate closed loop [1.1,2.1,3.1,4.1;closed;] for p.

Remark that q and z are non-derivable by themselves form the given set S. Example

Example 3 [Bad-loop]. Suppose we have the set of clauses

S = { D 1 . 1 = p ∨¬ q ∨¬ z , D 2 . 1 = q ∨¬ y , D 3 . 1 = y ∨¬ p , D 4 . 1 = y p , D 5 . 1 = z }

Clauses p∨¬q∨¬z,q∨¬y, y∨¬p creates “bad-loop”, since it is impossible to derive p using these clauses: to derive p from the p ∨ ¬q ∨ ¬z, we need to derive q and z, to derive q, we need to derive y, to derive y, we need to derive p. But p is our goal. Therefore, there is no sense to use such a derivation path for p derivation.

Despite this, it does not mean, that y is not derivable by itself using clause D 3 . 1 = y ∨¬ p . D 3 . 1 is not useful for p derivation, but y may be derived from the D 3 . 1 = y ∨¬ p and D 4 . 1 = y p . This is the reason, we cannot mark y as non-derivable if “bad-loop” was found. We just mark it is explored for particular derivation path. Derivation procedure still derives y.

Note, that p is still derivable from the set {D1.1,D2.1,D4.1,D5.1} in the given example, and PWATPL procedure returns suite [1.1,2.1,4.1,5.1;closed].

At first sight, it may look like PWATPL procedure is polynomial, since we explore every literal once. Unfortunately, it is not a true. “Bad loops” cause us to mark literals as explored for particular derivation path only. It means the same literal may be explored for the second time, and, therefore, we get an exponential complexity. It is not surprise, since it is 3SAT problem, which is known to be NP-complete according Cook theorem [2].

Lemma 1. If Derivation procedure getSuitesFor(p) for literal p returns suite [ i 1 , i 2 , i 3 , . . . , i n ; loop/closed; q 1 , q 2 , . . . , q k ] , then clause p∨q1 ∨q2 ∨···∨qk is derivable from the set of clauses S = {Di1,Di2,...,Din} using Resolution method.

Proof. The proof goes from mathematical induction according suite size S size – n.

Lemma 2. If clause p q 1 q 2 . . . q k is derivable from the set of clauses S = { D i 1 D i 2 , . . . , D i n } then suite [ i 1 , i 2 , i 3 , . . . , i n ; loop/closed; q 1 , q 2 , . . . , q k ] will be returned by the Derivation procedure getSuitesFor(p).

Proof. The proof goes from mathematical induction according clause p q 1 q 2 . . . q k derivation length m using Resolution method.

As the special case, we get, that literal p is derivable from the set of clauses S =

As the special case, we get, that literal p is derivable from the set of clauses S = { D i 1 , D i 2 , . . . , D i n } using Resolution method if and only if suite [ i 1 , i 2 , i 3 , . . . , i n ; closed] is returned by the Derivation procedure getSuitesFor(p).

Therefore, PWATPL procedure is equivalent to classical Resolution method.

2 Conclusions

PWATPL procedure is a decision procedure with assumption traceability feature for propositional logic. Suites structures were used to “catch” loops, and 2 level indices were used to ensure getting smallest set of the used assumptions as a result. Despite PWATPL procedure returns much more information (set of needed and enough assumptions) comparing with classical derivation methods, its complexity is still as the Resolution method complexity for the worst case.

References

1. R. Alonderis, H. Giedra, A. Pliuškevičiene˙, R. Pliuškevičius. Loop-type sequent calculi for temporal logic. J. Autom. Reason., 64:1663—-1684, 2020.

2. S.A. Cook. The complexity of theorem-proving procedures. In Conference Record of Third Annual ACM Symposium on Theoryof Computing, pp. 151—-158, 1971.

3. J. Dick. Rich traceability. In Proc. 1st TEFSE, pp. 18–23, 2002.

4. G. Mints. Indexed systems of sequents and cut-elimination. J. Philos. Log., 26(6):671– 696, 1997.

5. S. Norge˙la. Matematine˙ logika. TEV, Vilnius, 2004.

6. A. Pliuškevičiene˙, R. Pliuškevičius. A new method to obtain termination in backward proof search for modal logic s4. J. Log. Comput., 20(1):353—-379, 2010.

HTML generado a partir de XML-JATS4R por