    # Two variable fragment of Term Modal Logic

Term modal logics (TML) are modal logics with unboundedly many modalities, with quantification over modal indices, so that we can have formulas of the form ∃ y. ∀ x. (_x P(x,y) ⊃_y P(y,x)). Like First order modal logic, TML is also "notoriously" undecidable, in the sense that even very simple fragments are undecidable. In this paper, we show the decidability of one interesting decidable fragment, that of two variable TML. This is in contrast to two-variable First order modal logic, which is undecidable.

## Authors

##### This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

## 1 Introduction

Propositional multi-modal logics () are extensively used in many areas of computer science and artifical intelligence ([2, 9]). is built upon propositional logic by adding modal operators and for every index in a fixed finite set which is often interpreted as a set of agents (or reasoners). Typically, the satisfiability problem is decidable for most instances of .

A natural question arises when we wish the set of modalities to be unbounded. This is motivated by a range of applications such as client-server systems, dynamic networks of processes, games with unboundedly many players, etc. In such systems, the number of agents is not fixed a priori. For some cases, the agent set can vary not only across models, but also from state to state (ex. when new clients enter the system or old clients exit the system).

Term Modal logic () introduced by Fitting, Voronkov and Thalmann  addresses this requirement. is built upon first order logic, but the variables now range over modalities: so we can index the modality by terms and these terms can be quantified over. State assertions describe properties of these ‘agents’. Thus we can write formulas of the form: . In  we have advocated , the propositional fragment of , as a suitable logical language for reasoning about systems with unboundedly many agents. has been studied in dynamic epistemic contexts in  and in modelling situations where the identity of agents is not common knowledge among the agents .

The following examples illustrate the flavour of properties that can be expressed in .

• For every agent there is some agent such that holds at all -successors or there is some -successor where holds.

• Every agent of type has a successor where some agent of type exists.
.

• There is some agent such that for all agents if there are no successors then in all successors of , there is a successor.
.

Since contains first order logic, its satisfiability is clearly undecidable. We are then led to ask: can we build term modal logics over decidable fragments of first order logic? Natural candidates are the monadic fragment, the two-variable fragment and the guarded fragment [13, 1].

itself can be seen as a fragment of first order modal logic ()  which is built upon first order logic by adding modal operators. There is a natural translation of into by inductively translating into and into to get an equi-satisfiable formula, where is a new unary predicate. Sadly, this does not help much, since is notorious for undecidability. The modal extension of many simple decidable fragments of first order logic become undecidable. For instance, the monadic fragment or the two variable fragment  of are undecidable. In fact with two variables and a single unary predicate is already undecidable . Analogously, in  we show that the satisfiability problem for is undecidable even when the atoms are restricted to propositions. In the presence of equality (even without propositions), this result can be further strengthened to show ‘Trakhtenbrot’ like theorem of mutual recursive inseparability.

On the other hand, as we show in , the monodic fragment of (the propositional fragment) is decidable (a formula is monodic if each of its modal subformulas of the form or has a restriction that the free variables of is contained in ). Further, via the translation above, we can show that the monodic restriction of based on the guarded fragment of first order logic and monadic first order logic are decidable .

In a different direction, Wang () considered a fragment of in which modalities and quantifiers are bound to each other. In particular he considered the fragment with and showed it to be decidable in PSPACE. In  it is proved that this technique of bundling quantifiers and modalities gives us interesting decidable fragments of , and as a corollary, the bundled fragment of is decidable where quantifiers and modalities always occur in bundled form: and their duals. However, more general bundled fragments of (such as those based on the guarded fragment of first order logic) have been shown to be decidable by Orlandelli and Corsi (), and by Shtakser (). From all these results, it is clear that the one variable fragment of is decidable, and that the three variable fragment of is undecidable.

In this paper, we show that the two variable fragment of () is decidable. This is in contrast with , for which the two variable fragment is undecidable . Quoting Wolter and Zakharyaschev from , where they discuss the root of undecidability of fragments:

