direct resolution for modal-like logics - researchgate · direct resolution for modal-like logics...

5
See discussions, stats, and author profiles for this publication at: https://www.researchgate.net/publication/2926452 Direct Resolution for Modal-like Logics Article · November 2002 Source: CiteSeer CITATIONS 2 2 authors: Some of the authors of this publication are also working on these related projects: Hybrid Intensional Logic View project XPath as a Modal Logic with Data View project Carlos Areces National University of Cordoba, Argentina 146 PUBLICATIONS 1,259 CITATIONS SEE PROFILE Juan M. Heguiabehere 22 PUBLICATIONS 84 CITATIONS SEE PROFILE All content following this page was uploaded by Carlos Areces on 17 December 2012. The user has requested enhancement of the downloaded file.

Upload: dinhdiep

Post on 06-Aug-2018

213 views

Category:

Documents


0 download

TRANSCRIPT

See discussions, stats, and author profiles for this publication at: https://www.researchgate.net/publication/2926452

Direct Resolution for Modal-like Logics

Article · November 2002

Source: CiteSeer

CITATIONS

2

2 authors:

Some of the authors of this publication are also working on these related projects:

Hybrid Intensional Logic View project

XPath as a Modal Logic with Data View project

Carlos Areces

National University of Cordoba, Argentina

146 PUBLICATIONS   1,259 CITATIONS   

SEE PROFILE

Juan M. Heguiabehere

22 PUBLICATIONS   84 CITATIONS   

SEE PROFILE

All content following this page was uploaded by Carlos Areces on 17 December 2012.

The user has requested enhancement of the downloaded file.

Direct Resolution for Modal-like Logics

Carlos Areces Juan Heguiabehere

Faculty of Science. University of Amsterdam

{carlos,juanh}@science.uva.nl

Direct resolution and hybrid logics: Designing resolution methods that can directly (without translationinto large background languages) be applied to modal logics, received some attention in the late 1980s andearly 1990s. But even though modal languages are sometimes viewed as “simple extensions of proposi-tional logic,” direct resolution for modal languages proved to be a difficult task. Intuitively, in basic modallanguages the resolution rule has to operateinsideboxes and diamonds to achieve completeness. This leadsto more complex systems, less elegant results, and poorer performance, ruining the “one-dumb-rule” spiritof resolution. In [2] we presented a resolution calculus forhybrid logics addressing these problems: thehybrid machinery is used to “push formulas out of modalities” and in this way, feed them into a simple andstandard resolution rule.

We cannot give a proper introduction to hybrid logics in thisabstract. See the Hybrid Logic site athttp://www.hylo.net for an introduction to the topic and a broad on-line bibliography. We intend insteadto describeHyLoRes, an automated theorem prover based on the calculi introduced in [2], with specialemphasis on implementation details. [3] provides a description focused on the theoretical aspects involvedin HyLoRes.

