uniflcation in propositional logic - unimi.itusers.mat.unimi.it › users › ghilardi › allegati...

43
Unification in Propositional Logic SILVIO GHILARDI Universit`a degli Studi di Milano Dipart. di Scienze dell’Informazione Dresden, October 2004 1

Upload: others

Post on 31-May-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Unification in PropositionalLogic

SILVIO GHILARDI

Universita degli Studi di MilanoDipart. di Scienze dell’Informazione

Dresden, October 2004

1

PART I: FOUNDATIONS

2

1. MAIN AIM

It is well-known that standard propositionallogics have algebraic counterparts into speciallattice-based varieties, for instance:

classical logic versus Boolean algebras

intuitionistic logic versus Heyting algebras

modal logics versus Boolean algebraswith operators

. . .

3

Thus it makes sense to apply E-UnificationTheory to a propositional logic L: we can de-fine various kinds of unification problems (ele-mentary, with constants, general), speak aboutunifiers, unification types, etc., in the logic L:when we do that, we are simply using standarddefinitions (see e.g. Baader-Snyder survey inthe ‘Handbook of Automated Reasoning’) forthe corresponding algebraic theories.

Of course, definitions can be ‘translated back’directly to logic: we shall do that for elemen-tary unification in intuitionistic logic, give re-sults and applications for that specific case andmention parallel extensions to some standardmodal logics over K4.

N.B.: in the ‘logical translation’ below, someobvious simplifications are directly applied.

4

2. PROBLEMS AND UNIFIERS

• Intuitionistic formulas are built from vari-ables x, y, . . . by using connectives ∧,∨,→,⊥,>. F (x) are the formulas containing atmost the variables x = x1, . . . , xn.

• ` A means that A is provable in intuition-istic propositional calculus (IPC);

• A substitution σ : F (x) −→ F (y) is a mapcommuting with the connectives.

• Two substitutions of same domain F (x)and codomain F (y) are equivalent (writtenσ1 ∼ σ2) iff for all x ∈ x,

` σ1(x) ↔ σ2(x).

• σ1 : F (x) −→ F (y1) is more generalthan σ2 : F (x) −→ F (y2) iff there is τ :F (y1) −→ F (y2) such that (τ ◦ σ1) ∼ σ2.

5

• A unification problem is a formula A(x); asolution to it (i.e. a unifier) is any substi-tution σ : F (x) −→ F (y) such that

` σ(A).

• The remaining definitions (complete sets ofunifiers, bases, unification types, etc.) arethe usual ones.

Theorem 1. Unification type is finite:that is, for every unification problem A thereis a finite (possibly empty) set SA of solu-tions, such that any other possible solutionfor A is less general than a member of SA.

Also, SA is computable from A (we shall de-scribe an algorithm later on).

6

3. KRIPKE MODELS

A finite Kripke model over x is a triple〈x, P, u〉, where x is a finite tuple of variables,P is a finite rooted poset and u : P −→ P(x) isa map satisfying the monotonicity requirement

q ≤ p ⇒ u(q) ⊆ u(p).

If u : P −→ P(x) is a Kripke model, A ∈F (x) and p ∈ P , the forcing relation u |=p A isdefined as:

u |=p x iff x ∈ u(p);

u |=p >;

u 6|=p ⊥;

u |=p A1 ∧ A2 iff u |=p A1 and u |=p A2;

u |=p A1 ∨ A2 iff u |=p A1 or u |=p A2;

u |=p A1 → A2 iff ∀q ≥ p (u |=q A1 ⇒⇒ u |=q A2).

7

(Bounded) bisimulation. Given two modelsover x, say u : P −→ P(x) and v : Q −→P(x), the Ehrenfeucht-Fraisse-Fine game onthem has two players. Player I chooses either Por Q and a point in it; Player II picks a pointin the other poset and so on. The only rule isthat, if w (either in P or in Q) has been cho-sen, then only points w′ ≥ w can be chosenin the successive move. The game has a preas-signed number n of moves. Player II wins iff itsucceeds in keeping the forcing of propositionalvariables pairwise identical (i.e. it wins iff forevery i = 1, . . . , n, if pi ∈ P and qi ∈ Q havebeen chosen in the i-th round, then we haveu(pi) = u(qi)).

