A Resolution-Based Theorem Prover for Kn\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\textsf {K}}_{n}^{}$$\end{document}: Architecture, Refinements, Strategies and Experiments

In this paper we describe the implementation of , a resolution-based prover for the basic multimodal logic Kn\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\textsf {K}}_{n}^{}$$\end{document}. The prover implements a resolution-based calculus for both local and global reasoning. The user can choose different normal forms, refinements of the basic resolution calculus, and strategies. We describe these options in detail and discuss their implications. We provide experiments comparing some of these options and comparing the prover with other provers for this logic.


Introduction
Modal logics have long been used in Computer Science for describing and reasoning about complex systems, including programming languages [42], knowledge representation and reasoning [8,21,43], verification of distributed systems [18][19][20] and terminological reasoning [46].The most basic of such logics is the multimodal K n , which extends the classical language with new operators, a and ♦ a , with a ∈ A = {1, . . ., n}, a fixed finite set of indexes.A formula ϕ is interpreted with respect to a Kripke Structure, which comprises a set of worlds, a set of relations over the worlds, and an evaluation function which assigns an interpretation to every atomic formula at every world.This interpretation can then be lifted from atomic formulae to arbitrary formulae.Three related reasoning tasks have been extensively discussed in the literature: (i) given a formula ϕ, the local satisfiability problem consists of showing that there is a model and a world in it that satisfies ϕ; (ii) given a formula ϕ, the global satisfiability problem consists of showing that there is a model such that all worlds in this model satisfy ϕ; (iii) given a set of formulae Γ and a formula ϕ, the local satisfiability of ϕ under the global constraints (or assumptions) Γ consists of showing that there is a model that globally satisfies all formulae in Γ and that there is a world in this model that satisfies ϕ.
Those reasoning tasks are far from trivial.The local satisfiability problem for the multimodal propositional case is PSPACE-complete [21].The global satisfiability and the local satisfiability under global constraint problems for K n are EXPTIME-complete [50].
Several proof methods and tools for reasoning in K n exist, either in the form of methods applied directly to the modal language [17,27] or obtained by translation into a more expressive target language (First-Order Logic [24] or Hybrid Logic [2], for instance).Translation-based methods benefit not only from the existence of available theorem provers, therefore not requiring additional effort for implementation, but also the strategies available for the target language can be almost immediately applied to the translated problem [23].This is not the case for direct methods, where strategies need to be adapted to deal with the underlying normal forms and inference rules.However, the translation into a more expressive logic combined with a standard proof method for that logic may involve a computational overhead and may not necessarily result in a decision procedure for the set of translated formulae.Additionally, standard proof methods for the target logic may not normally include all optimisations and strategies that can be included in a direct method.For example, here we employ 'hyper-resolution-like' inferences that avoid the generation of intermediate resolvents and thereby reduce the search space.
We will focus on the resolution-based methods for K n which are presented in [33,34].Both calculi are clausal: a formula to be tested for satisfiability is first translated into a normal form, to which a set of inference rules are applied.The inference rules applied to propositional clauses (i.e.those where modal operators do not occur) are basically variants of the binary resolution rule [45].For dealing with modal clauses, a set of hyper-resolution rules [44] are applied to modal and propositional clauses.The main difference between those proof methods resides in their normal form: in [33], for completeness, all clauses are considered for application of the resolution rules; whilst in [34], because clauses are labelled, the resolution rules only need to be applied when the labels of clauses can be unified.Differently from other calculi which use labels for guiding the application of inference rules [3,5,10,11,54,55], the labels in the clausal form given in [34] do not refer to worlds, but to the modal layer (i.e. the distance from the root of a model) where a subformula holds.
Both proof methods have been implemented in our prover, K S P [36], a resolution-based prover for the multi-modal logic K.The structure of the normal form restricts application of the resolution inference rules reducing the search space whilst remaining complete.The prover also uses the set of support strategy [56], a strategy that requires that the set of clauses is partitioned in two sets and, then, restricts that clauses used as premises for resolution inferences are from different sets in this partition.For the modal case, the use of labels relating to modal layer of subformulae allows us to restrict clause selection even further.The prover also incorporates a range of simplification techniques and refinements intended to improve efficiency of the prover.Here, we concentrate on the implementation aspects of those techniques and refinements, further discussing the architecture of the prover, a variety of choices available to the user, and their impact on the efficiency of the prover.The resulting prover outperforms other modal provers for formulae that have a high degree of nesting of modal formulae.This paper extends the work in [35] providing full details of the prover, its main control loop, pre-processing options, notions of redundancy, refinements and strategies.The prover is based on the calculus presented in [34] and its sources are available at [36].We also provide experimental results comparing K S P with other provers and analysing some of the combinations of refinements and strategies.The results update and extend those in [35] by using more recent versions of the provers involved, presenting additional experimental results and considering the performance of portfolios of provers.
The paper is organised as follows.We introduce the syntax and semantics of K n in Sect. 2. In Sects. 3 and 4 we briefly describe the normal form and the calculus.Section 5 describes the available strategies and their implementations.The evaluation of strategies and of the performance of the prover compared to existing tools are given in Sect.6.We summarise our results and provide conclusions in Sect.7.