All undecidability proofs of modal predicate logics exploit formulas of the form in which the necessity operator applies to subformulas of more than one free variable; in fact, such formulas play an essential role in the reduction of undecidable problems to those fragments

Note that this is not expressible in where there is no ‘free’ modality; every modality is bound an index ( or ). With a third variable , we could indeed encode as , but we do not have it. The decidability of the two variable fragment of , without constants or equality, hinges crucially on this lack of expressiveness. Thus, provides a decidable fragment of . From view point, Gradel and Otto show that most of the natural extensions of (like transitive closure, lfp) are undecidable except for the counting quantifiers. In this sense, -variable can be seen as another rare extension of that still remains decidable. Note that in this paper we consider the two variable fragment of without the bundling or guarded or monodic restriction. Also, there is no natural translation of two variable to any known decidable fragment of such as the two variable fragment of with equivalence relations etc (cf ).

Thus, the contribution of this paper is technical, mainly in the identification of a decidable fragment of . As is standard with two variable logics, we first introduce a normal form which is a combination of Fine’s normal form for modal logics () and the Scott normal form () for . We then prove a bounded agent property using an argument that can be construed as modal depth induction over the ‘classical’ bounded model construction for .

## 2 TML syntax and semantics

We consider relational vocabulary with no constants or function symbols, and without equality.

[ syntax] Given a countable set of variables Var and a countable set of predicate symbols , the syntax of is defined as follows:

 φ::=P(¯¯¯x)∣¬φ∣(φ∧φ)∣(φ∨φ)∣∃x φ∣∀x φ∣□xφ∣◊xφ

where ,

is a vector of length

over and of arity .

The free and bound occurrences of variables are defined as in with . We write if all the free variables in are included in . Given a formula and , if then we write for the formula obtained by replacing every occurrence of by in . A formula is called a sentence if . The notion of modal depth of a formula (denoted by ) is also standard, which is simply the maximum number of nested modalities occurring in . The length of a formula is denoted by and is simply the number of symbols occurring in .

In the semantics, the number of accessibility relations is not fixed, but specified along with the structure. Thus the Kripke frame for is given by where is a set of worlds, is the potential set of agents and . The agent dynamics is captured by a function ( below) that specifies, at any world , the set of agents live (or meaningful) at . The condition that whenever , we have that ensures only an agent alive at can consider accessible.

A monotonicity condition is imposed on the accessibility relation as well: whenever , we have that . This is required to handle interpretations of free variables (cf [3, 6, 5]). Hence the models are called ‘increasing agent’ models.

[ structure] An increasing agent model for is defined as the tuple where is a non-empty countable set of worlds, is a non-empty countable set of agents, and . The map assigns to each a non-empty local domain such that whenever we have and is the valuation function where for all of arity we have .

For a given model , we use to refer to the corresponding components. We drop the superscript when is clear from the context. We often write for . A constant agent model is one where for all . To interpret free variables, we need a variable assignment . Call relevant at if for all . The increasing agent condition ensures that if is relevant at and then is relevant at as well. In a constant agent model, every assignment is relevant at all the worlds.

[ semantics] Given a structure and a formula , for all and relevant at , define inductively as follows:

where denotes another assignment that is the same as except for mapping to .

The semantics for and are defined analogously. Note that is inductively defined only when is relevant at . We often abuse notation and say ‘for all and for all interpretations ’, when we mean ‘for all and for all interpretations relevant at ’ (and we will ensure that relevant are used in proofs). In general, when considering the truth of in a model, it suffices to consider , assignment restricted to the variables occurring free in . When and is a vector of length over , we write to denote where for all . When is a sentence, we simply write . A formula is valid, if is true in all models at all for all interpretations (relevant at ). A formula is satisfiable if is not valid.

Now we take up the satisfiability problem which is the central theme of this paper. First we observe that the satisfiability problem is equally hard for constant and increasing agent models for .