8

We say that u and v are n-bisimilar (writtenu ∼n v) iff Player II has a winning strategyin the game with n moves. It turns out thatu and v are n-bisimilar iff they force (in theroot) precisely the same formulas whose nestedimplications degree is at most n.

The relation u ≤n v is defined as∼n, the onlydifference is that Player I is now allowed to playthe first move only in the domain of u.

The bisimulation relation u ∼∞ v is definedas ∼n, but now the game has infinitely manymoves.

9

To get the appropriate geometric intuition, onehas to consider formulas as subspaces of thespaces of models and substitutions as transfor-mations among such spaces. Formally, define:

- for a tuple x, F (x)∗ is the set (‘space’) of mod-els over x;

- for a formula A ∈ F (x), let

A∗ = {u ∈ F (x)∗ |u |= A},where u |= A means that A is true at allpoints of P (or, equivalently, at the root).

- for a substitution σ : F (x) −→ F (y), define

σ∗ : F (y)∗ −→ F (x)∗

by associating with u : P −→ P(y), theKripke model σ∗(u) : P −→ P(x) givenby:

x ∈ σ∗(u)(p) iff u |=p σ(x)

for all x ∈ x and p ∈ P.

10

Easy but important facts:

• ` A → B iff A∗ ⊆ B∗;

• u |=p σ(A) iff σ∗(u) |=p A;

• ` σ(A) iff the image of σ∗ is contained inA∗;

• (σ ◦ τ )∗ = τ ∗ ◦ σ∗.

It can be shown that the sets of models of thekind A∗ are precisely the sets of models closedunder ≤n for sufficiently large n (see the book(G.-Zawadowski 2002), for a full duality the-ory).

11

Digression. A very remarkable (absolutelynon trivial) fact is Pitts’ theorem, that can bereformulated by saying that [σ∗(A∗)]∼∞ is al-ways of the kind B∗, for some B (in modallogic, Pitts’ theorem holds for GL,Grz, but notfor K4, S4). Here [σ∗(A∗)]∼∞ is the closure ofσ∗(A∗) under bisimulation.

Pitts’ theorem has many meanings: proof-theoretically, it means that second order IPCcan be interpreted in IPC, model-theoreticallyit means that the theory of Heyting algebrashas a model completion and categorically thatthe opposite of the category of finitely presentedHeyting algebras is a Heyting category.

To prove Pitts’ theorem semantically, one ba-sically has to show that [σ∗(A∗)]∼∞ is closedunder ≤N , for sufficiently large N (depending -recursively ! - on the implicational degree of Aand of the formulas σ(x)).

12

4. PROJECTIVE FORMULAS

The notion of a projective (finitely presented)algebra is well-known and, once ‘translated’ intosymbolic logic means the following. A formulaA ∈ F (x) is projective iff there is a unifierµA : F (x) −→ F (x) for it such that we have

