1 Introduction

Propositional modal logics can be applied to formalise and reason about a wide range of applications, including programming languages [22], knowledge representation and reasoning [4, 9, 23], verification of distributed systems [8, 10, 11] and terminological reasoning [26]. For such applications, it is expected that the underlying reasoning tool may be able to provide certification for their answer with respect to a particular problem. While at least one kind of certificate is expected to be produced, either in the form of a proof or a model, the production of both not only helps with the task related to the particular application (e.g. the generation of counter-examples in verification problems) but also assures the user that a reasoning tool has produced the right result as those certificates can be independently and automatically checked. Given the complexity of reasoning tools, with most of them implementing sophisticated optimization procedures which are very difficult to check for correctness, it is not surprising that the community in automated reasoning has been encouraging the extraction of both kind of certificates: some tracks in the SAT competitionFootnote 1 require both proofs and models; the same approach is argued for QBF reasoning tools [29]; and this is also required in some tracks of the CASC competition [32, 33], with standards being currently under discussionFootnote 2.

There are several implemented tools for basic propositional modal logic \({\textsf{K}_{n}}\), the logic considered in this paper. However, and somehow surprisingly, most of state-of-the-art tools do not produce any kind of certificate (e.g. CEGARBOX [6]); produce only partial information on models (e.g. Spartacus [7], InKreSAT [12]; see also discussion in [14]); or, as in our case, produce only proofs ( [17]). There are fully certified tools that do produce models and proofs (e.g. [34]), but their performance is usually not comparable to state-of-the-art provers.

In this paper we present the needed theoretical results that will allow us to implement certification for satisfiable problems in [19]. Our prover implements both the resolution calculi presented in [16] as well as the modal layered calculus MLR presented in [17]. Refinements, such as negative, positive, and ordered resolution are also implemented. As with other resolution-based systems, proofs produced by are easily readable and verifiable. However, as mentioned, model extraction has never been implemented. One of the reasons is that although the completeness proofs for the calculi in [16, 17] are constructive they do not yield efficient procedures. Very briefly, those proofs are similar to canonical constructions for axiomatic proof systems and rely on the construction of some structures over the subsets of consistent formulae of an input formula (in clausal form), and even in the best case require exponential time and space.

Here we present novel model construction algorithms from saturated sets of clauses produced by the positive, negative or order resolution refinements of MLR. These refinements require different normal forms: \({\textsf {SNF}_{ml}^{-}}\), \({\textsf {SNF}_{ml}^{+}}\), and \({\textsf {SNF}_{ml}^{++}}\), respectively. We first show how to obtain models from sets of \({\textsf {SNF}_{ml}^{++}}\) clauses saturated with respect to ordered resolution refinement of MLR (Sect. 3). This results in a deterministic procedure inspired by the Bachmair-Ganzinger model construction for ground first-order clauses [2]. For positive resolution, we adapt the procedure for \({\textsf {SNF}_{ml}^{++}}\) clauses by constructing separate orderings for each world in a model (Sect. 4). We then obtain a procedure for negative resolution by flipping the polarity of literals in \({\textsf {SNF}_{ml}^{+}}\) clauses and reusing the procedure for positive resolution (Sect. 5). From these procedures we obtain alternative completeness proofs for ordered and negative resolution; and provide the first completeness proof for positive resolution. Moreover, all procedures are deterministic and suitable for implementation.

The paper is structured as follows. In Sect. 2 we give details of the logic, resolution rules and resolution refinements. Sections 3, 4 and 5 provide the model construction algorithms for each refinement. We discuss our approach in relation to the Bachmair-Ganzinger method and consider complexity in Sect. 6. Section 7 presents how to perform model construction for extensions of basic modal logic. Finally, we draw conclusions and discuss future work in Sect. 8.

2 Preliminaries

Let \(P\) be a denumerable set of propositional symbols. Let \(A_n= \{1,\ldots ,n\}\), with \(n \in \mathbb N\), be a finite, fixed set of agents. The set of modal formulae over \(P\) and \(A_n\) is then the least set containing the two propositional constants \(\text{ true }\) and \(\text{ false }\), all elements of \(P\), and the formulae \(\lnot \varphi \), \((\varphi \wedge \psi )\), \((\varphi \vee \psi )\), \((\varphi \rightarrow \psi )\), \([{{a}}]\varphi \), and \(\langle {{a}}\rangle \varphi \) provided \(\varphi \) and \(\psi \) are modal formulae and \(a\in A_n\). The set of literals over \(P\) is \(L_{P}= \{p, \lnot p \mid p \in P\}\). For \(p\in P\), a literal p is a positive literal and a literal \(\lnot p\) is a negative literal. A modal literal is \([{{a}}]l\) or \(\langle {{a}}\rangle l\), for \({a}\in A_n\) and \(l \in L_{P}\).