First we prove that the satisfiability problem over constant agent structures and increasing agent structures is equally hard for most fragments. To see why this is true, if a formula is satisfiable in some increasing agent model, then we can turn the model into constant agent model as follows. We introduce a new unary predicate and ensure that is true at if is a member of in the given increasing agent model. But now, all quantifications have to be relativized with respect to the new predicate . This translation is similar in approach to the one for . The syntactic translation is defined as follows:

Let be any formula and let be a new unary predicate not occurring in . The translation is defined inductively as follows:

• and

With this translation, we also need to ensure that the predicate respects monotonicity. Hence we have . Now, we can prove that is satisfiable in an increasing model iff is satisfiable in a constant agent model. Moreover, both the formulas are satisfiable over the same agent set .

Let be any formula. is satisfiable in an increasing agent model with agent set iff is satisfiable in a constant agent model with agent set .

###### Proof.

Suppose is an increasing agent model with such that . Define the constant domain model where for all and is the same as for all predicates except and for all and we have iff .

Since is monotone, . Note that iff and we have iff . Thus, we can set up a routine induction and prove that for all subformulas of and for all and for all interpretation relevant at , we have iff . Hence, .

Suppose is a tree model of depth at most with such that . Define the increasing agent model where iff .

Note that defined above is monotone since . Again, we can set up a routine induction and prove that for all subformulas of and for all and for all interpretation relevant at we have iff .

The propositional term modal logic is a fragment of where the atoms are restricted to propositions. Note that the variables still appear as index of modalities. For , the valuation function can be simply written as where is the set of propositions. Now we prove that the satisfiability problem for is as hard as that for . The reduction is based on the translation of an arbitrary atomic predicate to where is a new proposition which represents the predicate . However, this cannot be used always111for instance, this translation will not work for the formula . Thus, we use a new proposition , to distinguish the ‘real worlds’ from the ones that are added because of the translation. But now, the modal formulas have to be relativized with respect to the proposition . The formal translation is given as follows:

Let be any formula where are the predicates that occur in . Let be a new set of propositions not occurring in . The translation with respect to is defined inductively as follows:

• and

For any formula , we have is satisfiable in an increasing (constant) agent model with agent set iff is satisfiable in an increasing (constant) agent model with agent set .

###### Proof.

Let be the set of all predicates occurring in and be the maximum arity among the predicates in . For any model and let denote a (possibly empty) string of finite length over .

Suppose the formula is satisfiable. Let be a model and such that . Define the model where:

• and of length at most .

• For all we have .

• is a proposition in and and
.

Note that iff and for all we have . Thus a standard inductive argument shows that for all subformulas of and for all and for all interpretation we have iff .

Also note that if is an increasing (constant) agent model over then is also an increasing (constant) agent model over .

Suppose such that . Define where

• .

• For all we have .

• .

• and
iff .

Note that for all we have iff . Also, since we have . Again, an inductive argument shows that for all subformulas of and for all and for all interpretation relevant at , we have iff . Thus we have .

To complete the proof, again note that if is an increasing (constant) agent model over then is also an increasing(constant) agent model over . ∎

## 3 Two variable fragment

Note that all the examples discussed in the introduction section use only 2 variables. Thus, can express interesting properties even when restricted to two variables. We now consider the satisfiability problem of . The translation in Def. 2 preserves the number of variables. Therefore it suffices to consider the satisfiability problem for the two variable fragment of .

Let denote the two variable fragment of . We first consider a normal form for the logic. In , Fine introduces a normal form for propositional modal logics which is a disjunctive normal form () with every clause of the form where are literals and are again in the normal form. For , we have Scott normal form  where every sentence has an equi-satisfiable formula of the form where and are all quantifier free. For , we introduce a combination of these two normal forms, which we call the Fine Scott Normal form given by a , where every clause is of the form:

 ⋀i≤asi∧⋀z∈{x,y}(□zα∧⋀j≤mz◊zβj) ∧ ⋀z∈{x,y}(∀z γ∧⋀k≤nz∃z δk) ∧ ∀x∀y φ∧⋀l≤b∀x∃y ψl