(∗) ` A → (x ↔ µA(x))

for all x ∈ x (such a µA is easily seen to beautomatically an mgu for A).

Geometrically, A is projective iff A∗ is a con-tractible subspace of F (x)∗: that is, there is asubstitution µA, whose associated transforma-tion µ∗A maps F (x)∗ onto A∗, while keeping A∗

fixed.

13

Boolean Unification. In the Boolean case, aformula A ∈ F (x) is projective iff it is satisfi-able (from this, unitarity of Boolean unificationis immediate). Here you are the proof.

Let A ∈ F (x) be satisfiable by the assign-ment a. Define θA

a by:

θAa (x) =

A → x, if a(x) = 1;A ∧ x, if a(x) = 0.

That θAa satisfy (∗) is easy; to show that

θAa (A) is provable in classical logic, one may use

the following argument. We need to show that(θA

a )∗(u) ∈ A∗ (here u is any one-point model- remember we are in classical logic), but fromthe definition

(θAa )∗(u) |= x iff u |= θA

a (x),

we realize that (θAa )∗(u) is u (if u ∈ A∗), or it is

equal to a (if u 6∈ A∗): in both cases (θAa )∗(u) ∈

A∗.

14

The substitutions θAa used in the Boolean

case, contribute to the construction of minimalbases of unifiers in IPC too. θA

a is indexed bya formula A ∈ F (x) and by a classical assign-ment a over x.

How does the transformation (θAa )∗ act on a

Kripke model u : P −→ P(x)? First, it doesnot change the forcing in the points p ∈ P suchthat u |=p A. In the other points q, θA

a tries tomake the forcing ‘as close as possible’ to a: ifa(x) = 0, then x 6∈ (θA

a )∗(u)(q) and if a(x) = 1,then x ∈ (θA

a )∗(u)(q), unless this is impossiblebecause in some point p ≥ q, we have u |=p Aand u 6|=p x (recall that forcing in such p’s isnot changed by (θA

a )∗).

Thus, applying any iteration of transforma-tions of the kind (θA

a )∗ keeps models in A∗ fixedand (in principle) pushes further models intoA∗.

15

On the other hand, it is easily seen that a con-tractible subspace A∗ is extensible: if u 6∈ A∗,then it is possible to change the forcing in thepoints of u which do not force A in such a waythat the model so modified belongs in toto toA∗ (this is mainly because the transformationsinduced by a substitution commute with restric-tions to generated submodels).

By exploiting the above mentioned effect oftransformations of the kind (θA

a )∗ on Kripkemodels, one can show that a carefully built it-eration θA of substitutions of the kind θA

a can infact always act as the contraction transforma-tion of a contractible A∗ (that is, either such θA

unifies A and consequently works as a contrac-tion, or A is not projective).1

This leads to the following

1For simplicity, we skip the precise definition of θA, see the papers in the referencesbelow.

16

Theorem 2. For a formula A ∈ F (x) thefollowing are equivalent:

(i) A is projective;

(ii) A∗ is extensible;

(iii) θA unifies A.

In particular, it is decidable whether A is pro-jective or not and mgus of projective formulasare computable.

For modal logics over K4 with finite modelproperty, the above theorem holds too: hereonly formulas of the kind 2+A are candidateprojective and the substitution θ2+A is definedin a slightly different way (much more iterationsof the θ2+A

a are needed). The proof of the Theo-rem uses a more sophisticated argument (basedon bounded bisimulation ranks) which is notnecessary in intuitionistic logic, where more el-ementary considerations suffice.

17

4. UNIFICATION IS FINITARY

We are not far from the general result. Ifσ : F (x) −→ F (y) unifies A ∈ F (x), then A∗

contains the (bisimulation closure of the) imageof σ∗; the latter is an extensible set which, byPitts theorem2 is of the kind B∗. Then B∗ isprojective, it has an mgu µB which is a bettersubstitution than σ; also B∗ ⊆ A∗ implies thatµB is a unifier for A too (better than the orig-inal σ). Thus, in order to unify A we do notloose in generality if we restrict to mgus µB

of projective formulas B implying A.

Unfortunately, however, there are usually in-finitely many projective formulas in F (x) im-plying a given A ∈ F (x). Hence we need arefinement of the argument: bounded bisimula-tions will help.

2The whole argument can be made independent on Pitts theorem (this is importantfor modal logic where Pitts theorem can fail).

18

First, notice that for projective P (see (∗))(+) ` P → B iff ` µP (B).

Hence, if P1, P2 are both projective, ` P1 → P2

means that µP1 is less general than µP2 (‘prov-ability comparison is the same as mgus compar-ison for projective formulas’).