Language
Let A = {1, . . ., n}, n ∈ N, be a finite fixed set of indexes and P = {p, q, s, t, p , q , . ..} be a denumerable set of propositional symbols.The set of well-formed formulae, WFF K , is the least set such that every p ∈ P is in WFF K ; if ϕ and ψ are in WFF K , then so are ¬ϕ, (ϕ ∧ ψ), (ϕ ∨ ψ), a ϕ, and ♦ a ϕ for each a ∈ A. The formulae false, true, (ϕ ⇒ ψ), and (ϕ ⇔ ψ) are introduced as the usual abbreviations for (ϕ ∧ ¬ϕ),¬false, and (¬ϕ ∨ ψ), and A literal is either a propositional symbol or its negation; the set of literals is denoted by L. We denote by ¬l the complement of the literal l ∈ L, that is, ¬l denotes ¬ p if l is the propositional symbol p, and ¬l denotes p if l is the literal ¬ p.A modal literal is either a l or ♦ a l, where l ∈ L and a ∈ A. The modal depth of a formula is recursively defined as follows: Definition 1 Let ϕ, ψ ∈ WFF K be well-formed formulae.The modal depth of a formula is given by the function mdepth : WFF K −→ N, where: The modal level of a subformula is given relative to its position in the syntactic tree of its superformula.τ ( p, λ, pol, ml) = {( p, λ, pol, ml)}, for p ∈ P;
The function τ applied to (ϕ, ε, +, 0) returns the annotated syntactic tree for ϕ, where each node is uniquely identified by a subformula, its path order (or its position) in the tree, its polarity, and its modal level.
If mlevel(ϕ, ϕ , λ) = ml we say that ϕ at position λ of ϕ occurs at the modal level ml.
For instance, p occurs three times in the formula a a ( p ∧ (¬ a p ∨ ♦ a p)), at position 1.1.1 at modal level 2; and at positions 1.1.2.1.1.1 and 1.1.2.2.1 at modal level 3. Let ϕ be a subformula at position λ of a formula ϕ.If pol(ϕ, ϕ , λ) = +, we say that ϕ has positive polarity at λ. Similarly, if pol(ϕ, ϕ , λ) = −, we say that ϕ has negative polarity at λ.If for all positions λ at the modal level ml, we have that either pol(ϕ, ϕ , λ) = + or pol(ϕ, ϕ , λ) = −, then ϕ is said to be pure at the modal level ml.Finally, if ϕ is pure at all modal levels, then ϕ is said to be a pure.For example, taking ϕ to be the formula a a ( p ∧ (¬ a p ∨ ♦ a p)) above, then p occurs only with positive polarity at modal level 2 and with both negative and positive polarity at the modal level 3. Thus, p is pure at the modal level 2, but it is not pure at the modal level 3 (hence, it is not pure when considering the whole formula).A literal l is pure at the modal level ml if is either of the form p or ¬ p and p is pure at the modal level ml.If a literal l is pure at all modal levels, then we say l is a pure literal.Modal formulae are interpreted over (rooted) Kripke models: Definition 4 A Kripke model M for n agents over P is given by a tuple where W is a set of possible worlds with a distinguished world w 0 , each accessibility relation R a is a binary relation on W such that their union is a tree with root w 0 , and π : W → (P → {true, false}) is a function which associates with each world w ∈ W an interpretation to propositional symbols.A model M = (W , w 0 , R 1 , . . ., R n , π) is tree-like if n a=1 R a is a tree, i.e. a directed acyclic graph (with root w 0 ).As a formula is locally satisfiable if, and only if, it is locally satisfiable in a tree-like model [21], from now on we will only consider such a class of models.We denote by depth(w) the length of the unique path from w 0 to w through the union of the accessibility relations in M. We call a modal layer the equivalence class of worlds at the same depth in a model.
We note that checking the local satisfiability of a formula ϕ can be reduced to the problem of checking the local satisfiability of its subformulae at the modal layer of a model which corresponds to the modal level where those subformulae occur (see [1]).Due to this close correspondence of modal layer and modal level we use the terms interchangeably.
Also, checking the global satisfiability of ϕ can be reduced to checking the local satisfiability of ϕ at all modal layers (up to an exponential distance from the root) of a model [14,50].The following definitions and results are needed later.Let K * n be the extension of K n with an additional operator * , the universal operator.Let M = (W , w 0 , R 1 , . . ., R n , π) be a tree-like model for K n .The model M * is the tuple (W , w 0 , R 1 , . . ., R n , R * , π), where R * = W × W .A formula * ϕ is locally satisfied at the world w in the model M * , written (M * , w) | L * ϕ, if, and only if, for all w ∈ W , we have that Thus, a uniform approach based on modal levels can be used to deal with all satisfiability problems.