where and denotes literals. Further, are recursively in the normal form and do not have quantifiers at the outermost level and all modal subformulas occurring in these formulas are (recursively) in the normal form. The normal form is formally defined in the next subsection.

Note that the first two conjuncts mimic the modal normal form and the last two conjuncts mimic the normal form. The additional conjuncts handle the intermediate step where only one of the variable is quantified and the other is free.

We now formally define the normal form and prove that every formula has a corresponding equi-satisfiable formula in the normal form. After this we prove the bounded agent property for formulas in the normal form using an inductive type model construction.

### 3.1 Normal form

We use as the two variables of . We use to refer to either or and refer to variables to indicate the variables in either order. We use to denote any modal operator and . A literal is either a proposition or its negation. Also, we assume that the formulas are given in negation normal form(NNF) where the negations are pushed in to the literals.

[FSNF normal form] We define the following terms to introduce the Fine Scott normal form (FSNF) for :

• A formula is a module if is a literal or is of the form .

• For any formula , the outer most components of given by is defined inductively where for any which is a module, and where and . Finally where .

• A formula is quantifier-safe if every is a module.

• We define (FSNF) normal form ( and conjunctions) inductively as follows:

• Any conjunction of literals is an FSNF conjunction.

• is said to be in if is a disjunction where every clause is an FSNF conjunction.

• Suppose is quantifier-safe and for every if is in normal form then we call a normal formula.

• Let .
Suppose are literals, are formulas in and are normal formulas then:

 ⋀i≤asi∧⋀z∈{x,y}(□zαz∧⋀j≤mz◊zβzj) ∧ ⋀z1∈{x,y}(∀z2 γz1 ∧⋀k≤nz∃z2 δz1k) ∧ ∀x∀y φ∧⋀l≤b∀x∃y ψl

is an FSNF conjunction.

Quantifier-safe formulas are those in which no quantifiers occur outside the scope of modalities. Note that the superscripts in etc only indicate which variable the formula is associated with, so that it simplifies the notation. For instance, does not say anything about the free variables in . In fact there is no restriction on free variables in any of these formulas.

Further, note that by setting the appropriate indices to , we can have FSNF conjunctions where one or more of the components corresponding to are absent. We also consider the conjunctions where one or more of the components corresponding to are also absent. As we will see in the next lemma, for any sentence , we can obtain an equi-satisfiable sentence, which at the outer most level, is a where every clause is of the form .

For every formula there is a corresponding formula in such that and are equi-satisfiable.

###### Proof.

We prove this by induction on the modal depth of . Suppose has modal depth , then all modules occurring in are literals. Observe that if is a propositional formula then for and and for all model we have iff . Hence we can simply ignore all the quantifiers and get an equivalent over literals, which is an .

For the induction step, suppose . First observe that we can get an equivalent formula for (say ) over using propositional validities. Now if is an then we are done. Otherwise, there are some clauses in that are not FSNF clause. Let and is not a FSNF clause be the clauses that are not FSNF conjunctions. To reduce in to , we replace every with their corresponding equi-satisfiable in .

Pick a clause and let that is not an FSNF conjunction. If then by induction hypothesis, there is an equi-satisfiable formula of . Thus can be replaced by its corresponding equi-satisfiable in . Now suppose . Call each as a conjunct.

In the first step, consider the conjuncts with exactly free variable. Let for be the index of all conjuncts where is the only free variable. Let be the variables in either order. Pick any which means is bounded in . Hence, without loss of generality, is of the form . We will first ensure that is quantifier-safe. This is done by iteratively removing the non-modules from and replacing it with a equi-satisfiable quantifier-safe formula. Set .