Secondly, for any n, the ≤n-closure of an ex-tensible set is still extensible. In particular, ifP is projective, A has implicational degree nand P ∗ ⊆ A∗, we have P ∗ ⊆ [P ∗]≤n ⊆ A∗ and[P ∗]≤n = Q∗, for some Q projective of degreeat most n.

19

These two facts, once combined, say that inorder to unify A we do not loose in gener-ality if we restrict to mgus µP of projectiveformulas P implying A and having at mostthe same implicational degree as A.

This shows finitarity of intuitionistic unifica-tion and gives a type conformal unification al-gorithm. The arguments in this section can berepeated for the modal logics K4, S4, Grz, GLwithout any essential modification.

As a corollary, we also get that a formula ofdegree n is unifiable iff there is a projective for-mula implying it and having at most degree n(this gives an effective test for solvability of uni-fication problems - the test is precious in themodal case, where unifiability does not reduceto satisfiability, as it happens in the intuitionis-tic case).

20

4. ADMISSIBLE RULES

Let A be a formula of implicational degree n.A projective approximation ΠA of A is any fi-nite set of projective formulas implying A andhaving at most implicational degree n; ΠA mustbe such that any further projective formula im-plying A implies a member of ΠA too.

Clearly, for any projective approximation ΠA

of A, the set

SA = {µP | P ∈ ΠA}is a finite complete set of unifiers for A.

21

An inference rule

AB

is admissible in IPC iff we have ` σ(B) for allσ such that ` σ(A).

From the above considerations and from (+),it follows that the rule A/B is admissible iff wehave

` P → B

for all P ∈ ΠA, where ΠA is any projectiveapproximation of A.

The same result holds for modal logicsK4, S4, Grz, GL.

22

PART II: ALGORITHMS

23

5. TWO PROBLEMS

From Part I, it is evident that there are twomain computational problems for a given for-mula A:

• check whether A is projective or not;

• in the negative case, compute a projectiveapproximation of A.

The explicit computation of mgus or of com-plete sets of unifiers seems to be less important(see the application to admissible rules) and, inany case, it is only a question of writing downexplicitly defined substitutions (namely the θP ’sfor P ∈ ΠA).

24

The algorithms for solving our two problemsthat are suggested by the proofs of Theorems2 and 1 turn out to be very inefficient. Inparticular, Theorem 1 gives a non elementaryprocedure (because the number of non prov-ably equivalent formulas up to a certain impli-cational degree is non-elementary).

We shall provide an exponential algorithm forthe first problem and a double exponential onefor the second.

25

6. CHECK-PROJECTIVITY

The algorithm analyzes ‘reasons’ why a for-mula A can be false in the root of a Kripkemodel and true in the context of the model(namely, in all the points different from theroot). If such reasons ‘cannot be repaired’ bychanging the forcing in the root of the model,A is not projective; otherwise A is projective.

The algorithm is a mixture of tableaux and ofresolution methods. It deals with sets of signedsubformulas of A, where a signed subformulais a ‘modality’ followed by a subformula of A.We have truth, context and atomic modalities,whose meaning is explained as follows:

26

Truth Modalities

TB ‘B is true in the root’

FB ‘B is false in the root’

Context Modalities

TcB ‘B is true in the context’

FcB ‘B is false in the context’

Atomic modalities

x+ ‘x is true in the root’

x− ‘x is false in the root and truein the context’

27

The algorithm is initialized to

{FA}.It applies the following rules in a dont’care non-deterministic way, till no rule applies anymore.To apply a rule, replace (in the current state)the set(s) of signed formulas in the premise bythe set(s) of signed formulas in the conclusion.

The algorithm terminates in exponentiallymany steps.3

A is projective iff all output sets containatomic modalities.

3Provided some control device forbids repeated applications of the same instance of theResolution Rule.

28

Tableaux Rules

∆ ∪ {TB1 ∧B2}∆ ∪ {TB1, TB2}

∆ ∪ {T>}∆

∆ ∪ {TB1 ∨B2}∆ ∪ {TB1}, ∆ ∪ {TB2}

∆ ∪ {T⊥}×

∆ ∪ {FB1 ∧B2}∆ ∪ {FB1}, ∆ ∪ {FB2}

∆ ∪ {F>}×

29

∆ ∪ {FB1 ∨B2}∆ ∪ {FB1, FB2}

∆ ∪ {F⊥}∆

∆ ∪ {TB1 → B2}∆ ∪ {FB1, TcB1 → B2}, ∆ ∪ {TB2}

∆ ∪ {FB1 → B2}∆ ∪ {FcB1 → B2}, ∆ ∪ {TB1, FB2}

∆ ∪ {Tx}∆ ∪ {x+}

∆ ∪ {Fx}∆ ∪ {x−}, ∆ ∪ {Fcx}

30

Resolution Rule

∆ ∪ {x+}, Γ ∪ {x−}∆ ∪ {x+}, Γ ∪ {x−}, ∆ ∪ Γ ∪ {Tcx}

Simplification Rule

∆×

provided there exists some FcC ∈ ∆ such that

` A ∧ ∧{B | TcB ∈ ∆} → C