Briefly, the resolution calculi implemented byHyLoRes is as follows. Define the following rewrit-ing procedurenf on formulas ofH (@;#). Let ϕ be a formula inH (@;#), nf(ϕ) is obtained by re-peated application of the rewrite rulesnf until none is applicable:nf = fψ_ θ nf; :(:ψ^:θ);hRiψ nf;:[R℄:ψ;:@t ψ

nf;@t:ψ;:#x:ψ nf; #x::ψ;::ψ nf; ψg. Clauses are sets of formulas of this form. Todetermine the satisfiability of a formulaϕ 2 H (@;#) we first notice thatϕ is satisfiable iff @tϕ is satisfi-able, for a nominalt not appearing inϕ. Define the clause setClSetcorresponding toϕ to beClSet(ϕ) =ff@tnf(ϕ)gg. Next, letClSet�(ϕ) – the saturated clause set corresponding toϕ – be the smallest set con-tainingClSet(ϕ) and closed under the following rules.(^) Cl[f@t(ϕ1^ϕ2)g

Cl[f@tϕ1gCl[f@tϕ2g (_) Cl[f@t:(ϕ1^ϕ2)g

Cl[f@tnf(:ϕ1);@tnf(:ϕ2)g(RES)

Cl1[f@tϕg Cl2[f@t:ϕgCl1[Cl2([R℄) Cl1[f@t [R℄ϕg Cl2[f@t:[R℄:sg

Cl1[Cl2[f@sϕg (hRi) Cl[f@t:[R℄ϕgCl[f@t:[R℄:ngCl[f@nnf(:ϕ)g , for n new.(@) Cl[f@t@sϕg

Cl[f@sϕg(SYM)

Cl[f@tsgCl[f@stg (REF)

Cl[f@t:tgCl

(PARAM)Cl1[f@tsg Cl2[fϕ(t)g

Cl1[Cl2[fϕ(t=s)gThe computation ofClSet�(ϕ) is in itself a sound and complete algorithm for checking satisfiability ofH (@), in the sense thatϕ is unsatisfiable if and only if the empty clausefg is a member ofClSet�(ϕ) [2].To account for hybrid sentences using# we need only extend the calculi with the rule(#) Cl[f@t#x:ϕg

Cl[f@tϕ(x=t)g .

The full set of rules is a sound and complete calculus for checking satisfiability of sentences inH (@;#).

The “given clause” algorithm for hybrid resolution HyLoRes implements a version of the “givenclause” algorithm [14] shown in the figure below. The implementation preserves the soundness and com-pleteness of the calculus introduced above, and ensures termination forH (@).

input : init: set of clausesvar: new, clauses, inuse: set of clausesvar: given: clause

clauses :=fg; inuse :=fg; new := init; new := normalize(new);if fg 2 newthen return “unsatisfiable”;clauses := computeComplexity(new);while clauses6= fg dof* Selection of given clause *g

given := select(clauses); clauses := clauses –fgiveng;f* Inference *gnew := infer(given, inuse); new := normalize(new)if fg 2 newthen return “unsatisfiable”f* Subsumption deletion *gnew := simplify(new, inuse[ clauses)inuse := simplify(inuse, new)clauses := simplify(clauses, new)f* Initialization for next cycle *gif notRedundant(given)then

inuse := inuse[ fgivengclauses := clauses[ computeComplexity(new)

return “satisfiable”� normalize(A)appliesnf to formulas inA and handles trivial tautologies/contradictions.� computeComplexity(A)determines length, modal depth, number of literals, etc. for each of theformulas inA; these values are used byselectto pick the given clause.� infer(given,A) applies the resolution rules to the given clause and each clause inA. If the rules(^),(_), (hRi) or (#) are applicable, no other rule is applied as the clauses obtained as conclusions bytheir application subsume the premises.� simplify(A,B)performs subsumption deletion, returning the subset ofA which is not subsumed byany element inB.� notRedundant(given) is true if none of the rules(^), (_), (hRi) or (#) was applied to given.

We discuss now some of the salient characteristics of the prover.

Programing language.HyLoRes is implemented in Haskell (ca. 3500 lines of code), and compiled with theGlasgow Haskell Compiler (GHC) Version 5.02. We use Happy 1.10 to generate the parser. GHC generatesfairly efficient C code which is afterward compiled into an executable file. Thus, users need no additionalsoftware to use the prover. TheHyLoRes site (http://www.illc.uva.nl/˜carlos/HyLoRes ) providesexecutables for Solaris (tested under Solaris 8) and Linux (tested under Red Hat 7.0 and Mandrake 8.0).

The original Haskell code is also made publicly available under the GPL license [8] (the code, though,is still unstable, being under active development). We willsoon provide also the intermediate C sourcewhich could then be compiled under a wider range of platforms. By making all code publicly available weaim to encourage independent development.

In addition toHyLoRes, a graphical interface calledxHyLoRes implemented in Tcl/Tk was developed.It usesHyLoRes in the background and provides full file access and editing capabilities, and a more intuitivecontrol of the command line parameters of the prover.

Data structures.The design of the algorithm is modular with respect to the internal representation of thedifferent kinds of data. We have used the Edison package (a library of efficient data types provided withGHC) to implement most of the data types representing sets. Clauses, for example, are directly representedasUnbalancedSet , while we have chosen different representations for each ofthe clause sets used by the

algorithm: newand inuseare simply lists of clauses (as they always have to be examined sequentially,one by one),clausesis an UnbalancedSet of clauses (whileList provides efficient sequential access totheir elements,UnbalancedSet implements sets as unbalanced search trees to optimize search of singleelements). In particular,clausesis ordered by our selection criterion, which makes for an efficient selectionof the given clause. The selection orders can be chosen from the command line. Four complexity measuresare computed for each clauseC: v the maximum number of propositional variables in a formula in C, dthe maximum modal depth of a formula inC, p the minimum prefix of a formula inC ands the size oftheC (number of formulas inC). Any combination of this measures can be chosen as order forclauses.Selection of different orders can have an important effect on the performance of the prover.

The internal state of the given clause algorithm (the setsclauses, inuseandnew, the data structuresused for subsumption checking, etc) is represented as a combination of a state and an output monads [15];the former provides transparent access to the internal state of the algorithm from the monadic functionsthat perform inference, while the latter handles all printing services with no need of further parameters inthe function signatures. In addition, the use of monads allows the addition of further structure (hashingfunctions, etc.) to optimize search, with minimum re-coding. We have already experienced the advan-tages of the monad architecture as we have been able to check different data structures and improve theperformance of some of the most expensive functions with great ease.

Two other important datatypes were implemented. We use a hashing table to assign integer numbers toformulas minimizing memory use. In addition, a negative formula @i:ϕ is assigned the negative numberassigned to @iϕ. This permits an efficient search for opposed formulas during the application of the (RES)rule. Finally, we use a special kind of tries to optimize subsumption checking (see below).

Inference Rules.HyLoRes actually implements a version ofordered resolution with selection[5], where theapplication of the (RES) and (BOX) rules are restricted to certain selected formulas in the clause. Orderedresolution with selection greatly diminish the size of the saturated set, forbidding the generation of certainclauses, without compromising the completeness of the calculi. Interestingly, the (still unpublished) proofof completeness of ordered resolution with selection forH (@;#) closely follows the proof in [5], basedon a step by step construction of a Herbrand model for any consistent input clause set. Once more, hybridlogics seem to provide the appropriate framework to merge first-order and modal ideas.

We are currently investigating the effect of different orders and selection functions on different inputs.

Extensibility.With respect to the addition of further resolution rules, our main aim was to take advantage ofthe inherent modularity of the given clause algorithm. New rules can simply be added in theinfer functionwithout the need for any further modification of the code. Oneof the main extensions we are planning forversion 2.0 of the prover is the addition of the universal modality A [9]. The logicH (A;#) is as expressiveas FOL and would turnHyLoRes into a full first-order prover. But interestingly, the language is now splitin a radically new way: a decidable part (H (A) with an EXPTIME-complete satisfiability problem) andan undecidable, but intrinsically local part (H (@;#) is equivalent in expressivity to the fragment of FOLinvariant under generated submodels). The languageH (A) is interesting by itself as it let us performinference in terms of full Boolean knowledge bases of the description logicALC in HyLoRes [1].

Subsumption Checking.Subsumption checking (i.e., deciding whether a clause in the clause set is redun-dant and can be deleted) is one of the – or perhaps “the” – most expensive operations in resolution basedtheorem provers [13].HyLoRes uses a simple version of subsumption checking where a clauseC1 sub-sumes a clauseC2 if C1 �C2. Version 1.0 of the prover implemented this test very inefficiently, checkingthe subset relation element by element, and clause by clause. In the latest prototype, a set-at-a-time sub-sumption checking algorithm which uses a clause repositorystructured as a trie [13] was implemented,with notorious improvements. When checking if the setSof clauses subsumes a clauseC we should check,for all Ci 2 S, whetherCi �C. By having the clauses inS ordered in a trie, whenever we determine thatCi 6�C, we can discard all clausesCj sharing the same stem withCj below the element which cause thefailure of the inclusion check.

Paramodulation.We need some kind of paramodulation to handle nominals and @.We can once more takeadvantage from FOL experience in resolution based theorem proving here. In [4], Bachmair and Ganzingerdevelop in detail the modern theory of equational reasoningfor first-order saturation based provers. Manyof the ideas and optimizations discussed there can and should be implemented inHyLoRes. In the currentversion, paramodulation is done naively. The only “optimization” being the orientation of equalities so that

we always replace nominals by nominals which are lower in a certain ordering.

Parameters.The user can control the behavior of the prover by means of command line parameters orby providing a.hyloresrcfile. In the current version, the user can specify a maximum timeout, define theorder for the selection of the given clause, the lexical pathordering used to define maximal clauses, anappropriate selection function, and the detail of the output printed by the prover (from a terse “The formulais satisfiable/unsatisfiable” to a full detail of rules applied during the proof and the state of the differentinternal sets of clauses). We plan to enhance the output of the prover, making possible to display a conciserefutation proof in case it finds one, or a model satisfying the input otherwise.

Testing. During the development ofHyLoRes, we made extensive used of test sets like those describedin [6, 11] to evaluate the performance of the prover and guidedesign decisions. And important drawbackof these test sets though, is that they only providepurely modalinput. We are at the moment developing arandom generator of hybrid formulas following the algorithm presented in [12], to test the performance ofHyLoRes on hybrid input.

Conclusions: The prototype is not yet meant to be competitive when compared with state of the artprovers for modal-like logics like DLP, FaCT, MSPASS or RACER [7, 10]. On the one hand, the systemis still in a preliminary stage of development (only very simple optimizations for hybrid logics have beenimplemented), and on the other hand hybrid and description languages are related but different.H (@;#) isundecidable while the implemented description languages are mostly decidable. And even when compar-ing the fragmentH (@) for which HyLoRes implements a decision algorithm, the expressive powers areincomparable (H (@) permits free Boolean combinations of @ and nominals but lacks the limited form ofuniversal modality available in the T-Box of DL provers [1]).

There certainly remain many things to try and improve inHyLoRes, but the main goal we pursued inVersion 1.0 has been largely achieved: direct resolution can be used as an interesting, and perhaps evencompetitive, alternative to tableaux based methods for modal and hybrid logics.

References[1] C. Areces. Logic Engineering. The Case of Description and Hybrid Logics. PhD thesis, Institute for Logic,

Language and Computation, University of Amsterdam, Amsterdam, The Netherlands, October 2000.[2] C. Areces, H. de Nivelle, and M. de Rijke. Resolution in modal, description and hybrid logic.Journal of Logic

and Computation, 11(5):717–736, 2001.[3] C. Areces and J. Heguiabehere. HyLoRes: A hybrid logic prover based on direct resolution.Proceedings of

Advances in Modal Logic (AiML’02), 2002.[4] L. Bachmair and H. Ganzinger. Equational reasoning in saturation-based theorem proving. InAutomated

deduction—a basis for applications, Vol. I, pages 353–397. Kluwer Acad. Publ., Dordrecht, 1998.[5] L. Bachmair and H. Ganzinger. Resolution theorem proving. In A. Robinson and A. Voronkov, editors,Handbook

of Automated Reasoning, volume I, chapter 2, pages 19–99. Elsevier Science, 2001.[6] P. Balsiger, A. Heuerding, and S. Schwendimann. A benchmark method for the propositional modal logics K,

KT, S4. Journal of Automated Reasoning, 24(3):297–317, 2000.[7] E. Franconi, G. De Giacomo, R. MacGregor, W. Nutt, and C. Welty, editors.Proceedings of the 1998 Interna-

tional Workshop on Description Logics (DL’98), 1998.[8] GNU General Public License.http://www.gnu.org/copyleft/gpl.html .[9] V. Goranko and S. Passy. Using the universal modality: gains and questions.Journal of Logic and Computation,

2:5–30, 1992.[10] P. Lambrix, A. Borgida, M. Lenzerini, R. Moller, and P.Patel-Schneider, editors.Proceedings of the 1999

International Workshop on Description Logics (DL’99), 1999.[11] F. Massacci. Design and results of the Tableaux-99 Non-Classical (Modal) Systems Comparison. In N. Murray,

editor,Proceedings of TABLEAUX’99, volume 1617 ofLNAI, pages 14–18. Springer-Verlag, 1999.[12] P. Patel-Schneider and R. Sebastiani A new very-general method to generate random modal formulae for testing

decision procedures.Journal of Artificial Intelligence Research. Submitted.[13] A. Voronkov. The anatomy of Vampire.Journal of Automated Reasoning, 15(2):237–265, 1995.[14] A. Voronkov. Algorithms, datastructures, and other issues in efficient automated deduction. In R.Gore, A. Leitsch,

and T. Nipkow, editors,Automated Reasoning. IJCAR 2001, number 2083 in LNAI, pages 13–28, Siena, 2001.[15] P. Wadler. Monads for functional programming. In J. Jeuring and E. Meijer, editors,Advanced Functional

Programming, number 925 in LNCS. Springer-Verlag, 1995.

View publication statsView publication stats