1. if there is some strict subformula of the form where is quantifier-safe, let be a new (intermediate) unary predicate. Define and . Note that if then can be equivalently written as and if then will be .

2. if there is some strict subformula of the form where is quantifier-safe, let be a new unary predicate. Define and . Again, that if then is equivalent to and if then is .

Now remove the conjunct from and replace it with . Note that has at least one less quantifier than and introduces either conjuncts with no free variables or a formula with one free variable of the form where is quantifier-safe. To see that this step preserves equi-satisfiability, note that in both cases, implies and for the other direction, we can define the valuation for the new unary predicate appropriately in the given model in which is satisfiable.

Repeat this step for till is of the form where is quantifier-safe. Then we would have as new conjuncts replacing in . Now this step increases the number of conjuncts in which have no free variables, but all new conjuncts with one free variable is of the form where is quantifier-safe (it needs to be further refined since it is not yet ).

Repeat this step for all for . Let the resulting clause be which is equi-satisfiable to . Now for , if there are two conjuncts of the form and in , remove both of them from and add to . Repeat this till there a single conjunct in of the form for each where is quantifier-safe. Note that there are some new unary predicates introduced and hence this intermediate formula is not in (but is in ).

Let which is the result of rewriting of the clause after the above steps. Now consider conjuncts with no free variables and make them quantifier-safe. Let . For any , since neither variable is free, without loss of generality assume that is of the form .

Pick any and set and refer to in either order. If , let be a new unary predicate. Define and ). Similar to previous step, can be equivalently written as two conjuncts of the form where and are quantifier-safe formulas (but not , yet).

Now remove the conjunct from and replace it with . Note that has at least one less quantifier than and introduces only conjuncts of the form where is quantifier-safe. Again for the equi-satisfiability argument, note that is a validity and for the other direction, the new predicates can be interpreted appropriately in the same model of .

Repeat this step for till is of the form where is quantifier-safe. Then we would have as new conjuncts replacing . Now rename the variables appropriately in the newly introduced conjuncts so that we have formulas only of the form or where are quantifier-safe formulas.

Repeat this step for all . Let the resulting conjunct be which is equi-satisfiable to . Now if there are two conjuncts of the form and in , remove both of them and add a new conjunct to . Repeat this till at most one conjunct the form in . Note that we still have unary predicates in and hence is also a formula but not a formula. Further, all subformulas inside the scope of quantifiers are now quantifier-safe, but needs to be converted into .

Let be the resulting formula after the above steps. Now to eliminate the newly introduced unary predicates, apply the translation in definition 2 to and obtain an equi-satisfiable formula . It is clear from the construction that the new predicates are introduced only at the outermost level (not inside the scope of any modality). Thus, in the translation occurrence of the newly introduced predicate of the form will be replaced by and will be translated to which can be equivalently written as .

Now consider conjuncts that are modal formulas. For , if there are two conjuncts of the form and in , remove both of them from and add to . Repeat this till there at most one conjunct in of the form for each . Note that this step preserves equi-satisfiability because of the validity .

By rearranging the conjuncts, we obtain the formula in the form:

 ⋀i≤asi∧⋀z∈{x,y}(□zαz∧⋀j≤mz◊zβzj) ∧ ⋀z∈{x,y}(∀z γz∧⋀k≤nz∃z δzk) ∧ ∀x∀y φ∧⋀l≤b∀x∃y ψl

where and are quantifier-safe.

As a final step, we need to ensure that are formulas in and are not just quantifier-safe, but also formulas.

Note have modal depth less than . Hence, inductively we have equi-satisfiable which each of them can be correspondingly replaced in . This preserves equi-satisfiability since we can inductive maintain that the translated formulas are satisfied in the same model of the given formula by just by tweaking the function.

To translate the formulas into , first note that these formulas are already quantifier-safe. Now for every for is one of the above formulas, we have . Again, inductively we have equi-satisfiable FSNF formulas for each of them. Replacing each such subformula with their corresponding