(the application of this rule requires callingfor an IPC prover, hence solving a PSPACE-complete problem).

31

Refinements are possible: e.g. the calculus iscomplete, if we use ordered resolution insteadof plain resolution. It is compatible with sim-plifications like

Optional Simplification Rule

∆×

provided ∆ is subsumed by some other Γ or pro-vided it contains a pair of contradictory modal-ities.

32

PROBLEMS:

• there might be a PSPACE algorithm (?);

• use ideas from DPLL, like ‘truth-valuebranching’, etc. (?);

• define useful strategies (the obvious one isthat of giving priority to tableaux rules);

• make a thorough comparison with thehypersequent calculus for admissibility of(Iemhoff, 2003) (this is theoretically basedon an eleboration of the above results ofmine and of previous results from the dutchschool).

Extensions to modal logics K4, S4, GL, Grzare not difficult (Zucchelli, 2004): basically, it issufficient to appropriately modify the tableauxrules.

33

7. ITERATIONS

If A is not projective, there is an output set∆ for A which does not contain neither truth(rules are exhaustively applied) nor atomicmodalities. If there are no signed subformu-las of the kind FcB in ∆, A has empty pro-jective approximation (consequently, it is notunifiable). Otherwise, for each FcC ∈ ∆, were-run the check-projectivity algorithm on thenew formula

A ∧ ∧{B | TcB ∈ ∆} → C.

We can in fact re-initialize the algorithm bysimply replacing, in the final state, the set ∆ by

{TB | TcB ∈ ∆} ∪ {FC}.

34

Such iterations stop whenever the projectiv-ity test is positive: the projective formulas socollected are a projective approximation of A.Notice that

• only sets of signed subformulas of the origi-nal A occur in any step of any iteration;

• the branches in the iterations tree are atmost exponentially long (the same ∆ can-not be used twice for re-initialization alongthe same branch, because once ∆ is used,Simplification Rule can remove any furtheroccurrence of it);

• only formulas which are implications of aconjunction of subformulas of A versus asubformula of A can be in the final projec-tive approximation of A.

35

Starting from the above observations, it can beshown that computing projective approxima-tions requires double exponential time; more-over projective approximations themselves seemto contain double exponentially many exponen-tially long formulas.

Obvious open problem: is it possible to doanything better? Practical examples examinedso far (even by computer) do not confirm thatprojective approximations can be that large ....

36

8. A FIRST IMPLEMENTATION

(Zucchelli, 2004) realized a first implementa-tion in his Master Thesis. His system is de-signed to check projectivity, compute projec-tive approximations and decide admissibility ofrules for modal systems K4 and S4 (this en-compasses intuitionistic logic via modal trans-lation).