Layered Normal Form
The calculi presented in [33,34] are both clausal.We present the normal form described in [34], as this normal form can be also used to simulate the one given in [33].A formula to be tested for local or global satisfiability is first translated into a normal form called Separated Normal Form with Modal Levels, SNF ml .A formula in SNF ml is a conjunction of clauses labelled by the modal level at which they occur.We write ml : ϕ to denote that ϕ holds at the modal level ml ∈ N ∪ { * }.By * : ϕ we mean that ϕ holds at all modal levels.Formally, let WFF ml K be the set of formulae ml : ϕ such that ml ∈ N ∪ { * } and ϕ ∈ WFF K .Let M * = (W , w 0 , R 1 , . . ., R n , R * , π) be a model and ϕ ∈ WFF K .Satisfiability of labelled formulae is given as follows: -M * | ml : ϕ if, and only if, for all worlds w ∈ W such that depth(w) = ml, we have M * , w | ϕ; -M * | * : ϕ if, and only if, M * | * ϕ.
Note that labels in a formula work as a kind of weak universal operator, allowing us to talk about formulae that are satisfied at a given modal layer.
Clauses in SNF ml are in one of the following forms: -Literal clause ml : r b=1 l b -Positive a-clause ml : l ⇒ a l -Negative a-clause ml : l ⇒ ♦ a l 123 Table 1 The translation function ρ where ml ∈ N ∪ { * } and l, l , l b ∈ L. Clauses are kept in simplified form, that is, no duplicate literals are allowed and a clause such as ml : C ∨ l ∨ ¬l simplifies to ml : true.As the disjunction operator is commutative, associative, and idempotent, simplification takes place regardless of the order of literals in a clause.Positive and negative a-clauses are together known as modal a-clauses; the index a may be omitted if it is clear from the context.A literal clause ml : C is said to be positive (resp.negative) if all literals l occurring in C are of the form p (resp.¬ p), for p ∈ P.
Let ϕ be a formula in the language of K n .In the following, we assume ϕ is in Negation Normal Form (NNF), that is, a formula where the operators are restricted to ∧, ∨, a , ♦ a and ¬; also, only propositions are allowed in the scope of negations.The transformation of a formula ϕ into SNF ml is achieved by recursively applying rewriting and renaming [41].Let ϕ be a formula and t a propositional symbol not occurring in ϕ.For local satisfiability, the translation of ϕ is given by 0 : t ∧ ρ(0 : t ⇒ ϕ), where t is a new propositional symbol and the transformation function ρ : WFF ml K −→ WFF ml K is defined in Table 1.We refer to clauses of the form 0 : D, for a disjunction of literals D, as initial clauses.For global satisfiability, the translation of ϕ is given by * : t ∧ ρ( * : t ⇒ ϕ) where t is a new propositional symbol.For testing the satisfiability of ϕ under global assumptions Γ = {γ 1 , . . ., γ m }, m ∈ N, the translation is given by * : t ∧ ρ(0 As the conjunction operator is commutative, associative, and idempotent, in the following we often refer to a formula in SNF ml as a set of clauses.The next lemma shows that the transformation into SNF ml is satisfiability preserving. Lemma 1 [34] Let ϕ ∈ WFF K be a formula and let t be a propositional symbol not occurring in ϕ.Then: (1) where the valuation of π of the new symbols introduced by renaming are set to true exactly at the worlds where the formulae they are replacing are also evaluated to true.For the if part, if there is a model M that satisfies the translation of ϕ, by ignoring the labels and the valuation of the propositional symbols not occurring in ϕ, we show that M also satisfies ϕ.
The fact that the transformation for formulae under global assumptions is also satisfiability preserving follows easily from Lemma 1.Some of the refinements implemented in K S P require further transformation of the set of clauses.For instance, for completeness of negative resolution [44], we require that literals occurring in the scope of modal operators are positive.Given a set of clauses in SNF ml , in addition to the rules given in Table 1, we exhaustively apply the following rewriting rules (where ml ∈ N ∪ { * }, t, p ∈ P, and t is a new propositional symbol): We call the resulting normal form SNF + ml .It can be shown that the resulting set of clauses is satisfiable if, and only if, the original set of clauses is satisfiable.
Completeness of ordered resolution [22] requires that literals in the scope of modal operators are "small enough" with respect to a given ordering on literals.Also for completeness, those literals need to be available in the set of literal clauses so that the relevant clauses used in the hyper-resolution rules are derived.We can ensure these conditions are met by further processing of the set of SNF ml clauses.Let Φ be a set of clauses and P Φ be the set of propositional symbols occurring in Φ.Let be a well-founded and total ordering on P Φ .This ordering can be extended to literals L Φ over P Φ by setting ¬ p p and p ¬q whenever p q, for all p, q ∈ P Φ .A literal l is said to be maximal with respect to a clause ml : C ∨ l if, and only if, there is no l occurring in C such that l l.Given a set of clauses Φ in SNF ml and an ordering on the literals occurring in Φ, in addition to the rules given in Table 1, we exhaustively apply the following rewriting rules (where ml ∈ N ∪ { * }, t ∈ P, l ∈ L and t is a new propositional symbol): where p t , for all p occurring in Φ.We call the resulting normal form SNF ++ ml .Again, it is easy to show that Φ is satisfiable if, and only if, the resulting set of clauses in SNF ++ ml is satisfiable.

Inference Rules
The calculus comprises a set of inference rules for dealing with propositional and modal reasoning.In the following, we denote by σ the result of unifying the labels in the premises for each rule.Formally, unification is given by the function σ : 2 N∪{ * } −→ N ∪ { * }, where σ ({ml, * }) = ml; and σ ({ml}) = ml; otherwise, σ is undefined.The inference rules given in Table 2 can only be applied if the unification of their labels is defined (where * − 1 = * ).Note that for GEN1 and GEN3, if the modal clauses in the premises occur at the modal level ml, then the literal clause in the premises occurs at the next modal level, ml + 1.

Definition 6
Let Φ be a set of clauses in SNF ml .A derivation from Φ is a sequence of sets Φ 0 , Φ 1 , . . .where Φ 0 = Φ and, for each i > 0, Φ i+1 = Φ i ∪ {D}, where D / ∈ Φ i is the resolvent obtained from Φ i by an application of either LRES, MRES, GEN1, GEN2, or GEN3.We also require that D is in simplified form and that D is not a tautology.A set of clauses Φ is saturated if every clause that is a resolvent obtained from Φ by an application of either LRES, MRES, GEN1, GEN2, or GEN3 is either a tautology or it is already contained in For the satisfiability problem under global assumptions, a refutation is either a local or a global refutation.The following theorems, taken from [34] where full proofs are given, ensure the calculus is sound, complete and terminating.
Theorem 1 (Soundness [34]) Let Φ be a set of clauses in SNF ml and Φ Soundness of the calculus is proved by showing that, for each inference rule, if the premises are satisfiable, so it is the resolvent.
Theorem 2 (Completeness [34]) Let Φ be an unsatisfiable set of clauses in SNF ml .Then there is a refutation for Φ by applying the resolution rules given in Table 2.
Completeness is proved by showing that if a set Φ of clauses in SNF ml is unsatisfiable, there is a refutation produced by the method presented here.The proof is by induction on the number of nodes of a graph, known as behaviour graph [9], built from Φ. Intuitively, nodes in the graph correspond to worlds and the set of edges correspond to the accessibility relations in a model.The graph construction is similar to the construction of a canonical model, followed by filtrations based on the set of clauses, often used to prove completeness for proof methods in modal logics [6].We show that deletions of nodes in the graph correspond to application of the inference rules given in Table 2.If the reduced graph is empty, then the set of clauses is unsatisfiable and there is refutation from Φ.If the reduced graph is not empty, then a model witnessing the satisfiability of Φ can be built from it.
Theorem 3 (Termination [34]) Let Φ be a set of clauses in SNF ml .Then, any derivation from Φ terminates.This result follows from the fact that none of the inference rules generates new literals, new modal literals, or new labels.Hence, there are a finite number of clauses that can be built from the literals and modal literals occurring in Φ.
We note that, for a given formula ϕ, the normal form given in [33], called SNF, is equivalent to ( * : start ⇒ t) ∧ ρ( * : t ⇒ ϕ), where t is a new propositional symbol and start is a Table 3 Inference rules for initial clauses constant denoting the root of the tree-like model.Two additional inference rules, given in Table 3 are required for completeness.In this case, a refutation for a set of clauses Φ is either a global refutation or a derivation Φ 0 , . . ., Φ k , k ∈ N, where * : start ⇒ false ∈ Φ k .Also, by taking (0 : t) ∧ ρ( * : t ⇒ ϕ) as the normal form of ϕ, the calculus presented in [33] can be simulated by the one given in [34], without the rules given in Table 3. Instead of having clauses of the form * : start ⇒ ϕ, we have 0 : ϕ.Then, LRES simulates IRES1 with ml 1 = ml 2 = 0; and IRES2 with ml 1 = 0 and ml 2 = * .

Implementation
K S P is an implementation, written in C, of the calculus described in Sect. 4. The prover was designed to support experimentation with different combinations of refinements of its basic calculus.Refinements and options for (pre)processing the input are coded as independently as possible in order to allow for the easy addition and testing of new features.This might not lead to optimal performance (e.g.some techniques need to be applied consecutively, whereas most tools would apply them concurrently), but it helps to evaluate how the different options independently contribute to achieve efficiency.In its current version, K S P implements local and global reasoning.The implementation of a proof search procedure for local satisfiability under global assumptions is ongoing work.
First we discuss the main processing cycle and in then we give an overview of the available options and their implementations.For a comprehensive list of options, see [36], where the sources and instructions on how to install and use K S P can be found.

Main Processing Cycle
The proof search procedure for local satisfiability implemented in K S P is shown in Fig. 1.The preprocessing steps (Lines 2-4) are explained in Sects.5.2, 5.3, and 5.4.The main loop (Lines 6-16) is based on the given-clause algorithm implemented in Otter [31], a variation of the set of support strategy [56], a refinement which restricts the set of choices of clauses participating in a derivation step.For the classical case, a set of clauses Δ is partitioned into two sets Γ and Λ = Δ\Γ , where Λ must be satisfiable for completeness.The set Γ is the set of support (the sos, aka passive or unprocessed set); and Λ is called the usable (aka active or processed set).The given clause is chosen from Γ , resolved with clauses in Λ, and moved from Γ to Λ. Resolvents are added to Γ .For the modal calculus, the set of clauses is further partitioned according to the modal level at which clauses occur.That is, for each modal level ml there are three sets: Γ lit ml , Λ lit ml and Λ mod ml , where the first two sets contain literal clauses while the latter contains modal clauses.As the calculus does not generate new modal clauses and because the set of modal clauses by itself is satisfiable (as they are implications and the left-hand sides are a single non-negated proposition), there is no need for a set for unprocessed modal clauses.Attempts to apply an inference rule are guided by the choice, for each modal layer ml, of a literal clause in Γ lit ml , which can be resolved with either a set of modal clauses in Λ mod ml−1 or with a literal clause in Λ lit ml .In more detail, let Γ lit be the union of all sets of literal clauses (Line 5).A cycle corresponds to one iteration of the outer loop (Lines 6-16).This loop is executed while the set of unprocessed clauses is not empty.In the inner loop (Lines 7-15), for every modal level ml, a literal clause is returned by the function given.The options for selecting the modal level and the literal clause at this level are described in Sects.5.5 and 5.6.Once a literal clause is selected, it is tested for redundancy (Line 9), i.e. clauses that can be deleted without affecting the satisfiability of the clause-set.The choices for redundancy elimination are presented in Sect.5.9.If the given clause is not redundant, then it is processed against all usable modal clauses in the previous modal level (Lines 10 and 11) and against all usable literal clauses at the same modal level (Line 12).Note that as no modal clauses are generated during the proof search, the inference rules MRES and GEN2 are applied before the prover enters the main loop.This is discussed further in Sect.5.4.The refinements that can be used to apply LRES are given in Sect.5.7.Once the inference rules are applied the chosen clause is moved to the set of processed clauses (Line 13) and removed from the set of unprocessed clauses (Line 14).If the empty clause (0: false) is generated at the modal level 0, then the procedure returns that the set of clauses is unsatisfiable (Line 15).Note that in Fig. 1, only the condition for local reasoning is given.If the prover is set for global satisfiability, then that condition changes to * : false ∈ Γ lit .If the empty clause is not found, the procedure returns that the set of clauses is satisfiable (Line 17).

Input Processing
The input is read from either a file or from the command line.A configuration file can also be given.In this case, the options given at the command line override those in the configuration file.A input file is a set of declarations (the options for the prover) followed by sets of modal formulae or clauses.The user can also specify the sets of formulae and clauses as either processed (usable) or unprocessed (sos).
The tokeniser and the parser were built with Flex [12] and Bison [13], which are both free, open source software and easily available.The input language of K S P is LR(2) which can be handled by Bison with options for generating a generic parser.Relying on generators for the lexer and the parser might not lead to the most efficient implementation of the automata which recognise the given language.However, changes in the grammar require very little effort to be implemented, making this part of the code easier to maintain.
The outputs of the parser are a double-linked annotated abstract tree and a symbol table.In the annotated tree, a number is assigned to every node in order to avoid unnecessary transversal of the tree while performing simplification.The assigned number may not be unique 1 , but two formulae are checked for repetition, for instance, only if they are assigned the same number.Conjunctions are treated as n-ary operators and nested conjunctions are flattened.The operands of conjunctions are ordered: first come Boolean constants, second propositional symbols, third compound propositional formulae, and fourth modal formulae.The same applies to disjunctions.The symbol table contains information about the propositional symbols, constants, and modal operators occurring in the formula: their type, id, number of occurrences, number of positive and negative occurrences (both globally and by modal level).A double level hash table contains the locations of the positions of propositional symbols and constants in the tree: the first level corresponds to the modal level at which they occur and the second level to the addresses themselves, so that book-keeping the deletions in the tree can be done fast (typically, in constant time).
As the parsing is bottom-up, as usual for LR grammars, linearisation (i.e. the removal of double-implications) and the calculation of polarity requires at least another pass in the tree.This extra transversal of the tree is only done in case there is any double-implication occurring in the input formula or if the option for (modal level) pure literal elimination is set.Modal level pure literal elimination consists of replacing every propositional symbol p which is pure at a modal level ml by a constant.If p occurs only with positive polarity at ml, then p is replaced by true; if it occurs only with negative polarity, then p is replaced by false.
If the input is a set of formulae, depending on the options given by the user, the formulae are first transformed into their Negation Normal Form (NNF) or into Box Normal Form (BNF) [39].The translation into BNF also removes the ♦ a operator.Thus, the a operator is also allowed in the scope of negations.More precisely, the translation into BNF differs from the NNF just in one case.When transforming a formula as ¬ a ϕ into NNF, the result is ♦ a NNF(¬ϕ); the transformation of the same formula into BNF results in ¬ a BNF(¬ϕ).For example, the formula which is easier to check for simplification than checking the resulting NNF which is a ( p ∧ q) ∧ ♦ a (¬ p ∨ ¬q).
Then transformation into prenex (option prenex) or antiprenex normal form (option antiprenex) or one after the other can be applied.The definitions of those normal forms are given in [32].Basically, the prenex normal form corresponds to pushing the modal operators occurring in a formula ϕ as far as possible outwards the formula in order to obtain ϕ which is equivalent to ϕ.For instance, the prenex normal form of ( a p ∧ a q) is a ( p ∧ q).Similarly, the antiprenex normal form corresponds to pushing the modal operators occurring With options nnfsimp (resp.bnfsimp), simplification is applied to formulae in NNF (resp.BNF); with options early_ple and early_mlple, pure literal elimination is applied globally or at every modal level, respectively.The simplification rules are given in Table 4.Most of those simplification rules can be found in the literature (e.g.[49]).The only rules we are not aware that were reported before are ( ♦ a true ∨ a ϕ) → true and ( a false ∧ ♦ a ϕ) → false.We show that the first of those rules is correct.The formula ( ♦ a true ∨ a ϕ) is semantically equivalent to ( ♦ a ϕ∨ ♦ a ¬ϕ∨ a ϕ), which is semantically equivalent to ( ♦ a ϕ∨¬ a ϕ∨ a ϕ).
As ¬ a ϕ ∨ a ϕ is a tautology, the whole formula simplifies to true.The proof that the transformation of ( a false ∧ ♦ a ϕ) → false is correct is similar.

Transformation to Normal Form
By default, formulae are transformed into SNF ml .There are four different options that determine the normal form.Two of those options are used for transforming a set of clauses into SNF + ml and into SNF ++ ml , as described in Sect.3. The two other options are used for transforming a set of clauses into SNF − ml and SNF −− ml , which are defined analogously to SNF + ml and SNF ++ ml , but where literals in the scope of modal operators are renamed by new negative literals.
The transformation into any of those normal forms requires renaming [41].All renaming is performed bottom-up and it uses an auxiliary hash table based on the number assigned to the formulae in the tree structure and the modal level at which the formula occurs.A bottom-up renaming might not be optimal with regard to the number of generated clauses for linear formulae (those where bi-implications do not occur and subformulae are not repeated) [7].An alternative would be top-down renaming.However, for formulae which are not linear, top-down renaming cannot ensure that the number of generated clauses is smaller than that obtained with bottom-up renaming.A future version of K S P will implement small normal forms [37], but at the moment only four different forms of renaming are available.With the option normal_renaming, every subformula is renamed by a new propositional symbol.With option limited_reuse_renaming, the same new propositional symbol is used for all occurrences of the same subformula being renamed at a particular modal level.Yet another option, extensive_reuse_renaming, also uses the same propositional symbol for all occurrences of the same subformula being renamed; in addition, if a formula ϕ was renamed by a new propositional symbol t, then the NNF of ¬ϕ is renamed by ¬t.With the option conjunct_renaming, modal subformulae that occur in conjunctions are renamed, instead of applying the usual rewriting rule.When applied together, conjunct_renaming and either limited_reuse_renaming or extensive_reuse_renaming might lead to a smaller set of clauses.For instance, ml : t ⇒ a p ∧ ( p ∨ a p) is transformed into {ml : t ⇒ t 1 , ml : t ⇒ t 2 , ml : The set of clauses resulting from the transformation into the normal form is stored in a trie-like structure (implemented as multi-level hash tables), according to the set they belong to (usable, sos), their type (initial, literal, modal positive, modal negative), their modal level, the index of the modal operator (in the case of modal clauses), their maximal literal, and their size (in the case of initial and literal clauses).Clauses are implemented as simplified, ordered lists of literals.Also, for every propositional symbol, a list of clauses by modal level is kept in the symbol table.The trie structure helps to make the implementation of clause and literal selection efficient, to reduce the number of clauses being checked during redundancy tests (repetition and subsumption), and also to reduce the number of misses during the construction of the set of candidate clauses to which a particular resolution rule is applied.The list of clauses kept in the symbol table allows for efficiently finding the clauses to be processed during the application of unit resolution (options unit and lhs_unit) and pure literal elimination (option ple, which is applied if the literal is pure in the whole set of clauses; or option mlple, which is applied if the literal is pure at a modal level).

Preprocessing of Clauses
The preprocessing of clauses comprises several tasks which may be set by the user.By default, we prevent duplicate clauses to be stored in the trie-like structure that we use to maintain the set of clauses, but only duplicates in the set they are stored are checked.For instance, if a clause is to be stored in Γ lit ml , then we only check this particular set for a duplicate.With option check_full_repeated, repetition of clauses is checked against all sets of clauses at the same modal level.
Propagation of a literal in the scope of the operator ♦ a is applied at this stage, with option propdia.The propagation rule is given by ml : l ⇒ ♦ a l ml + 1 : l for literals l and l , modal level ml, and index a, with the side condition that there is only one negative modal clause in Λ mod ml (otherwise, the rule is not sound).Propagation of a literal is not needed for completeness, but as the inference rule generates a unit clause at the propositional set of formulae, unit propagation and subsumption can be applied, reducing the number of literals at the modal level ml + 1.
If the set of modal clauses at the modal level ml does not contain a negative modal clause, than all positive modal clauses at that modal level and all clauses (modal and literal) with modal level greater than ml can be deleted.This is justified by the fact that a world w satisfies a l, for a literal l and index a, if there is no world w such that (w, w ) ∈ R a .Thus, we can take the empty relation for all worlds at the level ml, which satisfy all positive modal clauses.As the worlds at greater modal levels are no longer accessible, the sets of clauses corresponding to those levels can also be deleted.The option for this simplification is mle.
As no modal clauses are generated during the proof search, the inference rules MRES and GEN2 are also exhaustively applied at this step, that is, before the prover enters the main loop.We note that the transformation into SNF + ml , SNF ++ ml , SNF − ml , or SNF −− ml is performed after the preprocessing of clauses.If any of those four options related to the transformation into the normal form are set by the user, then all literals in the scope of modal operators will have the same polarity.Therefore, the inference rules MRES and GEN2 are not applicable and will be blocked.However, as those inference rules produce very short resolvents, which can be particularly useful to reduce the number of clauses if subsumption is also set, the user can force those inference rules to be applied even when they are not needed for completeness, by setting the options mres and gen2.
If forward and/or backward subsumption [29] are set, then self-subsumption is also applied at this point.Forward and backward subsumption are performed in lazy mode and only against the usable (see Sect. 5.9).However, for self-subsumption, clauses are tested against all sets, irrespective of where they are stored.
By default, the usable sets Λ lit ml of literal clauses are empty (unless those sets are given as input).However, the user has the choice of automatically populating those usable sets with literal clauses.There are six options: populate_non_negative moves literal clauses which are not negative from Γ lit ml to Λ lit ml ; populate_non_positive moves clauses which are not positive from Γ lit ml to Λ lit ml ; populate_negative moves negative literal clauses from Γ lit ml to Λ lit ml ; populate_positive moves positive literal clauses from Γ lit ml to Λ lit ml ; populate_max_lit_negative moves literal clauses whose maximal literal is negative from Γ lit ml to Λ lit ml ; and the option populate_max_lit_positive moves literal clauses whose maximal literal is positive from Γ lit ml to Λ lit ml .
We note that populating the usable sets must be done with some care, as some combinations of the set of support and other refinements are not complete.For instance, using ordered resolution as a refinement, consider the set Δ = {0 : p ∨ q, 0 : p ∨ ¬q, 0 : ¬p ∨ q, 0 : ¬ p∨¬q}, which is unsatisfiable, and let p q be the ordering over the propositional symbols.Using the option populate_non_negative, we obtain Λ lit 0 = {0 : p∨q, 0 : p∨¬q, 0 : ¬p∨q}, which is satisfiable, and Γ lit 0 = {0 : ¬p ∨ ¬q}.In the first cycle, there is only one clause to choose, ¬ p is the maximal literal, and the only non-redundant generated resolvent is 0 : ¬q, which is added to Γ lit 0 .Now, as 0 : ¬p ∨ ¬q is moved to the set of usable clauses, 0 : ¬q is the only clause that can be chosen in the sos.However, there is no clause in Λ lit 0 where q is the maximal literal.Thus, no inference steps can be applied, and the procedure would output the set as satisfiable.In contrast, using the options populate_non_negative with negative resolution or populate_max_lit_positive with either negative or ordered resolution are safe choices.

Controlling the Inner Loop
The inner loop executed during the proof search (Lines 7-15) iterates over the modal levels in the set of literal clauses.As mentioned before, each set Γ lit ml is implemented as multi-level hash tables, where the modal level is one of the keys.By default, these sets are scanned by following the order of the entries in the hash table.However, the user can set different orderings.With option ordlevel_ascend, the for loop iterates in ascending order of modal levels, that is, from ml = 0 to the maximal modal level; and with option ordlevel_descend, the modal levels are scanned from the maximal modal level down to ml = 0.With option ordlevel_shuffle, the list of modal levels is partitioned in half and the two lists are merged, just before entering the inner loop; the modal levels are then scanned in the resulting order.Preliminary evaluation of these features, checked over the LWB benchmarks [25], shows that the default performs better.However, we have not performed an extensive evaluation yet.

Clause Selection
Besides the set of support strategy, which restricts clause selection to those in the sos, there are five different heuristics for choosing a literal clause as the given clause at a modal level within each cycle.With option shortest, the clause with the smallest size at that particular modal level is chosen.With option newest, clause selection simulates a stack (last in, first out).With option oldest, clause selection simulates a queue (first in, first out).With option smallest (resp.greatest), the given clause is the shortest clause with the smallest (resp.greatest) maximal literal in the set.

Refinements
Besides the implemented restrictions on clause selection, the user can further restrict LRES by choosing options ordered (clauses can only be resolved on their maximal literals with respect to an ordering chosen by the prover in such a way to preserve completeness), negative (one of the premises is a negative clause, i.e. a clause where all literals are of the form ¬ p for some p ∈ P), positive (one of the premises is a positive clause), or negord, where both negative and ordered resolution inferences are performed.
The completeness of some of these refinements depends on the particular normal form chosen.For instance, negative resolution is incomplete without SNF + ml or SNF ++ ml .For example, the set {0 : p, 0 : p ⇒ a ¬q, 0 : p ⇒ ♦ a s, 1 : ¬s ∨ q} is locally unsatisfiable, but as there is no negative literal clause in the set, no refutation can be found with negative resolution.By renaming ¬q with t in the scope of a , we obtain the set {0 : p, 0 : p ⇒ a t, 0 : p ⇒ ♦ a s, 1 : ¬s ∨ q, 1 : ¬t ∨ ¬q} in SNF + ml , from which a refutation using negative resolution can be found.Similarly, ordered resolution requires SNF ++ ml for completeness, while positive resolution requires SNF − ml or SNF −− ml .

Inference Rules
Besides the inference rules given in Table 2, three more inference rules are also implemented.With option unit, unit clauses are propagated through all literal clauses and the right-hand side of modal clauses, that is, the following inference rules are applied: [UNIT] Clearly, UNIT, UNIT-GEN1, UNIT-GEN3 are special cases of the inference rules LRES, GEN1, and GEN3, respectively.Their implementation, however, is different, as the set of candidates to resolve with the unit clause ml : ¬l is built from the list of clauses stored in the symbol table instead of using the trie-like structure for clauses.Subsumption, if set, is also immediately applied.By default, redundancy is only checked when a clause is chosen, but for those unit resolution rules the premises ml 1 : l 1 ∨. ..∨l m ∨l in UNIT and ml 1 : l 1 ⇒ ♦ a l in UNIT-GEN1 are deleted from the set of clauses as soon as subsuming resolvents are generated.
The option lhs_unit propagates unit clauses through the left-hand side of modal clauses, that is, the following inference rules are applied: Again, if the modal clauses in the premises are subsumed by the resolvents in those inference rules, they are immediately deleted from the clause set.The rules LHS-UNIT-1 and LHS-UNIT-2 are not needed for completeness.However, exhaustive application of the two rules together with subsumption and the usual unit resolution removes all occurrences of the literal ¬l at the modal level ml; thus, if the options for pure literal elimination are set, more clauses can be removed from the clause set.
The inference rules shown in Table 3 are set with the option ires, which together with the global option, implements initial resolution and, therefore, the calculus given in [33].The inference rules IRES1 and IRES2 are, by default, applied after the main loop described in Fig. 1.For an unsatisfiable set of clauses, if the literal clauses are not by themselves unsatisfiable, this means that a proof can only be found after the set of literal clauses is saturated, which might be very time consuming.With option interires, initial and literal resolution are interleaved, that is, IRES1 and IRES2 are applied within the main loop given in Fig. 1, which may shorten the time to finding a proof.

Pure literal elimination can be applied globally (option ple) or by modal level (option mlple).
For modal level pure literal elimination, if a literal l is pure at a modal level ml, then the literal can be set to true at that level.This means that any literal clause at the modal level ml in which l occurs can be deleted.If l occurs in the scope of a on the right-hand side of a positive modal clause, then the positive modal clause can also be deleted (because a true is a tautology).If l occurs in the scope of ♦ a on the right-hand side of a positive modal clause ml − 1 : l ⇒ ♦ a l, then the clause ml − 1 : l ⇒ ♦ a l is deleted and the clause ml − 1 : l ⇒ ♦ a true is generated.Because ♦ a true is not a tautology, the newly generated clause is kept in the set of clauses.As the number of literal occurrences is stored in the symbol table, at the implementation level, the procedure for modal level pure literal elimination consists of scanning the information related to all propositional symbols p and deleting the list of clauses at a particular modal level ml if the number of either positive or negative occurrences of p at the modal level ml is zero.For pure literal elimination, the procedure is similar.
Both forward (option fsub) and backward subsumption (option bsub) are implemented.A literal clause ml : C is subsumed by a literal clause ml : D if, and only if, ml : D implies ml : C. For forward subsumption, a literal clause ml : C is deleted if it is subsumed by any older literal clause.For backward subsumption, a literal clause ml : C is deleted if it is subsumed by any newer literal clause.In both cases, subsumption is applied in lazy mode: a clause is tested for subsumption only when it is selected from Γ lit ml and only against clauses in Λ lit ml .As pointed out in [47], lazy subsumption avoids expensive checks for clauses that might never be selected during the search of a proof.Also, the trie-like structure for clauses is used to improve the selection of candidates for subsumption.A clause ml : C is subsumed by a clause ml : D if, and only if, the following holds: 1. σ ({ml, ml }) is defined; 2. the size of ml : C is greater or equal the size of ml : D; 3. the maximal literal in ml : C is less or equal the maximal literal in ml : D; 4. the minimal literal in ml : C is greater or equal the minimal literal in ml : D.
The first three conditions are keys in the trie-like structure, thus the first approximation for a set of candidates can be obtained in linear time on the size of the clause set for a particular modal level.The last condition requires testing all clauses which satisfy the first three conditions, but it can also be easily checked: as clauses are implemented as ordered lists, it only requires to test the head of those lists.
The user can force subsumption checking in the whole set of clauses by setting the option sos_sub.
Our benchmarks [36] consist of three collections of modal formulae: 1.The complete set of TANCS-2000 modalised random QBF (MQBF) formulae [30] complemented by the additional MQBF formulae provided by Kaminski and Tebbi [27].This collection consists of five classes, called qbf, qbfL, qbfS, qbfML, and qbfMS in the following, with a total of 1016 formulae, of which 617 are known to be satisfiable and 399 are known to be unsatisfiable (due to at least one of the provers being able to solve the formula).The minimum modal depth of formulae in this collection is 19, the maximum 225, average 69.2 with a standard deviation of 47.5.2. LWB basic modal logic benchmark formulae [4], with 56 formulae chosen from each of the 18 parameterised classes.In most previous uses of these benchmark classes, only parameter values 1 to 21 were used for each class, resulting in 378 benchmark formulae with a median size of a benchmark formula of 1072.5 and a maximum size of 24,972.For such low parameter values, most benchmark formulae were easily solvable by state-of-the art provers.To overcome this problem we have instead chosen the 56 parameter values so that only the best current provers, if any at all, will be able to solve all the formulae within a time limit of 1000 CPU second.The median value of the maximal parameter value used for the 18 classes is 1880, far beyond what has ever been tested before.The median size of benchmark formulae is 342,077.5 and the maximum size is 288,072,146.
Of the 1008 formulae, half are satisfiable and half are unsatisfiable by construction of the benchmark classes.The minimum modal depth of formulae in this collection is 1, the maximum 30,004, average 1065.7 with a standard deviation of 2670.1.3. Randomly generated 3CNF K formulae [40] over 3 to 10 propositional symbols with modal depth 1 or 2. We have chosen formulae from each of the 11 parameter settings given in the table on page 372 of [40].For the number of conjuncts we have focused on a range around the critical region where about half of the generated formulae are satisfiable and half are unsatisfiable.The resulting collection contains 1000 formulae, of which 457 are known to be satisfiable and 464 are known to be unsatisfiable.Note that this collection is quite distinct to the one used in [27] which consisted of 135 3CNF K formulae over 3 propositional symbols with modal depth 2, 4 or 6, all of which were Fig. 2 Benchmarking results for K S P satisfiable.The minimum modal depth of formulae in this collection is 1, the maximum 2, average 1.8 with a standard deviation of 0.4.
In [35] we have used the same benchmark formulae and the same versions of BDDTab, FaCT++ and InKreSAT, but used K S P 0.1.1,Spartacus 1.0, and Vampire 3.0 instead of the more recent versions employed here.We also applied a different method of computing the optimised functional translation; the method used now is faster, but typically results in a larger formula as fewer simplifications are performed during the computation.As a consequence the results reported for these three provers are different to those in [35].
Benchmarking was performed on PCs with an Intel i7-2600 CPU @3.40 GHz and 16 GB main memory.For each formula and each prover we have determined the median run time over five runs with a time limit of 1000 CPU seconds for each run.
Figure 2 shows the impact of different refinements on the performance of K S P on the MQBF, LWB, and 3CNF K collections and all benchmark formulae together.K S P (plain) uses the rules shown in Table 2, without additional refinement, on a set of SNF ml clauses.K S P (ordered) applies ordered resolution on a set of SNF ++ ml clauses.K S P (negative) uses negative resolution on a set of SNF + ml clauses, while K S P (positive) applies positive resolution on a set of SNF − ml clauses.Irrespective of the refinement, the shortest clause is selected to perform inferences; both forward and backward subsumption are used; the unit and lhs-unit resolution rules are applied; prenex and early_mlple are set; and no simplification steps are applied.K S P (ordered) offers the best performance on the MQBF and LWB collections, while on the 3CNF K collection K S P (negative) performs best.K S P (plain) performs slightly worse than these two refinements on all three collections and K S P (positive) is significantly worse than the other three refinements.Overall, as shown in Fig. 2d, K S P (ordered) performs best.Ordered resolution restricts the applicability of the rules further than the other refinements.Not only Fig. 3 Benchmarking results for all provers is this an advantage on satisfiable formulae in that a saturation can be found more quickly, but also unsatisfiable formulae where with this refinement K S P typically finds refutations more quickly than with any of the other refinements.That being said, the difference between K S P (plain), K S P (negative) and K S P (ordered) is smaller than one might expect.This is due to the fact that for a modal formula, the corresponding set of SNF ++ ml clauses is larger than the set of SNF + ml clauses which in turn is typically larger than the set of SNF ml clauses.This counterbalances the advantages gained from the more constrained proof search of the refinements.
Figure 3 compares the performance of all the provers on the MQBF, LWB, and 3CNF K collections and all benchmark formulae together.For the MQBF collection we see that K S P (ordered) performs better than any of the other provers.The graphs in Fig. 4 offer some insight into why K S P performs well on these formulae.Each of the four graphs shows for one formula from each class how many atomic subformulae occur at each modal level, the formulae originate from MQBF formulae with the same number of propositional symbols, conjuncts and QBF quantifier depth.Formulae in the class qbfS are the easiest, the total number of atomic subformulae is low and spread over a wide range of modal levels, thereby reducing the possibility of inference steps between the clauses in the layered normal form of these formulae.In contrast, in qbfMS formulae almost all atomic subformulae occur at just one modal level.Here the layered normal form can offer little advantage over a simpler normal form.But the number of atomic subformulae is still low and K S P seems to derive an advantage from the fact that the normal form 'flattens' the formula: K S P is at least two orders of magnitude faster than any other prover on this class.The classes qbf and qbfL are more challenging.While the atomic subformulae are more spread out over the modal levels than for qbfMS, at a lot of these modal levels there are more atomic subformulae than in a qbfMS formula in total.The layered modal translation is effective at reducing the number of inferences for these classes, but more inference possibilities remain than for qbfMS.Finally, qbfML combines the worst aspects of qbfL and qbfMS, the number of atomic subformulae is higher than for any other class and there is a 'peak' at one particular modal level.This is the only MQBF class containing formulae that K S P cannot solve.On the LWB collection K S P performs slightly better than the other provers with Spartacus being the second best system and the combination of the optimised functional translation with Vampire (OFT + Vampire) performing worst.Table 5 provides more detailed results.For each prover it shows in the left column how many of the 56 formulae in a class have been solved and in the right column the parameter value of the most difficult formula solved.For InKreSAT we are not reporting this parameter value for three classes on which the prover's runtime does not increase monotonically with the parameter value but fluctuates instead.As indicated in bold in the table, BDDTab is the best performing prover on one class, InKreSAT on three, OFT + Vampire on three, Spartacus on four, and K S P on five classes; K S P and Spartacus are joint best on a further two classes.A characteristic of the classes on which K S P performs best is again that atomic subformulae are evenly spread over a wide range of modal levels.
It is worth pointing out that simplification alone is sufficient to detect that formulae in lin_p are unsatisfiable.For grz_p, pure literal elimination can be used to reduce all formulae in this class to the same simple formula; the same is true for grz_n and lin_n.Thus, these classes are tests of how effectively and efficiently, if at all, a prover uses these techniques.
On the 3CNF K collection, InKreSAT is the best performing prover and K S P the worst performing one.This should now not come as a surprise.For 3CNF K we specifically restricted ourselves to formulae with low modal depth which in turn means that the layered normal form has little positive effect.
It is evident from these results that no prover is best on all the collections and on every benchmark formula.It therefore makes sense to employ a portfolio of provers when trying to determine the satisfiability of a modal formula.Following Schuppan and Darmawan [48], we can consider an 'Oracle Procedure' based on an oracle that for each benchmark formula picks For each prover, the left column shows how many of the 56 formulae have been solved and the right column shows the parameter of the most difficult formula solved.The best performance is shown in bold.Parameters are typeset in italics while indices are typeset in roman the best performing prover among the six that we have evaluated, or, alternatively, executes all six provers in parallel and then only accounts for the one with the shortest runtime.Table 6 shows for how many of benchmark formulae the Oracle Procedure would pick a particular prover to get the shortest runtime.As sometimes two or more provers can solve a benchmark formula in the same amount of time, some double counting is involved.Also, there are 227 benchmark formulae that none of the provers can solve within the time limit of 1000 CPU seconds.
A more realistic approach takes advantage of the observation that K S P performs best for formulae of high modal depth while other provers perform well on modal formulae of low modal depth.We consider a procedure that uses K S P (ordered) to solve all formulae with a modal depth greater than 3 while for all other formulae one of the other provers is used.The threshold of 3 gave us the best result in terms of the total number of problems solved by this procedure.Figure 5 shows how well this approach performs.It shows benchmarking results for combinations of K S P (ordered) with BDDTab, InKreSAT, and Spartacus.It also shows the performance of the Oracle Procedure as well as the performance of a restricted version of the Oracle Procedure that is only allowed to choose between InKreSAT and Spartacus.As we can see, the combination of K S P (ordered) with InKreSAT performs best, slightly better than the combination with Spartacus, and significantly better than the combination with BDDTab.The combination of K S P (ordered) with InKreSAT also performs better than the restricted Oracle Procedure.This indicates that such a combination not only offers a practical approach to obtaining a procedure that performs better than any single prover, but also that the use of K S P by such a procedure offers performance advantages over other combinations of provers.

Conclusions
We have presented the clausal resolution prover K S P for both local and global reasoning for the multi-modal propositional modal logic, K n .This is based on a complete calculus where resolution inferences are restricted to clauses at the same modal level.This paper focuses on the implemented prover providing full details of the input processing, normal forms, clause preprocessing, the main control loop including proof search strategies and clause selection, refinements via variants of ordered resolution, inference rules and dealing with redundant clauses.We carried out an experimental evaluation with the prover comparing K S P with other provers and also analysing some of these combinations.The evaluation shows that K S P works well on problems with high modal depth where the separation of modal layers can be exploited to improve the efficiency of reasoning.
As with all provers that provide a variety of strategies and optimisations, to get the best performance for a particular formula or class of formulae it is important to choose the right strategy and optimisations.K S P currently leaves that choice to the user.The development of an auto mode in which the prover makes a choice of its own, based on an analysis of the given formula, is future work.
The same applies to the transformation to the layered normal form.Again, K S P offers a number of ways in which this can be done as well as a number of simplifications that can be applied during the process.It is clear that this affects the performance of the prover, but we have yet to investigate the effects on the benchmark collections introduced in this paper.
Open Access This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/),which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.

Fig. 5
Fig. 5 Benchmarking results for portfolios of provers such that M globally satisfies ϕ.Satisfiability of a set of formulae is defined as usual.Given a set of formulae Γ , a formula ϕ is locally satisfiable under global assumptions Γ , if there is a model M such that M | G Γ and M | L ϕ.
Definition 5 Satisfaction of a formula at a world w of a model M is defined inductively, as follows: -(M, w) | p if, and only if, π(w)( p) = true, where p ∈ P; -(M, w) | ¬ϕ if, and only if, (M, w) | ϕ; -(M, w) | (ϕ ∧ ψ) if, and only if, (M, w) | ϕ and (M, w) | ψ; -(M, w) | (ϕ ∨ ψ) if, and only if, (M, w) | ϕ or (M, w) | ψ; -(M, w) | a ϕ if, and only if, for all w , w R a w implies (M, w ) | ϕ; -(M, w) | ♦ a ϕ if, and only if, there is w such that w R a w and (M, w ) | ϕ.Let M = (W , w 0 , R 1 , . .., R n , π) be a model.A formula ϕ is locally satisfied in M, denoted by M | L ϕ, if (M, w 0 ) | ϕ.The formula ϕ is locally satisfiable if there is a model M such that (M, w 0 ) | ϕ.A formula ϕ is globally satisfied in M, denoted by M | G ϕ, if for all w ∈ W , (M, w) | ϕ.A formula ϕ is said to be globally satisfiable if there is a model M

Table 2
Inference rules, where ml

Table 4
Simplification rules in ϕ as far as possible inwards the formula in order to produce ϕ equivalent to ϕ.For instance, the antiprenex normal form of ♦ a

Table 5
Detailed evaluation results on the LWB benchmark

Table 6
Use of each prover by an Oracle Solver