The semantics of modal formulae is provided by Kripke structures. A Kripke structure \(M\) over \(P\) and \(A_n\) is a tuple \(\langle W,\{R_{{{a}}}\}_{{a}\in A_n},V \rangle \) where \(W\) is a non-empty set of worlds, each accessibility relation \(R_{{{a}}}\), \(a\in A_n\), is a binary relation on \(W\), and the valuation V is a function mapping each propositional symbol in \(P\) to a subset V(p) of \(W\). If \((w,w') \in R_{{{a}}}\), written \(wR_{{{a}}}w'\), we say \(w'\) is an \({a}\)-successor of w; we may omit the index \({a}\) when there is no need to distinguish the relation \(R_{{{a}}}\) and just say \(w'\) is a successor world of w.

Satisfaction (or truth) of a formula at a world \(w\) of a Kripke structure \(M= \langle W, \{R_{{{a}}}\}_{{a}\in A_n}, V \rangle \) is inductively defined by:

figure f

If \(\langle M, w \rangle \models \varphi \) holds then \(M\) is a model of \(\varphi \), \(\varphi \) is true at w in \(M\) and \(M\) satisfies \(\varphi \). A modal formula \(\varphi \) is (locally) satisfiable iff there exists a Kripke structure \(M\) and a world w in \(M\) such that \(\langle M, w \rangle \models \varphi \).

A tree Kripke structure M is an ordered pair \(\langle \langle W, \{R_{{{a}}}\}_{{a}\in A_n},V \rangle ,w_0 \rangle \) where \(w_0\in W\) and \(\bigcup _{{a}\in A_n}R_{{{a}}}\) is a tree, that is, a directed acyclic connected graph where each node has at most one predecessor, with root \(w_0\). Finally, M is a tree Kripke model of a modal formula \(\varphi \) iff \(\langle \langle W,\{R_{{{a}}}\}_{{a}\in A_n},V \rangle ,w_0 \rangle \models \varphi \). To simplify notation, in the following we write \(\langle W, \{R_{{{a}}}\}_{{a}\in A_n}, V,w_0 \rangle \) instead of \(\langle \langle W, \{R_{{{a}}}\}_{{a}\in A_n}, V \rangle ,w_0 \rangle \). In a tree Kripke structure with root \(w_0\) for every world \(w_k\in W\) there is exactly one path \(\vec{w}\) connecting \(w_0\) and \(w_k\); the modal level of \(w_k\) (in M), denoted by \({\textsf{ml}}_{M}(w_k)\), is given by \({\textsf{len}}(\vec{w})\). By M[ml] we denote the set of worlds that are at a modal level ml in \(M\), that is, \(M[ml] = \{w\in W\mid {\textsf{ml}}_{M}(w) = ml\}\).

In [18], we have introduced the Separated Normal Form with Modal Levels, \({\textsf {SNF}_{ml}^{}}\), for modal formulae. For the local satisfiability problem, clauses in \({\textsf {SNF}_{ml}^{}}\) are in one of the following forms:

  • Literal clause\(ml: \bigvee _{b=1}^{r} l_b\)

  • Positive \({a}\)-clause\(ml: l' \rightarrow [{{a}}]l\)

  • Negative \({a}\)-clause\(ml: l' \rightarrow \langle {{a}}\rangle l\)

where \(ml \in \mathbb N\) and l, \(l'\), \(l_b \in L_{P}\), \(1 \le b \le r\), \(r \in \mathbb N\). We denote by \(ml: \text{ false }\) an empty clause, that is, a literal clause with \(r=0\). Positive and negative \({a}\)-clauses are together known as modal \({a}\)-clauses. By a positive (negative) modal clause we mean a positive (negative) \({a}\)-clause for an arbitrary agent \({a}\in A_n\). We also use \(ml:l'\rightarrow ({{a}})l\) to denote a modal \({a}\)-clause that can either be a positive or a negative \({a}\)-clause.

A tree Kripke structure M satisfies a clause \(ml:\psi \) in \({\textsf {SNF}_{ml}^{}}\), written \(M\models ml:\psi \) iff for every \(w\in M[ml]\), \(\langle M, w \rangle \models \psi \). M satisfies a finite set \(\varPhi \) of clauses in \({\textsf {SNF}_{ml}^{}}\) iff for every \(ml:\psi \) in \(\varPhi \), M satisfies \(ml:\psi \). We then call M a Kripke model of \(\varPhi \). Finally, a set \(\varPhi \) of clauses in \({\textsf {SNF}_{ml}^{}}\) is satisfiable if there exists a tree Kripke structure M that satisfies \(\varPhi \).

Theorem 1

([17, 18]). Let \(\varphi \) be a modal formula. Then there exists a finite set \(\varPhi \) of clauses in \({\textsf {SNF}_{ml}^{}}\) such that \(\varphi \) is satisfiable iff \(\varPhi \) is satisfiable and if a tree Kripke structure M is a Kripke model of \(\varPhi \) then M is also a Kripke model of \(\varphi \).

The transformation of a modal formula \(\varphi \) into an equi-satisfiable set \(\varPhi \) of clauses in \({\textsf {SNF}_{ml}^{}}\) proceeds by replacing complex subformulae by new surrogate propositional symbols and including into \(\varPhi \) clauses defining those new symbols.

Given a finite set \(\varPhi \) of \({\textsf {SNF}_{ml}^{}}\) clauses, by \(P_\varPhi \) and \(L_{P}^\varPhi \) we denote the set of propositional symbols occurring in \(\varPhi \) and the set of propositional literals over \(P_\varPhi \), respectively. For \(ml\in \mathbb N\), by \(\varPhi [ml]\) we denote \(\{ml:\psi \mid ml:\psi \in \varPhi \}\). Then by \(\varPhi ^{lit}[ml]\), \(\varPhi ^{pos}[ml]\), and \(\varPhi ^{neg}[ml]\) we denote the set of all literal clauses, all positive modal clauses, and all negative modal clauses in \(\varPhi [ml]\), respectively. The maximal modal level \(\max _ ML (\varPhi )\) of \(\varPhi \) is \(\max (\{ml+1\mid ml:\psi \in \varPhi \text { and }ml:\psi \text { is a modal clause}\})\) and we assume \(\max (\emptyset ) = 0\).

In [18] we have also introduced a resolution calculus to reason with \({\textsf {SNF}_{ml}^{}}\), the modal-layered resolution (MLR) calculus. Table 1 shows the inference rules of this calculus restricted to the labels occurring in the normal form defined above. We require that clauses are kept in simplified form, that is, if \(ml \in \mathbb N\) and D is a (possibly empty) disjunction of literals, and \(l \in L_{P}\), then: \(ml: D \vee l \vee l\) simplifies to \(ml: D \vee l\); \(ml: D \vee \text{ false }\) simplifies to ml : D; and \(ml: D \vee l \vee \lnot l\) and \(ml:D \vee \text{ true }\) simplify to \(ml: \text{ true }\).

Let C and D be disjunctions of propositional literals. A clause ml : C subsumes a clause ml : D if and only if D is of the form \(C\vee C'\) where \(C'\) is a possibly empty disjunction of propositional literals.

Let \(\varPhi \) be a set of clauses in \({\textsf {SNF}_{ml}^{}}\). A derivation by MLR from \(\varPhi \) is a sequence of sets \(\varPhi = \varPhi _0,\varPhi _1,\ldots \) where for each \(i > 0\), either (i) \(\varPhi _{i+1} = \varPhi _i\cup \{ml:\psi \}\) where \(ml:\psi \) is the resolvent obtained by an application of one of the rules in Table 1 to premises in \(\varPhi _i\), \(ml:\psi \) is in simplified form, \(ml:\psi \) is not subsumed by a clause in \(\varPhi _i\), and \(ml:\psi \) is not a tautology, or (ii) \(\varPhi _{i+1} = \varPhi _i-\{ml:\psi \}\) where \(ml:\psi \) is subsumed by a clause in \(\varPhi _i-\{ml:\psi \}\).

A set of clauses \(\varPhi \) in \({\textsf {SNF}_{ml}^{}}\) is saturated with respect to MLR if any further application of the inference rules LRES, MRES, GEN1, GEN2 and GEN3 generates a clause already in \(\varPhi \) or subsumed by a clause in \(\varPhi \). A set of clauses \(\varPhi '\) in \({\textsf {SNF}_{ml}^{}}\) is the saturation of \(\varPhi \) with respect to MLR if there is a derivation \(\varPhi = \varPhi _0,\ldots ,\varPhi _n = \varPhi '\) by MLR from \(\varPhi \) such that \(\varPhi '\) is saturated with respect to MLR.

Just as for propositional clausal logic, to improve the efficiency of the MLR calculus it is important to restrict applications of the LRES rule, that is, to use a refinement of this rule. However, when doing so it is not enough to ensure that from a set of literal clauses that logically implies a clause of the form \(ml:\text{ false }\) we can derive that clause. Instead we have to make sure that all literal clauses that could be used as premises for GEN1 and GEN3 can still be derived. A sufficient, though not necessary, condition for that is to ensure that the refinement of LRES is consequence complete.

Table 1. Inference rules of the Modal Layered Resolution (MLR) calculus

In [17] we have considered three refinements of propositional resolution as a basis for refinements of LRES:

  • Negative Resolution [24] is a special case of semantic resolution [30], which restricts clause selection by using an interpretation as a guide. For the classical case, given an interpretation I, the (binary) semantic resolution rule allows to derive \(D\vee D'\) from \(D\vee l\) and \(D'\vee \lnot l\) provided one of the clauses in the premises is an electron, that is, a clause which evaluates to \(\text{ false }\) under I. By taking \(I(p)=\text{ true }\), for all propositional symbols p, semantic resolution corresponds to negative resolution, that is, the electron is a clause containing only negative literals. Semantic resolution is complete irrespective of the interpretation chosen to guide the search for a proof [30]. Moreover, semantic resolution is also consequence complete [31]. The following theorem, which follows directly from the consequence completeness of semantic resolution, holds:

Theorem 2

([31, Theorem 8]). If a clause C is a prime consequence of a finite set \(\varPhi \) of clauses and contains no negative (positive) literals, then there is a positive (negative) resolution derivation of C from \(\varPhi \).

Theorem 2 ensures that all clauses containing only negative literals and which are consequences of a set of clauses are generated by applications of negative resolution to the clause set.

Our calculus for \({\textsf {SNF}_{ml}^{}}\) can be restricted to negative resolution with a small change in the normal form by allowing only positive literals in the scope of modal operators. Given a set \(\varPhi \) of clauses in \({\textsf {SNF}_{ml}^{}}\), we exhaustively apply the following transformations to \(\varPhi \) (where \(ml \in \mathbb N\), \(t \in L_{P}\), \(p \in P\), and \(t'\) is a new propositional symbol):

$$\begin{aligned} \varPhi '\cup \{ml: \lnot p \rightarrow ({{a}}) t\} &\Rightarrow \varPhi '\cup \{ml: t'\rightarrow ({{a}}) t, ml: t'\vee p\} \\ \varPhi '\cup \{ml: t \rightarrow ({{a}}) \lnot p\} &\Rightarrow \varPhi '\cup \{ml: t\rightarrow ({{a}}) t', ml+1: \lnot t' \vee \lnot p\} \end{aligned}$$

Note that the transformation rules are not mutually exclusive. The first transformation ensures that resolvents of the modal inference rules are negative literal clauses. The second transformation rule ensures that only positive literals are in the scope of modal operators. It can be shown that the resulting set of clauses is satisfiable if, and only if, the original set of clauses is satisfiable. We call the resulting normal form, where there are no negative literals below modal operators, \({\textsf {SNF}_{ml}^{+}}\).

  • Positive Resolution is then the analogous special case of semantic resolution for an interpretation in which all propositional symbols are false. Electrons then must be clauses in which all literals are positive.

    \({\textsf {SNF}_{ml}^{}}\) can be restricted to positive resolution if we only allow negative literals in the scope of modal operators. Given a set \(\varPhi \) of clauses in \({\textsf {SNF}_{ml}^{}}\), we exhaustively apply the following transformation to \(\varPhi \) (where \(ml \in \mathbb N\), \(t \in L_{P}\), \(p \in P\), and \(t'\) is a new propositional symbol):

    $$\begin{aligned} \varPhi '\cup \{ml: p\rightarrow ({{a}})t\} &\Rightarrow \varPhi '\cup \{ ml: \lnot p\vee \lnot t', ml: \lnot t'\rightarrow ({{a}})t\}\\ \varPhi '\cup \{ml: t \rightarrow ({{a}}) p\} &\Rightarrow \varPhi '\cup \{ ml: t\rightarrow ({{a}})\lnot t', ml+1: t' \vee p\} \end{aligned}$$

    These transformation rules are analogous to those for \({\textsf {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. We call the resulting normal form \({\textsf {SNF}_{ml}^{-}}\).

  • Ordered Resolution is a refinement of resolution where inferences are restricted to maximal literals in a clause, with respect to a well-founded ordering on literals. Formally, let \(\prec \) be a well-founded and total ordering on \(P_\varPhi \). This ordering can be extended to literals \(L_{P}^\varPhi \) occurring in \(\varPhi \) by setting \(p \prec \lnot p\) and \(\lnot q \prec p\) whenever \(q \prec p\), for all \(p,q \in P_\varPhi \). A literal l is said to be maximal with respect to a clause \(C \vee l\) if, and only if, there is no \(l'\) occurring in C such that \(l \prec l'\). In the case of classical binary resolution, the ordering refinement restricts the application to clauses \(C \vee l\) and \(D \vee \lnot l\) where l is maximal with respect to C and \(\lnot l\) is maximal with respect to D.

    The key idea for achieving completeness when restricting LRES to ordered resolution is to introduce new literals in the scope of the modal operators and set their ordering to be “low enough” so that the relevant literal clauses needed for the modal hyper-resolution rules (i.e., the GEN rules) are generated. Given a set of clauses \(\varPhi \) in \({\textsf {SNF}_{ml}^{}}\) and a well-founded and total ordering \(\prec \) on \(P_\varPhi \), we exhaustively apply the following transformations to \(\varPhi \) (where \(ml \in \mathbb N\), \(t, l \in L^\varPhi _P\) and \(t'\) is a new propositional symbol):

    $$ \begin{array}{l} \varPhi '\cup \{ml: t \rightarrow [{{a}}] l\} \Rightarrow \varPhi '\cup \{ml: t\rightarrow [{{a}}] t', ml+1: \lnot t' \vee l\} \\ \varPhi '\cup \{ml: t \rightarrow \langle {{a}}\rangle l\} \Rightarrow \varPhi '\cup \{ml: t\rightarrow \langle {{a}}\rangle t', ml+1: \lnot t' \vee l\} \end{array} $$

    and extend the given ordering by setting \(t' \prec p\), for all p occurring in \(\varPhi \). Recall that \(\varPhi \) already includes surrogate propositional symbols from the transformation of a modal formula \(\varphi \) to \({\textsf {SNF}_{ml}^{}}\). We call the resulting normal form \({\textsf {SNF}_{ml}^{++}}\). Note that we only need to apply the rewriting rule to the clauses in \(\varPhi \), but not to the generated clauses in \({\textsf {SNF}_{ml}^{++}}\). Thus, the rewriting procedure is terminating. Two characteristics of \({\textsf {SNF}_{ml}^{++}}\) that we will use in our proofs is that (i) the only positive occurrence of a symbol \(t'\) introduced by the transformation is below a modal operator, all other occurrences of \(t'\) are negative; and (ii) there are no two modal clauses with the same propositional symbol below a modal operator.

Theorem 3

Let \(\varphi \) be a satisfiable modal formula, let \(\varPhi \) be the corresponding finite set of clauses in \({\textsf {SNF}_{ml}^{}}\), \({\textsf {SNF}_{ml}^{-}}\), \({\textsf {SNF}_{ml}^{+}}\), or \({\textsf {SNF}_{ml}^{++}}\). If \(M\) is a Kripke model of \(\varPhi \) then \(M\) is a Kripke model of \(\varphi \).

Proof

Follows from the proofs of Lemmata 3.6 and 3.9 to 3.13 in [17].

Theorem 4

Let \(\varPhi \) be a finite set of clauses in \({\textsf {SNF}_{ml}^{}}\), \({\textsf {SNF}_{ml}^{-}}\), \({\textsf {SNF}_{ml}^{+}},\) or \({\textsf {SNF}_{ml}^{++}}\). Let \(\varPhi '\) be the saturation of \(\varPhi \) with respect to MLR or one of its refinements. If \(M\) is a Kripke model of \(\varPhi '\) then \(M\) is a Kripke model of \(\varPhi \).

Fig. 1.
figure 1

Auxiliary functions \(\textsf{isTrue}\) and \(\textsf{isProductive}\) used in Fig. 2 and Fig. 4

3 Deterministic Model Construction for \({\textsf {SNF}_{ml}^{++}}\) Clauses

We first describe a model construction algorithm for a set of \({\textsf {SNF}_{ml}^{++}}\) clauses. Let \(\varPhi '\) be a satisfiable set of \({\textsf {SNF}_{ml}^{++}}\) clauses. Let \(\prec \) be a total ordering on the propositional symbols in \(P_{\varPhi '}\) compliant with the conditions set out in Sect. 2. Let \(\varPhi \) be the saturation of \(\varPhi '\) wrt the ordered resolution refinement of \(\textrm{MLR}\) with ordering \(\prec \). Let \(\max _{lit}\) be the function that maps a propositional clause C to the \(\prec \)-maximal literal in C.

For our model construction procedure we need to extend \(\prec \) to a well-founded total ordering on \({\textsf {SNF}_{ml}^{++}}\) clauses that we will also denote by \(\prec \). Recall that \(p \prec \lnot p\) for every \(p\in P_\varPhi \) and \(\lnot p \prec q\) iff \(p\prec q\) for every \(p,q\in P_\varPhi \). We now extend \(\prec \) to propositional clauses (sets of propositional literals) such that \(C_1\prec C_2\) iff (i) \(C_1\not =C_2\), and (ii) whenever \(l_1\in C_1\) but \(l_1\not \in C_2\) then there exists \(l_2\) with \(l_1\prec l_2\), \(l_2\in C_2\), \(l_2\not \in C_1\). Finally, on \({\textsf {SNF}_{ml}^{++}}\) clauses we allow any well-founded total ordering such that \(ml_1:\psi _1\prec ml_2:\psi _2\) if (i) \(ml_1 < ml_2\) or (ii) \(ml_1 = ml_2\), \(\psi _1\) and \(\psi _2\) are propositional clauses, and \(\psi _1\prec \psi _2\). Strictly, the procedure itself only relies on the ordering on literal clauses but the correctness proof also requires an ordering between literal and modal clauses.

Fig. 2.
figure 2

Local Model Construction for \({\textsf {SNF}_{ml}^{++}}\)

Figure 2 shows our deterministic model construction procedure for saturated sets of \({\textsf {SNF}_{ml}^{++}}\) clauses. The procedure uses auxiliary functions \(\textsf{isTrue}\) and \(\textsf{isProductive}\) that are shown in Fig. 1. The procedure constructs a Kripke structure starting at modal level 0 with a root world and proceeds in much the same way as a classic tableau procedure [13]. The main difference is that the valuation for each world is constructed deterministically using the Bachmair-Ganzinger model construction (Lines 9–12). Once the valuation for a world w at modal level ml has been constructed, first each modal clause \(ml:l'\rightarrow \langle {{a}}\rangle l\) is considered (Lines 14–19). If the literal \(l'\) is true at w, then a new successor world \(w'\) is created, using an auxiliary function \(\textsf{new}_{ml,{a},l}(w)\), and a pair \((w,w')\) added to the accessibility relation \(R_{{{a}}}\) for agent \({a}\). If the literal l is positive, then it will be added to the valuation for world \(w'\) After all those negative modal clauses have been considered, all successor worlds of \(w'\) necessary for a model have been created and each positive modal clause \(ml:l'\rightarrow [{{a}}]l\) is considered (Lines 20–22). If the literal \(l'\) is true at w and the literal l is positive, then l is added to the valuation of each successor world \(w'\) of w for \(R_{{{a}}}\). Crucially, for both positive and negative modal clauses in \({\textsf {SNF}_{ml}^{++}}\), the literal l below the modal operator is always positive. Since a world is never removed from the valuation V, later modifications of V will not result in a situation where l becomes false at a successor world \(w'\).

Theorem 5

Let \(\varphi \) be a satisfiable modal formula and let \(\varPhi '\) be the corresponding finite set of \({\textsf {SNF}_{ml}^{++}}\) clauses. Let \(\varPhi \) be the saturation of \(\varPhi '\) wrt the ordered refinement of \(\textrm{MLR}\) with an ordering \(\prec \). Let \(M\) be the Kripke structure constructed by the algorithm in Fig. 2 for \(\varPhi \). Then \(M\) is a model of \(\varPhi '\), \(\varPhi \), and \(\varphi \).

Example 1

Consider the satisfiable set \(\varPhi _1\) of \({\textsf {SNF}_{ml}^{}}\) clauses consisting of the three clauses 0 : q, \(0:q\rightarrow \langle {{a}}\rangle \lnot r\) and \(1:q\vee r\). The transformation to \({\textsf {SNF}_{ml}^{++}}\) introduces an additional propositional symbol \(t_{\lnot r}\) and the resulting set \(\varPhi _1^{++}\) of \({\textsf {SNF}_{ml}^{++}}\) clauses consists of

figure g

In the ordering on propositional symbol on \(P_{\varPhi _1^{++}}\), \(t_{\lnot r}\) must be smaller than q and r. We assume \(t_{\lnot r} \prec q \prec r\). Saturation only derives one additional clause

figure h

by application of LRES to Clauses (3) and (4). The order between the three literal clauses at level 1 is \(1:q\vee \lnot t_{\lnot r}\prec 1:q\vee r \prec 1:\lnot t_{\lnot r}\vee \lnot r\). The model construction process then proceeds as follows.

figure i

The constructed Kripke structure is

$$ \begin{array}{@{}l@{}l@{}l@{}l@{}l@{}} W = \{w_0,w_1\} & R_{{{a}}} = \{(w_0,w_1)\} & V(q) = \{w_0,w_1\} & V(r) = \emptyset & V(t_{\lnot r}) = \{w_1\} \end{array} $$

which is a model of both \(\varPhi _1^{++}\) and \(\varPhi _1\).

4 Deterministic Model Construction for \({\textsf {SNF}_{ml}^{-}}\) Clauses

The model construction for sets of \({\textsf {SNF}_{ml}^{++}}\) clauses saturated with respect to the ordered refinement of \(\textrm{MLR}\) used the same ordering \(\prec \) as was used by the calculus. However, the positive resolution refinement of \(\textrm{MLR}\) is not based on an ordering and therefore there is no pre-existing ordering that can be used in the model construction for sets of \({\textsf {SNF}_{ml}^{-}}\) clauses saturated with respect to the positive resolution refinement of \(\textrm{MLR}\). So, to adapt the procedure presented in Sect. 3 to sets of \({\textsf {SNF}_{ml}^{-}}\) clauses, we need to construct an ordering. The fact that below operators we now only have negative propositional literals further complicates things as we have to make sure that we do not unnecessarily produce corresponding positive literals from literal clauses.

Suppose we have a world w at modal level ml and we have determined that \(\langle {{a}}\rangle \lnot p_1\), ..., \(\langle {{a}}\rangle \lnot p_m\), \([{{a}}]\lnot q_1\), ..., \([{{a}}]\lnot q_n\), \(0<m\), \(0\le n\) are all the modal literals that have to be true at w. For each \(\langle {{a}}\rangle \lnot p_i\), \(1\le i\le m\), we have to create a successor world \(w_i\) of w at modal level \(ml+1\). Then we have to make sure that \(p_i\), \(q_1\), ..., \(q_n\) are smaller than all other propositional symbols for \(w_i\), \(1\le i\le m\), in order to ensure that literal clauses \(ml+1:\psi \) do not unnecessarily produce \(p_i\) or one of the \(q_j\), \(1\le j\le n\), when considered for the world \(w_i\). For this purpose, first we use a function-valued variable PS that for each successor world \(w_i\) keeps track of the propositional symbols \(p_i\), \(q_1\), ..., \(q_n\). Second we use a function \(\texttt {constructOrdering}\) (Fig. 3) that, given \(PS(w_i)\) for some world \(w_i\), constructs an ordering \(\prec _{w_i}\) on propositional symbols specifically for \(w_i\) that has the desired property.

This ordering is then extended to literals and to literal clauses with the same modal level as in Sect. 3. This is sufficient for the model construction procedure in Fig. 4. Except for the function-valued variable PS and the function \(\texttt {constructOrdering}\) the only other difference to the model construction procedure for \({\textsf {SNF}_{ml}^{++}}\) in Fig. 2 is that literals below modal operators are always negative and therefore never change the valuation.

Fig. 3.
figure 3

Auxiliary function \(\textsf{constructOrdering}\) used in Fig. 4

Fig. 4.
figure 4

Local Model Construction for \({\textsf {SNF}_{ml}^{-}}\)

However, for our correctness proof we need to combine and extend these orderings into a total ordering. This total ordering will not be on the clauses themselves but on ordered pairs \(\langle w,ml:\psi \rangle \) consisting of a world w at modal level ml in a Kripke structure \(M\) and a clause \(ml:\psi \in \varPhi \). We use \(H(\varPhi ,M)\) to denote the set of all such ordered pairs.

Let \(W\) be the set of worlds in a Kripke structure \(M\) produced by the algorithm in Fig. 4. We can use the order in which the worlds in \(W\) were generated to impose a total ordering \(\prec _W\) on \(W\). Note that \({\textsf{ml}}_{M}(w_1)<{\textsf{ml}}_{M}(w_2)\) implies \(w_1 \prec _w w_2\). Then on \(H(\varPhi ,M)\) we allow any well-founded total ordering \(\prec _{H(\varPhi ,M)}\) such that \(\langle w_1,ml_1:\psi _1 \rangle \prec \langle w_2,ml_2:\psi _2 \rangle \) if (i) \(ml_1 < ml_2\) or (ii) \(ml_1 = ml_2\) and \(w_1 \prec _w w_2\), or (iii) \(ml_1 = ml_2\), \(w_1 = w_2\), \(\psi _1\) and \(\psi _2\) are propositional clauses, and \(\psi _1\prec _{w_1}\psi _2\).

Theorem 6

Let \(\varphi \) be a satisfiable modal formula and let \(\varPhi '\) be the corresponding finite set of \({\textsf {SNF}_{ml}^{-}}\) clauses. Let \(\varPhi \) be the saturation of \(\varPhi '\) wrt the positive resolution refinement of \(\textrm{MLR}\). Let \(M\) be the Kripke structure constructed by the algorithm in Fig. 4 for \(\varPhi \). Then \(M\) is a model of \(\varPhi '\), \(\varPhi \), and \(\varphi \).

Example 2

Consider the satisfiable set of clauses \(\varPhi _2^{-}\) in \({\textsf {SNF}_{ml}^{-}}\):

figure j

where \(\lnot t_1\) is a surrogate introduced for \((q\vee r)\). This set of clauses is saturated with respect to the positive resolution refinement of \(\textrm{MLR}\). The model construction for \(\varPhi _2^{-}\) proceeds as before:

 

Clause C

Kripke Structure M

Consideration of C

  

W

\(R_{{{a}}}\)

V

 

\(w_0\)

0 : q

\(\{w_0\}\)

\(\emptyset \)

\(\emptyset \)

\(\begin{array}{l} \textit{Because }\langle M, w_1 \rangle \not \models C\\ \textit{and }q\textit{ is maximal in }C\textit{:}\\ V(q) = V(q)\cup \{w_0\} \end{array}\)

\(w_0\)

\(0:\lnot q\rightarrow \langle {{a}}\rangle \lnot q\)

\(\{w_0\}\)

\(\emptyset \)

\(\{(q,\{w_0\})\}\)

\(\begin{array}{l} \textit{Because }w_0\in V(q)\textit{:}\\ \textit{no change} \end{array}\)

\(w_0\)

\(0:\lnot p\rightarrow \langle {{a}}\rangle \lnot r\)

\(\{w_0\}\)

\(\emptyset \)

\(\{(q,\{w_0\})\}\)

\(\begin{array}{l} \textit{Because }w_0\not \in V(p)\textit{:}\\ W = W\cup \{w_1\}\\ R_{{{a}}} = R_{{{a}}}\cup \{(w_0,w_1)\} \end{array}\)

\(w_0\)

\(0:\lnot p\rightarrow [{{a}}]\lnot t_1\)

\(\{w_0,w_1\}\)

\(\{(w_0,w_1)\}\)

\(\{(q,\{w_0\})\}\)

\(\begin{array}{l} \textit{Because }w_0\not \in V(p)\\ \textit{but }\lnot t_1\textit{ is negative:}\\ \textit{no change} \end{array}\)

Before the model construction proceeds to \(w_1\), we now determine the ordering \(\prec _{w_1}\). The literals \(\lnot r\) and \(\lnot t_1\) ‘contribute’ to the construction of \(w_1\), so r and \(t_1\) must be smaller in \(\prec _{w_1}\) than the other propositional symbols p and q. Let us assume \(t_1\prec _{w_1} r\prec _{w_1} p\prec _{w_1} q\). So, when we proceed to \(w_1\) and the clause \(1:t_1\vee q\vee r\), it will be q that will be made true not r:

 

Clause C

Kripke Structure M

Consideration of C

  

W

\(R_{{{a}}}\)

V

 

\(w_1\)

\(1:t_1\vee q\vee r\)

\(\{w_0,w_1\}\)

\(\{(w_0,w_1)\}\)

\(\{\begin{array}{l} (q,\{w_0\})\} \end{array}\)

\(\begin{array}{l} \textit{Because }\langle M, w_1 \rangle \not \models C\\ \textit{and }q\textit{ is maximal in }C\textit{:}\\ V(q) = V(q)\cup \{w_1\} \end{array}\)

The constructed Kripke structure \(M_2\) is

$$ \begin{array}{@{}l@{}l@{}} \begin{array}{@{}ll@{}} W &{}= \{w_0,w_1\}\\ R_{{{a}}} &{}= \{(w_0,w_1)\}\\ \end{array} &{} \begin{array}{@{}ll@{}ll@{}ll@{}} V(p) &{}= \emptyset &{} V(q) &{}= \{w_0,w_1\} &{} V(r) &{}= \emptyset \\ \end{array} \end{array} $$

which is a model of \(\varPhi _2^{-}\).

5 Deterministic Model Construction for \({\textsf {SNF}_{ml}^{+}}\) Clauses

Our model construction for a set \(\varPhi \) of \({\textsf {SNF}_{ml}^{++}}\) clauses saturated wrt the ordered resolution refinement of \(\textrm{MLR}\) started with a valuation in which every propositional symbol is false at every world and successively makes propositional symbols true at certain worlds in order to ensure all clauses of \(\varPhi \) are true in the constructed model.

For propositional clauses, negative resolution corresponds to semantic resolution wrt the valuation \(V_\top \) in which all propositional symbols are true. A model construction for a set \(\varPhi \) of \({\textsf {SNF}_{ml}^{+}}\) clauses saturated wrt the negative resolution refinement of \(\textrm{MLR}\) would therefore naturally start with a valuation in which every propositional symbol is true at every world and successively make propositional symbols false at certain worlds to obtain a model of \(\varPhi \).

However, instead of devising a new model construction procedure that does so, we take advantage of the fact that we can simply reverse the polarity of all literals in \(\varPhi \), to again start with a valuation in which every propositional symbol is false at every world.

More formally, let be a function on propositional literals such that for every propositional symbol \(p\in P\), and . The function can be homomorphically extended to clauses and set of clauses as follows:

figure o

and . Let be a function on Kripke structures such that for \(M = \langle W, \{R_{{{a}}}\}_{{a}\in A_n}, V \rangle \), , such that \(V^{+}(p) = W-V(p)\) for every \(p\in P\).

Lemma 1

Let \(\varPhi \) be a set of clauses in \({\textsf {SNF}_{ml}^{}}\). Let \(M^f\) be a tree Kripke model of . Then is a tree Kripke model of \(\varPhi \).

Lemma 2

Let \(\varPhi ^{+}\) be a set of clauses in \({\textsf {SNF}_{ml}^{+}}\) that is saturated with respect to the negative resolution refinement of \(\textrm{MLR}\). Then is (i) a set of clauses in \({\textsf {SNF}_{ml}^{-}}\) and (ii) saturated with respect to the positive resolution refinement of \(\textrm{MLR}\).

Theorem 7

Let \(\varphi \) be a satisfiable modal formula, let \(\varPhi '\) be the corresponding finite set of clauses in \({\textsf {SNF}_{ml}^{+}}\), and let \(\varPhi \) be the saturation of \(\varPhi '\) wrt the negative resolution refinement of \(\textrm{MLR}\). Let , let \(M^f\) be the Kripke structure constructed by the algorithm in Fig. 4 for \(\varPhi ^f\), and let . Then \(M\) is a model of \(\varPhi '\), \(\varPhi \), and \(\varphi \).

Example 3

Consider the satisfiable \({\textsf {SNF}_{ml}^{+}}\) clause set \(\varPhi _3^{+}= \{0:p, 0:p\rightarrow \langle {{a}}\rangle r, 0:q\rightarrow [{{a}}]q, 1:q\vee \lnot r\}\). Reversing the polarity of all literals in \(\varPhi _3^{+}\) gives us the \({\textsf {SNF}_{ml}^{-}}\) clause set \(\varPhi _3^{f}\)

figure x

which is saturated with respect to the positive resolution refinement of calculus \(\textrm{MLR}\).

 

Clause C

Kripke Structure M

Consideration of C

  

W

\(R_{{{a}}}\)

V

 

\(w_0\)

\(0:\lnot p\)

\(\{w_0\}\)

\(\emptyset \)

\(\emptyset \)

\(\begin{array}{l} \textit{Because }\langle M_C, w_0 \rangle \models \lnot p\textit{:}\\ \textit{no change} \end{array}\)

\(w_0\)

\(0:\lnot p\rightarrow \langle {{a}}\rangle \lnot r\)

\(\{w_0\}\)

\(\emptyset \)

\(\emptyset \)

\( \begin{array}{l} \textit{Because }\langle M_C, w_0 \rangle \models \lnot p\textit{:}\\ W = W\cup \{w_1\}\\ R_{{{a}}} = R_{{{a}}}\cup \{(w_0,w_1)\}\\ \end{array}\)

\(w_0\)

\(0:\lnot q\rightarrow [{{a}}]\lnot q\)

\(\{w_0,w_1\}\)

\(\{(w_0,w_1)\}\)

\(\emptyset \)

\(\begin{array}{l} \textit{Because }\langle M_C, w_0 \rangle \models \lnot q\textit{:}\\ \textit{no change} \end{array}\)

Before the model construction proceeds to \(w_1\), we now fix the ordering \(\prec _{w_1}\). The literals \(\lnot q\) and \(\lnot r\) ‘contributed’ to the construction of \(w_1\), so q and r must both be smaller in \(\prec _{w_1}\) than the only other propositional symbol p, while we can impose an arbitrary order between q and r, e.g., \(q\prec _{w_1} r\prec _{w_1}p\).

 

Clause C

Kripke Structure M

Consideration of C

  

W

\(R_{{{a}}}\)

V

 

\(w_1\)

\(1:\lnot q\vee r\)

\(\{w_0,w_1\}\)

\(\{(w_0,w_1)\}\)

\(\emptyset \)

\(\begin{array}{l} \textit{Because }\langle M_C, w_1 \rangle \models C\textit{:}\\ \textit{no change} \end{array}\)

The resulting Kripke structure \(M_3^f\) is

$$ W = \{w_0,w_1\} \quad R_{{{a}}} = \{(w_0,w_1)\} \quad V(p) = V(q) = V(r) = \emptyset $$

which is a model of \(\varPhi _3^{f}\). We obtain \(M_3^+\) by reversing the valuation in \(M_3^f\):

$$ \begin{array}{@{}ll@{}} \begin{array}{@{}ll@{}} W &{}= \{w_0,w_1\}\\ R_{{{a}}} &{}= \{(w_0,w_1)\}\\ \end{array} &{} \begin{array}{@{}ll@{}} V(p) &{}= V(q) = V(r) = W-\emptyset = \{w_0,w_1\}\\ \end{array} \end{array} $$

It is straightforward to check that \(M_3^+\) is a model of \(\varPhi _3^{+}= \{0:p, 0:p\rightarrow \langle {{a}}\rangle r, 0:q\rightarrow [{{a}}]q, 1:q\vee \lnot r\}\).

6 Discussion

The model construction procedures presented in this paper are inspired by and closely related to the Bachmair-Ganzinger model construction procedure [2, 15]. The primary purpose of this model construction procedure is to prove the completeness of resolution and superposition calculi, in particular, ordered resolution with selection for first-order clausal logic. But it can also be used to construct a Herbrand model of a specific saturated set of propositional or ground first-order clauses.

Commonalities and differences between the two approaches are best illustrated by an example. Consider the following set of clauses in \({\textsf {SNF}_{ml}^{++}}\).

figure y

The corresponding set of first-order clauses, using the relational translation and ignoring the specific modal levels at which each \({\textsf {SNF}_{ml}^{++}}\) clause is meant to hold, is as follows.

figure z

Following [28] on resolution-based decision procedures for the relational translation of basic modal logic, we choose an ordering that ensures that \(\lnot r(x,y)\), \(q_2(f(x))\) and r(xf(x)) are maximal in Clauses (20), (21) and (22), respectively. We are free to impose an arbitrary order on unary literals and we choose an ordering such that \(p_0(x) \prec q_0(x) \prec q_1(x)\prec q_2(x)\). We can then derive the following additional clauses:

figure aa

Here ‘ORes’ denotes an inference by ordered resolution, followed by the identifying numbers of the clauses that are the premises of the inference. The number in parentheses identifies the literal in each premise on which we resolve. The Bachmair-Ganzinger model construction operates on ground clauses, in particular, all ground instances of the first-order clauses here, and it views clauses as multisets of literals. However, the Herbrand universe for this set of clauses is infinite. Given that a Kripke model for the set of \({\textsf {SNF}_{ml}^{++}}\) clauses has at most depth 1, we can restrict ourselves to the terms \(w_0\) and \(f(w_0)\).

The constructed model consists of \(p(w_0)\), \(r(w_0,f(w_0))\), \(q_0(f(w_0))\), \(q_1(f(w_0))\) and \(q_2(f(w_0))\). In particular, \(q_0(f(w_0))\) is produced by an instance of Clause (26).

For this particular example, our own procedure will arrive at the same model, but the way it does so differs in a number of ways. First, we are more constrained regarding the order we can use. Regarding the propositional symbols \(q_0\), \(q_1\) and \(q_2\) we have to ensure that the propositional symbols \(q_1\) and \(q_2\) that appear below modal operators are smaller than the other propositional symbols. So, the ordering \(p_0\prec q_0\prec q_1\prec q_2\) corresponding to the one we used in the first-order setting is not admissible. Instead we have to use, for example, \(q_1\prec q_2\prec p_0\prec q_0\).

Second, irrespective of the ordering, no inferences by \(\textrm{MLR}\) are possible on Clauses (15) to (18). This also means no equivalent of Clause (26) will be derived. Consequently, our model construction procedure has fewer clauses available and less explicit information about which propositional symbols have to be true.

Third, the order in which clauses are considered by the Bachmair-Ganzinger procedure for ground first-order clauses is solely down to the ordering. In contrast our model construction procedure considers literal clauses according to the ordering, but negative and positive modal clauses are handled separately. This design choice is mainly down to the fact that the effects of existential and universal quantifiers are dealt with at different times. In the first-order setting, existential quantifiers are dealt with by the use of Skolem functions in first-order clauses while universal quantifiers are dealt with by instantiation when ground clauses are computed. In the modal setting, \(\langle {{a}}\rangle \)- and \([{{a}}]\)-operators are only dealt with by the model construction procedure.

Regarding the complexity of our approach we can observe the following.

Theorem 8

Let \(\varphi \) be a satisfiable modal formula, let \(\varPhi '\) be the corresponding finite set of clauses in one of the three normal forms \({\textsf {SNF}_{ml}^{++}}\), \({\textsf {SNF}_{ml}^{+}}\) or \({\textsf {SNF}_{ml}^{-}}\), let \(\varPhi \) be the saturation of \(\varPhi '\) wrt to the corresponding refinement of MLR, and let \(M\) be model generated by the corresponding model construction procedure. Then

  1. a.

    the computation of \(\varPhi '\) from \(\varphi \) requires linear time in the size of \(\varphi \) and the number of clauses in \(\varPhi '\) as well as the size of \(\varPhi '\) is linear in the size of \(\varphi \);

  2. b.

    the computation of \(\varPhi \) from \(\varPhi '\) requires at most exponential time in the size of \(\varPhi \) and the number of literal clauses in \(\varPhi \) is at most exponential in the number of propositional symbols in \(\varPhi '\);

  3. c.

    the generation of \(M\) requires at most exponential time in the size of \(\varPhi \) and the size of \(M\) is also at most exponential in the size of \(\varPhi '\).

Theorem 8a follows from the fact that the normal form transformation introduces at most two clauses for each occurrence of a logical operator in \(\varphi \). Regarding Theorem 8b, the resolution procedure for propositional clauses runs in deterministic exponential time in the number of literals occurring in the clause set [25]. The refinements we use and the additional modal inference rules in \(\textrm{MLR}\) do not change the overall complexity, in particular, no new modal clauses are generated by any of the inference rules. For Theorem 8c, the number of worlds in a tree Kripke model of \(\varphi \) is at most exponential in the size of \(\varphi \) [9]. For each of the worlds in the model we have to consider exponentially many literal clauses to determine the valuation of the model. The consideration of each clause takes at most linear time in the number of propositional symbols in \(\varPhi '\).

It is worth pointing out that the Bachmair-Ganzinger procedure only takes time \(O(|\varPhi |l\log (|\varPhi |))\) for a set of ground clauses \(\varPhi \) [15]. In the context of the translation of modal formulae to first-order clausal logic, the size of the set \(N'\) of non-ground clauses obtained from the translation of \(\varphi \) is linear in the size of \(\varphi \). But the size of the set N of ground clauses obtained by instantiation can be exponential in the size of \(N'\) and therefore in the size of \(\varphi \). So, while the construction of a Herbrand model then only requires polynomial time in the size of N, it takes exponential time in the size of \(N'\) and of \(\varphi \). This then aligns with Theorem 8.

7 Extension to the Modal Cube

A multitude of extensions of the basic modal logic \({\textsf{K}_{n}}\) can be formed by adding one or more axioms to the axiomatisation of \({\textsf{K}_{n}}\) itself. The most extensively studied axioms are \(\psi \rightarrow [{{a}}]\langle {{a}}\rangle \psi \) (\({\textsf{B}}\)), \([{{a}}]\psi \rightarrow \langle {{a}}\rangle \psi \) (\({\textsf{D}}\)), \([{{a}}]\psi \rightarrow \psi \) (\({\textsf{T}}\)), \([{{a}}]\psi \rightarrow [{{a}}][{{a}}]\psi \) (\({\textsf{4}}\)), and \(\langle {{a}}\rangle \psi \rightarrow [{{a}}]\langle {{a}}\rangle \psi \) (\({\textsf{5}}\)). Model-theoretically, these additional axioms correspond to properties of the accessibility relation \(R_{{{a}}}\) for the agent \({a}\in A_n\). For the above axioms, the properties are symmetry, seriality, reflexivity, transitivity and Euclideaness, respectively.

In [20] we have presented reductions \(\rho ^{ sml }_{L}(\varphi )\) for logics L that are extensions of the mono-modal logic \({\textsf{K}_{}}\) with these axioms and their combinations. We have shown that a formula \(\varphi \) in simplified negation normal form is L-satisfiable iff the set \(\rho ^{ sml }_{L}(\varphi )\) of clauses in \({\textsf {SNF}_{ml}^{}}\) is satisfiable. In particular, we have shown that given a tree Kripke structure \(M = \langle W,R_{{}},V,w_0 \rangle \) that satisfies \(\rho ^{ sml }_{L}(\varphi )\) we can obtain a Kripke structure \(M^L = \langle W,R^L_{{}},V,w_0 \rangle \) that satisfies \(\varphi \) where \(R^L_{{}}\) is obtained by computing the closure of \(R_{{}}\) corresponding to the additional axioms in L.

Putting these ingredients together gives us the algorithm in Fig. 5 where we are using ordered resolution refinement of MLR together with our model construction algorithm for sets of clauses in \({\textsf {SNF}_{ml}^{++}}\). Here, \(\texttt {simplifiedNNF}\) is a function that computes the simplified negation normal form of a modal formula, \(\texttt {SNF2SNF++}\) is a function that transforms a set of clauses in \({\textsf {SNF}_{ml}^{}}\) into a set of clauses in \({\textsf {SNF}_{ml}^{}}\) using additional renaming steps as described in Sect. 2, \(\texttt {constructOrderSNF++}\) constructs an ordering on the propositional symbols in a set of clauses in \({\textsf {SNF}_{ml}^{++}}\) compliant with the conditions set out in Sect. 2, and \(\texttt {closure}\) is a function that computes the closure of a binary relation R with respect to the relation properties corresponding to the additional axioms in a modal logic L.

Fig. 5.
figure 5

Model Construction for modal logic L

The Kripke structure returned by the algorithm in Fig. 5 is then an L-model of the formula \(\varphi \).

8 Conclusion and Future Work

In this paper we have presented deterministic model construction algorithms for satisfiable sets of modal clauses saturated with respect to three refinements of the modal-layered resolution calculus. These algorithms are meant to complement the provision of refutations for unsatisfiable sets of modal clauses that is a standard byproduct of resolution-based calculi.

In future work we intend to implement these algorithms in the prover and to evaluate their effectiveness. For this it will be necessary to define a format in which Kripke models will be provided. Such a format was presented in [14]. Regarding an evaluation, a challenge will be to find other solvers for basic modal logic that can produce models. While there are range of solvers for basic modal logic available, few output models. As found in [14], even where a solver claims to output models, those might be incomplete. The main cause appears to be the use of simplification during pre-processing and reasoning (pure literal elimination, tautology elimination, simplification to true) that may remove propositional symbols without the produced model then indicating a valuation for these symbols even where that valuation is not arbitrary. This kind of interaction between simplification and model generation is also an issue that we will need to pay close attention to when implementing our algorithms.

A potential improvement of the algorithms is to reuse existing worlds during the model construction. In tableau decision procedures this technique is known as blocking [1, 3, 5, 21, 27]. What complicates its application in our context is that each \({\textsf {SNF}_{ml}^{}}\) clause only holds at a certain modal level instead of universally.