For Simplification Rule provability tests, thewell-performed RACER prover is used.

We report some experimental tests (NB: theactual system is still at a very prototypical leveland even evident optimizations have not yetbeen implemented).

37

The system was able to recognize in less thanone second simple well-known admissible IPC-rules like

¬x → y ∨ z(¬x → y) ∨ (¬x → z)

((x → y) → z) → ((x → y) ∨ ¬z)¬¬(x → y) ∨ ¬z

Visser rules∧ni=1[(xi → yi) → xi+1 ∨ xi+2]

∨n+2i=1 [∧n

j=1(xj → yj) → xi]

were proved to be admissible for n ≤ 11.

The 6 formulas in the projective approximationof (the modal translation of) the formula

[[x1→ (y1∨z1)]∧[(x1→x2)→y2∨z2]→w]→ t1∨t2

from (G. 2002) were correctly computed inabout 3 sec.

38

8. FURTHER READINGS

The content of Part I is covered by the papers

• S. Ghilardi Unification in intuitionisticlogic, Journal of Symbolic Logic, vol.64, n.2,pp.859-880 (1999);

• S. Ghilardi Best solving modal equations,Annals of Pure and Applied Logic, 102,pp.183-198 (2000),

whereas the content of Part II is covered by

• S. Ghilardi A resolution/tableaux algo-rithm for projective approximations inIPC, Logic Journal of the IGPL, vol.10, n.3,pp.227-241 (2002);

• D. Zucchelli Studio e realizzazione di al-goritmi per l’unificazione nelle logichemodali, Master Thesis, Universita degliStudi di Milano (2004).4

4A regular english paper is in preparation.

39

Further topics on unification in propositionallogic can be found in:

• S. Ghilardi Unification through projectiv-ity, Journal of Logic and Computation, 7,6, pp.733-752 (1997);

• S. Ghilardi Unification, Finite Dualityand Projectivity in Varieties of Heyt-ing Algebras, Annals of Pure and AppliedLogic, vol. 127/1-3, pp.99-115 (2004);

• S. Ghilardi, L. Sacchetti Filtering Unifica-tion and Most General Unifiers in ModalLogic, Journal of Symbolic Logic, 69, 3,pp.879-906 (2004).

40

For unification and matching with constants infragments of multimodal languages (within adescription logics context), see

• F. Baader, P. Narendran Unification ofConcept Terms in Description Logics,Journal of Symbolic Computation, 31(3),pp. 277-305 (2001);

• F. Baader, R. Kusters Matching in de-scription logics with existential restric-tions, in “Principles of Knowledge Repre-sentation and Reasoning (KR ’00)”, (2000).

• F. Baader, R. Kusters Unification in adescription logic with transitive closureof roles, in “Logic for Programming, Ar-tificial Intelligence and Reasoning (LPAR’01)”, Lecture Notes in Artificial Intelli-gence, (2001).

41

For furter information on admissibility of infer-ence rules, see

• V. Rybakov Admissibility of Logical In-ference Rules, North Holland (1997);

• R. Iemhoff On the admissible rules of in-tuitionistic propositional logic, Journal ofSymbolic Logic, 66, pp. 281-243 (2001);

• R. Iemhoff Towards a proof system for ad-missibility, in M. Baaz and A. Makowski(eds.) ‘Computer Science Logic 03’, LectureNotes in Computer Science 2803, pp.255-270(2003);

• G. Mints, A. Kojevnikov IntuitionisticFrege systems are polynomially equiva-lent, preprint (2004).

42

For more on Pitts theorem, (bounded) bisimu-lation, games and duality in propositional logic,see the book

• S.Ghilardi, M. Zawadowski Sheaves, Ga-mes and Model Completions, Trends inLogic Series, Kluwer (2002).

July 2006 (update): undecidability ofunifiability in various modal systems endowedwith the universal modality has been recentlyshown by F. Wolter and M. Zakharyaschev.

43