125
Intervals: logics, algorithms and games Nicola Vitacolonna

Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

Intervals: logics, algorithms and games

Nicola Vitacolonna

Page 2: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain
Page 3: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

Abstract

The intuitive picture of an “interval” identifies the word with some kind of object thathas an extension along some dimension and is bounded by endpoints. In this sense,intervals are the natural counterpart of “points”, which are dimensionless objects. Asimple relation of precedence can be defined between points, to compare them eithertemporally or spatially. Intervals, however, relate in more complex ways: they mayhave subintervals, they may overlap, precede one another, and so on. Such richnessentails both a greater expressivity and a higher complexity of interval languages andstructures than point-based formalisms. In this dissertation, the notion of interval isinvestigated in a few different contexts: relational models are analyzed and compared;split logics of intervals are proposed and they are shown to be decidable; algorithms tosolve special constraint problems are proved correct and their complexity is establishedusing interval reasoning; finally, intervals as substrings in words are used to give acharacterization of the winning strategies for the players, Spoiler and Duplicator, in akind of Ehrenfeucht game with the successor relation. We argue that intervals helpsimplify formal reasoning and the algorithmic solutions of the considered problems.

L’idea intuitiva di “intervallo” identifica tale termine con qualche tipo di oggettoche abbia un’estensione lungo qualche dimensione e che sia delimitato da estremità.In questo senso, gli intervalli costituiscono una controparte naturale dei “punti”, chesono oggetti per definizione privi di dimensione. Per confrontare punti tra loro, tempo-ralmente o spazialmente, si può semplicemente definire una relazione di precedenza.Le relazioni tra intervalli, invece, sono piú complesse: un intervallo può conteneresottointervalli, due intervalli possono sovrapporsi, uno dei due può precedere l’altro,e cosí via. Tale abbondanza di relazioni ha come conseguenza che le strutture ei linguaggi basati su intervalli hanno, in generale, una maggiore espressività e unamaggiore complessità rispetto ai formalismi basati su punti. In questa tesi, la nozionedi intervallo è studiata all’interno di diversi contesti: sono analizzati e confrontati traloro modelli relazionali per gli intervalli; viene proposta una classe di logiche a inter-valli, chiamate split logics, di cui si dimostra la decidibilità; usando metodi basati sulragionamento intervallare, la correttezza di algoritmi per la risoluzione di particolarisistemi di vincoli viene dimostrata, e ne viene calcolata la complessità computaziona-le; infine, intervalli associati a sottostringhe sono usati per dare una caratterizzazionedelle strategie vincenti per i due giocatori, Spoiler e Duplicator, di un tipo di gioco

Page 4: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

di Ehrenfeucht con la relazione di successore su parole. Gli intervalli semplificano ilragionamento formale e le soluzioni algoritmiche dei problemi considerati.

Page 5: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

Contents

Introduction iii

1 Preliminaries 11.1 Vocabularies, structures and languages . . . . . . . . . . . . . . . . . . 1

2 Intervals 52.1 Modeling time—and more—by intervals . . . . . . . . . . . . . . . . . 5

2.1.1 Intervals as sets . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.1.2 Intervals as pairs . . . . . . . . . . . . . . . . . . . . . . . . . . 10

2.2 Interval relations over linear orderings . . . . . . . . . . . . . . . . . . 102.3 Allen and Hayes’s axioms . . . . . . . . . . . . . . . . . . . . . . . . . 132.4 van Benthem’s axioms . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

2.4.1 Period and interval structures . . . . . . . . . . . . . . . . . . . 172.4.2 Characterizations of interval structures over linear orderings . . 18

3 Split logics of intervals 253.1 Interval logics are undecidable . . . . . . . . . . . . . . . . . . . . . . . 253.2 Layered structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

3.2.1 Bounded layered structures . . . . . . . . . . . . . . . . . . . . 263.2.2 Downward unbounded layered structures . . . . . . . . . . . . 283.2.3 Upward unbounded layered structures . . . . . . . . . . . . . . 293.2.4 Monadic theories over layered structures . . . . . . . . . . . . . 30

3.3 Split structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333.4 Split Logics: Syntax and Semantics . . . . . . . . . . . . . . . . . . . . 36

3.4.1 Interdefinability of modalities . . . . . . . . . . . . . . . . . . . 373.5 Decidability of split logics . . . . . . . . . . . . . . . . . . . . . . . . . 393.6 The classical fragment of SL . . . . . . . . . . . . . . . . . . . . . . . . 423.7 On Decidable Extensions of SL . . . . . . . . . . . . . . . . . . . . . . 443.8 On the semantics of split logics . . . . . . . . . . . . . . . . . . . . . . 453.9 Applications of split logics . . . . . . . . . . . . . . . . . . . . . . . . . 48

4 Layered interval graphs of constraints 494.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494.2 A simplified algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . 504.3 Finding structured motifs . . . . . . . . . . . . . . . . . . . . . . . . . 54

4.3.1 The application context . . . . . . . . . . . . . . . . . . . . . . 544.3.2 Related work . . . . . . . . . . . . . . . . . . . . . . . . . . . . 564.3.3 Basic definitions . . . . . . . . . . . . . . . . . . . . . . . . . . 56

Page 6: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

ii Contents

4.3.4 Searching for simple motifs . . . . . . . . . . . . . . . . . . . . 584.3.5 Building the constraint graph . . . . . . . . . . . . . . . . . . . 594.3.6 Properties of the constraint graph . . . . . . . . . . . . . . . . 614.3.7 How to output all the solutions . . . . . . . . . . . . . . . . . . 644.3.8 Experimental results . . . . . . . . . . . . . . . . . . . . . . . . 69

4.4 Extending the algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . 72

5 Intervals and games on words 755.1 Basic definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76

5.1.1 Distance in structures . . . . . . . . . . . . . . . . . . . . . . . 775.2 Algebraic characterization . . . . . . . . . . . . . . . . . . . . . . . . . 78

5.2.1 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 795.3 Game-theoretic characterization . . . . . . . . . . . . . . . . . . . . . . 805.4 Logical characterization . . . . . . . . . . . . . . . . . . . . . . . . . . 815.5 Structural characterizations . . . . . . . . . . . . . . . . . . . . . . . . 835.6 Review of literature . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88

5.6.1 Hanf’s theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . 885.6.2 Arora and Fagin’s condition . . . . . . . . . . . . . . . . . . . . 905.6.3 Schwentick’s extension theorem . . . . . . . . . . . . . . . . . . 925.6.4 Shrinking games . . . . . . . . . . . . . . . . . . . . . . . . . . 94

5.7 Characterization of labeled sets with successor . . . . . . . . . . . . . 975.7.1 Successor structures . . . . . . . . . . . . . . . . . . . . . . . . 975.7.2 Labeled s-structures . . . . . . . . . . . . . . . . . . . . . . . . 102

Conclusions 107

Bibliography 109

Page 7: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

Introduction

The key claim of this dissertation is that several fields of theoretical and practicalcomputer science may benefit from the use of intervals as a formal tool for reasoning,and to reason about.

The prime example is temporal logic. Temporal formalisms have been devotedmuch attention by computer scientists since they were proved useful for specifyingand verifying the correctness of programs, especially for non-terminating or reactivesystems [52]. In this context, time is modeled as a linear, and often discrete, sequenceof points, each one representing an instantaneous “snapshot” of a system; an alterna-tive point of view reflects the possible behaviors of the system into a branching timestructure, where each path starting at a given point p is a possible evolution from thestate represented by p. Linear Time Temporal Logic (LTTL) and Computational TreeLogic (CTL) are modal logics corresponding to such models of time: they have beenthoroughly investigated by logicians and computer scientists (see [19] for a survey).

Point-based formal systems certainly play a prominent role in computer science,but they are not the end of the story. It has been argued that, in many contexts, timeintervals provide more adequate, compact and intuitive descriptions of the portion ofreality under consideration.

In [47] and [30], temporal intervals are proposed as the basis of a fairly naturallogical system for the specification of hardware components and programs. The pro-posed logic, called Interval Temporal Logic (ITL), is an extension of LTTL, obtainedby evaluating formulas over sequences of states (i.e., intervals) rather than at singlestates. The underlying idea is that the behavior of hardware devices and programscan often be decomposed into successively smaller periods of activity, and ITL pro-vides a convenient framework for introducing quantitative timing details to analyzesuch behavior.

In [3] time points and time intervals as basic ontologies for talking about eventsare compared, and the result is definitely in favor of the latter approach. The keyconcept is that events have a duration, and “durationless” points cannot deal verywell with such notion. Knowledge representation by means of intervals supportsvariations of the grain of reasoning (a topic that we will discuss in Chapter 3) andrelative imprecision when managing temporal information (e.g., an event may endbefore another, but the exact relationship between the two may not be known). Amodel of time based on points does not match the way we perceive events.

In [58] a detailed and balanced analysis of point based and period based structuresis made, which emphasizes the remarkable tendency of time periods to make severalphilosophical and logical paradoxes fade out: for example, Zeno’s flying arrow (“if ateach instant the arrow stands still, how is movement possible?”) and the dividinginstant dilemma (“if the light is on and it is turned off, what is its state at the instant

Page 8: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

iv Introduction

between the two events?”), under the point of view of intervals, do not exhibit theirapparent strength. The many properties of period structures that are discussed in [58]are reviewed in Chapter 2.

The need for temporal knowledge representation arises in fields other than logic:artificial intelligence, automatic planning, databases, and computational linguistics—to mention a few. Any system where dynamic information and change have to bemanaged is liable to some form of temporal analysis. Such a variety calls for (some-times radically) different concepts of time. It is sensible, then, to consider formalismsbased on intervals as a feasible approach (combined with, or alternative to, point-based and event-based methods).

Moreover, intervals are relevant in contexts different from the temporal one: forinstance, space reasoning and topology. In Chapter 4, a constraint satisfaction prob-lem is solved by constructing a special type of graph whose form induces a notion ofinterval in a natural way: the analysis of the possible relations between such intervalshelp us develop an efficient solution to the problem and to prove its correctness.

Interval structures arise naturally in formal languages: if a finite or infinite wordis identified with the timeline, then (occurrences of) subtrings can be interpreted asintervals, subwords as unions of intervals, and so on: the subinterval relation cor-responds in an obvious way to the substring (or subword) relation, and precedencebetween intervals can be defined straightforwardly. An example of this kind is devel-oped in relation with Ehrenfeucht-Fraïssé games in Chapter 5.

Such a diversified nature of intervals requires some thought in order to graspthe basic properties we intuitively attribute to them. But it also justifies the claimthat intervals can provide a unifying framework for reasoning in seemingly differentsituations. In this thesis, we maintain that intervals are interesting and useful aslogical formalisms (Chapter 3), as reasoning tools in the development of algorithms(Chapter 4) and in the study of logical combinatorial games played on word structures(Chapter 5).

Reasoning about intervals

So, what is an interval? The intuitive picture may identify it with “what there is be-tween two endpoints”. This presupposes an underlying structure of partially orderedobjects. This is our starting point. In Chapter 2 we review what has been done in theliterature to characterize such notion. We define three concepts, in decreasing orderwith respect to their generality. First, a time period can be thought of as a “set offragments of time”, in a very general sense: it may be unbounded and it may have“holes” (i.e., it does not need to be convex). A period is simply defined as a subsetof points over a partial ordering. Second, a set-interval corresponds to the familiarnotion of a bounded and convex set of points delimited by two endpoints. Third, aninterval is an ordered pair of points: this is an abstraction usually made when study-ing logical formalisms, which has the advantage of avoiding the problem to determinewhether the endpoints belong to the interval. Accordingly, we define period structuresas relational structures based on periods or set-intervals, and interval structures as

Page 9: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

Introduction v

relational structures based on intervals. The two definitions are strictly related: everyinterval structure is a convex period structure. The converse does not hold, however.At the end of Chapter 2 we prove that, for a large class of structures, an equivalencecan be established (see Theorem 2.4.9).

Many subtleties are involved in the definition of intervals over a partial ordering,and not all partial orderings are good candidates, so further constraints are usuallyimposed. A minimal requirement, commonly found in the literature, is that set-intervals be linearly ordered sets of points. Nonetheless, such constraint alone is notsufficient, in general, to obtain “well-behaved” period structures: the underlying pointstructure must also be Dedekind-complete (that is, every ascending sequence of pointswith an upper bound must have a least upper bound). Dense and discrete trees arethe most prominent examples. To our knowledge, no modal theory of intervals overbranching flows of time has been developed so far.

Logics over linear time have been widely investigated. We briefly discuss Allen’sfirst-order theory of intervals ([4], [5]), and van Benthem’s axioms ([58]). Allen’s the-ory has a single primitive relation meets, which intuitively holds between two intervalswhen the first entirely precedes the second, and there is no interval in between. In [39]it has been proved that Allen’s axioms capture exactly the class of canonical intervalstructures1 (see Definition 2.4.4) over unbounded linear orderings.

van Benthem’s axioms are based on the two primitive notions of subinterval andprecedence. Our definition of a period structure is based on the same relations (infact, it is van Benthem’s original definition). Our main contribution in Chapter 2 is aresult that characterizes the period structures corresponding to an interval structureover an unbounded linear ordering. Such theory is weaker than Allen’s, because non-canonical models are allowed. Intuitively, a model is canonical if its domain contains“all” the intervals: non-canonical models contain only a subset of all the intervals.An example of non-canonical model is provided in Chapter 3, where split structuresare introduced.

It is worth noting that the first-order theory of (open) rational intervals has beenaxiomatized and proved to be countably categorical—hence decidable—both by vanBenthem ([58]) and Ladkin ([39]). This result is in sharp contrast to what happensin the realm of modal logics of intervals (interval logics, from now on).

Interval logics have been proposed in [47], [31], [59] and [11]. A common feature ofthese proposals is that they are much richer than point-based ones: this is due to thegreat number of relations that can be defined over intervals (see Section 2.2), each ofwhich can be associated to a temporal modality. On the positive side, interval logicsare very expressive; but, they also tend to be highly complex (in many cases not evenaxiomatizable). As a result, the decidability of the satisfiability or validity problemis one of the most important issues in the field of interval logics. Decidable fragmentshave been obtained by imposing severe restrictions on their expressive power, e.g. thelocality constraint in propositional ITL.

In Chapter 3 we face the problem of the decidability of interval logics by interpret-

1To be precise, it captures the class of canonical interval structures expanded with the meetsrelation. Such relation, however, is definable over linear orderings.

Page 10: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

vi Introduction

ing standard interval operators over non-canonical models called split frames. Thedistinctive feature of a split frame is that there are no properly overlapping intervals:either one interval is before another, or one interval is entirely contained into another.As a consequence, there is at most one way to divide an interval into two consecutivesubintervals.

In [44], a link between structures and theories of time granularity and those devel-oped for representing and reasoning about time intervals is suggested. Split structurescan be put in correspondence with bounded and unbounded layered structures (Sec-tion 3.2), as developed in [44]. In particular, bounded split frames can be mapped inton-layered structures, the discrete split frame is associated to the upward unboundedlayered structure, and the dense split frame corresponds to the downward unboundedlayered structure. After having defined the relevant structures (Section 3.3), we provethat split frames are indeed period structures.

The following standard interval operators are interpreted over split frames: theunary modalities 〈P〉 (sometimes over a past interval), 〈F〉 (sometimes over a futureinterval), 〈D〉 (over some subinterval), 〈D〉 (over some superinterval) (see [31]), andthe binary modalities C, D and T (see [59]). A formula φ C ψ holds if it is possible tochop the current interval into two consecutive subintervals i and j such that φ holdsat i and ψ holds at j. In a split frame, if this is possible, there is a unique way to doit. The other two modalities are the “converses” of this relation.

It is known from [59] that C, D and T are strong enough to allow one to define theunary modalities (and, actually, any binary relation between intervals over a linearordering). This is not the case, however, when they are interpreted over split frames.On the other hand, C, D and T cannot be defined in terms of the unary modalities.These undefinability results are proved in Section 3.4.1.

The decidability of the logic of split structures is proved by establishing a corre-spondence with the monadic second-order theories of time granularity, as developedin [44]. Such theories are (non-elementarily) decidable. A characterization of theclassical fragment (in the language of the theories for time granularity) correspondingto the split logic is given in Section 3.6. In Section 4.4, we extend split logic with theintervals operators 〈A〉 (in some consecutive interval), 〈B〉 (in some beginning subin-terval) and 〈E〉 (in some ending subinterval), and prove, using the same technique,that they are decidable extensions.

One concern with split logics has to do with their semantics. Split logics are de-cidable, without any further constraint principle, such as locality or homogeneity. Allthe same, the universe of discourse is not the canonical one. We investigate in Sec-tion 3.8 how the semantics of the modalities is affected when passing from a canonicaldomain to a subdomain. The validity of formulas is not preserved in most cases,and this is not surprising because interval logics (over canonical structures) are oftenundecidable. A question we leave open is the following one: Is there an interestingsubclass of formulas whose validity is invariant when passing from canonical modelsto split models, and/or vice versa?

We end the chapter by sketching some applications of split logics in the field ofcomputational linguistics.

Page 11: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

Introduction vii

Intervals for reasoningIn the second part of the thesis, we discuss two applications in which intervals arenot investigated, but used.

In Chapter 4, a constraint satisfaction problem over finite domains is efficientlysolved by an algorithm manipulating a particular kind of graph. The problem has apractical motivation in the field of computational biology. A relevant task of compu-tational biology consists in identifying conserved features in a set of DNA or proteinsequences. A particular problem is the localization of structured motifs, which can bethought of as “compound patterns” made of a list of simple motifs (that is, patterns)and a list of intervals that specify at what distances adjacent motifs should occur [12]:

P1[l1, u1]P2[l2, u2]P3 · · ·Pk−1[lk−1, uk−1]Pk.

The algorithm we describe in Chapter 4 combines standard pattern matchingprocedures with a constraint satisfaction solver whose peculiar form allows us torepresent the (potentially) exponentially many solutions as a graph in an efficientway. The features of our algorithm include flexibility (any exact or approximatepattern/regular expression matching algorithm or alignment procedure can be used tosearch for simple motifs), the ability of searching for partial occurrences of a structuredmodel (i.e., the ones for which a limited number of component patterns is missing) andnegative gaps (which imply potential overlap of component patterns). As a byproduct,we obtain a data structure that can be used to store all relevant information aboutthe occurrences of a structured model in a sequence.

The possibility to produce the solution set in compact form is based on a view ofthe occurrences of a given motif as an interval of positions in the searched string. Anumber of simple results follow from this view and allow the design of fast manipula-tion procedures. Moreover, the compactness of the data structure and the size of theoutput can be reduced to linear, based on the above mentioned interval representation.

In Chapter 5, we study Ehrenfeucht-Fraïssé games (EF-games) played over rela-tional structures with the successor relation and unary predicates. These structuresare interesting because they correspond in an obvious way to words over a fixedalphabet.

The main feature we stress in Chapter 5 is the comparison power of EF-games.EF-games are used to tell whether two structures can be distinguished or not (by alogic), and also provide information on “how much” they differ. So, they are widelyrecognized as a handy tool to measure the expressive power of a logic. We argue thatthis feature may also be useful in contexts where the degree of similarity of structuresis relevant, such as comparison of spatial scenes (see [1]) or comparison of biologicalsequences. EF-games in such cases provide a mathematically precise, yet flexible, wayto define what similarity is. Besides, they bring in logical languages that can formallydescribe how the structures look alike. So, instead of using games to study propertiesof a logic, we tailor our approach towards a use of games for the study of propertiesof structures.

Page 12: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

viii Introduction

In order to use games this way structural characterizations of playgrounds areneeded. The existence of a winning strategy for Duplicator implies that the structuresinvolved must share common features, and vice versa. Moreover, the ability to exhibita winning strategy in an effective way can lead to further insight into the similaritiesand discrepancies of the two structures.

It turns out to be difficult to give such characterizations. In Section 5.6 we reviewseveral sufficient winning conditions for Duplicator, which have been proposed in theliterature. Our goal is to give a structural characterization of the winning strategiesfor Duplicator and Spoiler in a game over words with successor: such a goal is attained(Section 5.7) by analyzing the distribution of reachable intervals (which correspondto occurrences of substrings of exponential length) modulo a generalized form ofoverlapping. Reachable intervals can be partitioned according to their “degree ofoverlapping”, and a winning strategy for one of the players can be established basedon the multiplicities of equivalent intervals.

Page 13: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

1Preliminaries

Given a set A, the cardinality of A is denoted by |A|. A relation R of arity n ∈ Non A is a subset of An. A relation is binary (resp., ternary) if its arity is 2 (resp., 3).Given A′ ⊆ A, the restriction of R to A′ is the relation R′ = R ∩ (A′ ×A′).

Definition 1.0.1. Given a binary relation R on a set A, the transitive closure R+

of R is the smallest transitive relation R′ on A such that R ⊆ R′.

Definition 1.0.2. A binary relation R on a set A is

• reflexive, if (a, a) ∈ R, for every a ∈ A;

• irreflexive, if (a, a) 6∈ R, for every a ∈ A;

• symmetric, when (a, b) ∈ R is and only if (b, a) ∈ R, for every a, b ∈ A;

• antisymmetric, if (a, b), (b, a) ∈ R implies a = b, for every a, b ∈ A;

• transitive, if (a, b), (b, c) ∈ R implies (a, c) ∈ R, for every a, b, c ∈ A.

• acyclic, if (a, a) 6∈ R+, for every a ∈ A.

Given a, b ∈ A such that (a, b) ∈ R, we say that a is an R-predecessor of b, and b isan R-successor of a.

Given an n-ary relation R, we write R(a1, . . . , an) if (a1, . . . , an) ∈ R. For binaryrelations, we will often use infix notation, i.e. we write a R b instead of R(a, b).

1.1 Vocabularies, structures and languages

Definition 1.1.1. A vocabulary τ is a pair (O, ρ) where O = {4i}i∈I⊆N is aset of symbols and ρ : O → N is a function assigning to each symbol a naturalnumber, called arity. For convenience, we will sometimes denote a vocabulary by{(40, n0), . . . , (4i, ni), . . .}, or even with {40, . . . ,4i, . . .} when arities are not rele-vant or they can be inferred from the context.

Page 14: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

2 1. Preliminaries

A vocabulary is used to specify relational, functional and constant symbols inclassical languages, or modal operators in modal and temporal languages. For in-stance, the vocabulary of linear orderings (see Definition 1.1.5) is {(<, 2)}, and thevocabulary of standard temporal logic is {(F, 1), (P, 1)}. Throughout this thesis, wewill only consider finite relational vocabularies, that is vocabularies with a finite setof symbols that are interpreted as relations.

Definition 1.1.2. Given a vocabulary τ = ((R1, n1), . . . , (Rk, nk)), a τ -structure A =(A,RA

1 , . . . , RAk ) is a tuple where A is a nonempty set called the domain of A,

and each RAi is an ni-ary relation, for 1 ≤ i ≤ k. We denote with (A, c) =

(A,RA1 , . . . , R

Ak , c

A1 , . . . , c

Al ) a relational structure A extended with distinguished el-

ements c = cA1 , . . . , cAl , where cAj ∈ A, for 1 ≤ j ≤ l.

We tacitly assume that all the vocabularies we will consider contain a binaryrelation symbol = interpreted as equality. We adopt the convention to denote thedomain of a structure with the corresponding roman capital letter, e.g. A for A,B for B, and so on. We will often use the same symbol for relational symbols (resp.,constant symbols) and relations (resp., constants), when this does not give rise to anyconfusion.

Prominent examples of relational structures are graphs, (rooted) trees and partialorderings.

Definition 1.1.3. Let τ = {(E, 2)}. Given a set V , a graph is a τ -structure (V,E),where E is a binary relation. Elements of V are called nodes, and elements of E arecalled edges. A graph is directed if (a, b) ∈ E implies (b, a) 6∈ E, for every a, b ∈ V .

Definition 1.1.4. Let τ = {(S, 2)}. A tree is a τ -structure T = (T, S) where

1. there is a unique r ∈ T such that (r, t) ∈ S+, for every t ∈ T \ {r};

2. every t 6= r has a unique S-predecessor;

3. S is acyclic.

A tree T has bounded degree if there is k ∈ N such that every t ∈ T has at most kS-successors.

It is immediate to check that a tree is a directed graph. Intuitively, the relation Srepresents the “child-of” relationship between nodes. Trees with bounded degrees canbe represented using a different vocabulary. If the degree is bounded by k, a tree canbe defined as a { (↓i, 2) | 0 ≤ i < k }-structure (T, ↓0, . . . , ↓k−1), where, informally,each ↓i relates each node with its (i+ 1)th child.

Definition 1.1.5. Let τ = {(<, 2)}. Given a set A, a strict partial ordering is arelational structure A = (A,<) such that < is an irreflexive and transitive binaryrelation.

Some properties of partial orderings are defined below.

Page 15: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

1.1. Vocabularies, structures and languages 3

Definition 1.1.6. A strict partial ordering A = (A,<) is

• linear if, for all a, b ∈ A, either a = b, or a < b or b < a (such orderings arecalled linear orderings);

• unbounded if, for every a ∈ A there are b, c ∈ A such that b < a < c;

• dense if, for all a, b ∈ A such that a < b there is c ∈ A such that a < c < b;

• discrete if, for all a, b ∈ A such that a < b there are c and d such that a < c ≤ b,a ≤ d < b and there is no e ∈ A such that a < e < c or d < e < b.

We now give some basic definitions related to relational structures.

Definition 1.1.7. Given a vocabulary τ = {(R1, n1), . . . , (Rk, nk)}, let A and B betwo τ -structures, and let a = a1, . . . , al and b = b1, . . . , bl be two (possibly empty)tuples of elements of A and B, respectively. We say that (A,a) and (B,b) are iso-morphic, written (A,a) ∼= (B,b), if there is a bijection f : A→ B such that

1. for 1 ≤ i ≤ k and for every e1, . . . , eni∈ A, RA

i (e1, . . . , eni) if and only if

RBi (f(e1), . . . , f(eni));

2. for 1 ≤ j ≤ l, f(aj) = bj.

An automorphism is an isomorphism from a structure to itself.

Definition 1.1.8. Given a τ -structure A, let A′ ⊆ A. The substructure A′ of Ainduced by A′ is the τ -structure that has domain A′ and its relations are the restrictionto A′ of the corresponding relations of A.

First-order formulas for a given vocabulary are built in the standard way. Fora tuple x = x1, . . . , xk of variables, let ϕ(x) denote a formula whose free variablesare among x1, . . . , xk. Given a tuple a = a1, . . . , ak of elements of A, we write(A,a) |= ϕ(x) if ϕ holds in A when interpreting xi with ai, respectively, for 1 ≤ i ≤ k.

Definition 1.1.9. The quantifier depth qd(ϕ) of a first-order formula ϕ is inductivelydefined as follows:

• qd(ϕ) = 0 if ϕ is quantifier-free;

• qd(¬ϕ) = qd(ϕ);

• qd(ϕ ∨ ψ) = max(qd(ϕ), qd(ψ));

• qd(∃xϕ) = qd(ϕ) + 1.

We use ∧,→,↔ as shorthand definitions, as usual. For example, ∀x∀y (xRy →∃z (xRz ∧ zRy)) has quantifier depth 3.

Let us now briefly introduce classical monadic logics.

Page 16: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

4 1. Preliminaries

Definition 1.1.10. Let τ = c1, . . . , cr, u1, . . . , us, b1, . . . , bt be a finite alphabet of sym-bols, where c1, . . . , cr (resp. u1, . . . , us, b1, . . . , bt) are constant symbols (resp. unaryrelational symbols, binary relational symbols) and let P be an alphabet of unary re-lational symbols. The second-order language with equality MSO [τ ∪ P] is built up asfollows: atomic formulas are of the forms x = y, x = ci, with 1 ≤ i ≤ r, ui(x), with1 ≤ i ≤ s, bi(x, y), with 1 ≤ i ≤ t, x ∈ X, and P (x), where x, y are individualvariables, X is a set variable, and P ∈ P; formulas are built up from atomic formulasby means of the boolean connectives ¬ and ∧, and the quantifier ∃ ranging over bothindividual and set variables.

In the following, we will write MSOP [τ ] for MSO [τ ∪P] and we will write MSO [τ ]when P is meant to be the empty set. We will interpret the above language over thelayered structures defined in Chapter 3.

Page 17: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

2Intervals

In many accounts of time and space, for example in analysis, physics, geometry, andoften in logic, the notion of a“point”, or an “instant”, is assumed as a primitive one,that is as an “intuitive” concept that does not require any previous definition. Apoint is usually characterized as an “object with no dimension”. This terminology,however, is not intuitive at all: entities we have experience of do have an extensionalong some dimension. Therefore, a “point” is a high abstraction from our sensorialperceptions.

On the other hand, relations between points are quite simple: distinguishing be-tween near and far objects, or talking about remote and recent events, are pretty nat-ural operations underlying a notion of precedence between points. Relations betweenextended objects become a lot more complicated: rainy days when holidays begin,one’s own car not fitting the only available parking location, an important meetingoverlapping another one, the train leaving just before we arrive at the railway station,are some examples of different possible relations between entities extended in time orspace.

In this chapter, we discuss mathematical models of such “objects with dimension”,which we will call “intervals” or “periods” (giving to the latter term a wider meaningthan to the former). Such notions are investigated mainly in the context of temporalreasoning, but this is not a restriction in any way. The goal is to provide a unifyingframework for relational models of intervals.

2.1 Modeling time—and more—by intervalsTo define (time) periods and intervals, two approaches are possible: either they aretreated as “first-class citizens”, that is primitive objects, and studied on their own,without any reference to their underlying structure, or they are built up starting froman ontology based on points. Although our aim is to develop pure interval theories—this is the approach we will follow at the end of this chapter and in Chapter 3—thelatter approach is the most common and the easiest way of building period/intervalstructures. According to this view, a flow of time can be modeled as a strict partialordering of instants: by doing so, time is allowed to be linear, branching, confluent,discrete, dense, continuous, and so on. Only loops are ruled out: although this choice

Page 18: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

6 2. Intervals

may be debated, one may argue that circular time can be faked by defining a metricover a linear flow of time and by identifying points at the same, fixed, distance. So,we stick to partially ordered sets as our definition of time based on instants.

We start by characterizing which sets of instants over a partial ordering mayqualify as time periods or time intervals.

2.1.1 Intervals as setsBased on the arguably compelling remark that, if two time periods have some in-tersection, their intersection must be a period, too, the following definition seems toexpress a minimal requirement.1

Definition 2.1.1. Let T = (T,<) be a partial ordering. A period base over T is anyset P ⊆ (2T \ {∅}) that is closed under nonempty intersections, that is such that, forall I, J ∈ P , if I ∩ J 6= ∅, then I ∩ J ∈ P . A period is any element of P .

A period is a nonempty set of points of the underlying flow of time. This definitionmay seem overly general: periods need not be linearly ordered, convex or bounded:in fact, to define a period base, even the ordering is superfluous. The relevance ofDefinition 2.1.1 will be clear in Section 2.4, where period bases are shown to give riseto period structures.

Of course, further properties may be imposed on periods, such as boundednessand convexity.

Definition 2.1.2. A period I is convex if, for all a, b ∈ I and for every t ∈ T , ifa < t < b then t ∈ I. A period I is bounded if there are a, b ∈ T , such that a ≤ t ≤ b,for every t ∈ I. A period base is convex (resp., bounded) if all of its periods are convex(resp., bounded).

A period may represent a non-contiguous portion of the underlying ordering: forexample, “every first sunday of each month” is a (non convex and unbounded) timeperiod. An “interval”, instead, is usually understood as the set of points delimited bytwo “endpoints”. Note, however, that even bounded convex periods may not admit arepresentation of this kind, that is as an ordered pair of elements of T : see Figure2 2.1for an example.

So, in general, the intervals over T, defined as sets of points, form a subset of theconvex bounded periods over T.

Definition 2.1.3. Let T = (T,<) be a partial ordering, and let a, b ∈ T . A set-interval I is one of the following nonempty sets:

• an open interval (a, b) = { t ∈ T | a < t < b }, where a < b and ∃t a < t < b;

• a closed interval [a, b] = { t ∈ T | a ≤ t ≤ b }, where a ≤ b;1This definition corresponds to the interval point structures in [58].2In this figure and all the following ones the ordering is drawn from left to right: the depicted

graph must be interpreted by taking its transitive closure: x < y if there is a directed path frompoint x to point y.

Page 19: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

2.1. Modeling time—and more—by intervals 7

a

b c

d e

f

Figure 2.1: In the partial ordering above, {b, c, d} is a convex, bounded, subset that doesnot have a representation as “the set of points between two endpoints”.

• a right-open interval [a, b) = { t ∈ T | a ≤ t < b }, where a < b;

• a left-open interval (a, b] = { t ∈ T | a < t ≤ b }, where a < b.

In each case, a is the left endpoint and b is the right endpoint of I. The set of allset-intervals over T is denoted by IT. The set of all open (resp., closed, right-open,left-open) intervals over T is denoted by I(T) (resp., I[T], I[T), I(T]).

Remark 2.1.4. A different approach would consist in defining an interval as a lin-early ordered set of points in T. A consequence of this choice is that, if no furtherhypothesis on T is added (as the linear interval property of Definition 2.1.8), thesame endpoints may delimit more than one interval.3 We do not go into this topicany further.

For an arbitrary T, IT, I(T), I[T], I[T), or I(T] need not be period bases. SeeFigures 2.2 and 2.3 for examples. There are, however, two important classes whenthis happens to be the case.

d

c

b

a

e

f

g

Figure 2.2: The open intervals (a, f) and (a, g) have intersection {c, d}, which is not aset-interval.

3Something similar happens in Allen’s theory when axiom m4 is dropped (see [39]).

Page 20: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

8 2. Intervals

a

b cd

e fg

Figure 2.3: The intersection of the open intervals (a, d) = {b, c, e} and (a, g) = {b, e, f}is {b, e}, which is not a set-interval.

Lemma 2.1.5. Let T = (T,<) be a linear ordering, and let I and J be two set-intervals over T. If I ∩ J 6= ∅, then I ∩ J is a set-interval. Moreover, if I and J areclosed (resp., open, right-open, left-open) intervals, then I∩J is a closed (resp., open,right-open, left-open) interval.

Proof. The intersection I ∩ J is clearly a set-interval because I ∩ J is convex and ithas a least upper bound and a greatest lower bound. It is trivial to check that theleft endpoint and the right endpoint of I ∩J are contained in I ∩J if and only if theyare contained in I and J .

Corollary 2.1.6. If T = (T,<) is a linear ordering, then IT, I[T], I(T), I[T) andI(T] are period bases.

Remark 2.1.7. It is misleading to think that every pair a, b with a < b determinesa set-interval over an arbitrary linear ordering. We stress the fact that set-intervalsmust be nonempty. So, if T = ({1, 2, 3}, <), with the obvious ordering, then (1, 2)and (2, 3) are not set-intervals. The only open interval over T is (1, 3) = {2}.

A hypothesis that is often assumed for intervals over a partial ordering is thatthey must be linearly ordered sets of points.

Definition 2.1.8. A partial ordering (T,<) has the linear interval property if itsatisfies the following:

lin-int: ∀x∀y (x < y → ∀z1∀z2 (x < z1 < y ∧ x < z2 < y → z1 < z2 ∨ z2 < z1 ∨ z1 =z2)).

The linear interval property rules out situations of confluence as depicted in Fig-ure 2.1. This property alone, however, is not sufficient to guarantee that set-intervalsbe closed under intersections. See, for instance, Figure 2.4. If the orderings are alsocomplete, in the sense of the following definition, then set-interval period bases canbe derived.

Definition 2.1.9. Let T = (T,<) be a partial ordering. We say that T is Dedekind-complete (or T has the least-upper-bound property) if every ascending sequence t0 <t1 < t2 < · · · with an upper bound has a least upper bound.

Page 21: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

2.1. Modeling time—and more—by intervals 9

01 2

3

30

Figure 2.4: Let T1 , { t | t ∈ R ∧ 0 < t < 1 }, T2 , { t | t ∈ R ∧ 0 < t < 1 },T3 , { t | t ∈ R ∧ 1 < t < 2 }, T4 , { t | t ∈ R ∧ 2 < t < 3 } and T5 , { t | t ∈ R ∧ 2 < t < 3 },and let T =

S5i=1, Ti. Define a function < : T → R such that <(t) = t, for t ∈ T \ R,

and <(t) = t for t ∈ R. Consider the strict partial ordering T = (T, <), where < is defined,for a, b ∈ T , as follows: if a ∈ T1 and b ∈ T2 (or vice versa), then a and b are incomparable;if a ∈ T4 and b ∈ T5 (or vice versa), then a, b are incomparable; otherwise, a < b if andonly if <(a) <R <(b). The above dense ordering has the linear interval property, but theintersection (0, 3) ∩ (0, 3) = T3 is not representable as a set-interval, because 1 and 2 do notbelong to the domain of T.

Examples of Dedekind-complete orderings are (N, <) and (R, <). In general, dis-crete partial orderings are Dedekind-complete. Orderings that are not Dedekind-complete include (Q, <) and the partial ordering in Figure 2.4. Note that if T isDedekind-complete, then every descending sequence with a lower bound has a great-est lower bound.

Lemma 2.1.10. Let T = (T,<) be a Dedekind-complete ordering with the linearinterval property, and let I and J be two set-intervals over T. Then, if I ∩ J isnonempty, then it is a set-interval. Moreover, if I and J are closed intervals, thenI ∩ J is a closed interval.

Proof. Suppose that I ∩ J is nonempty. Then, elements in I ∩ J are linearly orderedbecause elements in I and J are supposed to be linearly ordered. Moreover, they arebounded by the endpoints of I and J . By Dedekind-completeness, I ∩ J has a leastupper bound r and a greatest lower bound l, so I ∩ J is a set-interval. If I and J areclosed, then r and l belong to both I and J , so I ∩ J = [l, r].

Corollary 2.1.11. If T = (T,<) is a Dedekind-complete ordering with the linearinterval property, then I[T] is a period base.

Trees, providing the framework for branching time, are the foremost example ofstructures of this kind.

The intersection of (half-)open intervals is not necessarily a (half-)open interval:an example is the dense ordering of Figure 2.4, where the two “holes” have been filled,that is T3 is defined as the closed interval { t | t ∈ R ∧ 1 ≤ t ≤ 2 }. Such orderingis Dedekind-complete and, of course, it has the linear interval property. But, forexample, (0, 3) ∩ (0, 3) = [0, 3) ∩ [0, 3) = [1, 2].

Page 22: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

10 2. Intervals

2.1.2 Intervals as pairs

From a logical point of view, a further abstraction step is often made: intervals aresimply defined as pairs of points, so as to avoid a priori the “endpoint dilemma”: areintervals open or closed (or, maybe, half-open)?

Definition 2.1.12. Let T = (T,<) be a partial ordering. An interval over T is anordered pair 〈a, b〉 such that a, b ∈ T and a < b. The set of all intervals over T isdenoted by INT (T).

All the same, intervals and set-intervals cannot be compared with respect to theirdefinitions only: in particular, it is not possible to apply the set-theoretic construc-tion of period bases to intervals, unless a similar definition of an “interval base” isprovided. It can be argued that intervals are, however, equivalent to set-intervalsin many circumstances. We postpone a comparison between the two approaches toSection 2.4, where “period structures” and “interval structures” are defined.

Definition 2.1.13. Let T = (T,<) be a partial ordering. An interval base I over Tis a subset of INT (T) that satisfies the following intersection property: for every〈a, b〉, 〈c, d〉 ∈ I, if c ≤ b and a ≤ d then sup(a, c) and inf(b, d) exist and the interval〈sup(a, c), inf(b, d)〉 ∈ I.

2.2 Interval relations over linear orderings

So far, we have introduced periods and intervals as entities—built up from points aseither sets or pairs—without superimposing any relation among them.

In fact, a lot of relations can be defined between arbitrary periods over partial or-derings. For example, the number of binary relations between periods that are unionsof set-intervals over a linear ordering increases at least exponentially in the numberof maximal set-intervals making the period [39]. It can be proved, however, that, forconvex periods over arbitrary linear orderings, there are thirteen possibilities ([3, 58]),usually referred to as Allen’s relations (see Figure 2.5). As the following chapters dealonly with linear structures, we shortly review this case.

Given such an abundance, which relations should be taken as primitive? Thechoice is mostly a matter of taste: the only reasonable restriction is that the basicrelations should be expressive enough to capture all the remaining possibilities. Wewill stick to two choices, and refer the reader to [55] for a list of other choices appearingin the literature:

1. the pair consisting of precedence ≺ (the union of Allen’s relations before andmeets) and inclusion < (the union of Allen’s relations starts, ends and during);

2. the single meets relation, which, intuitively holds between two periods if thefirst one ends exactly when the second starts.

Page 23: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

2.2. Interval relations over linear orderings 11

current interval:

starts (s):

ends (e):

overlaps (o):

during (d):

meets (m):

before (b):

Figure 2.5: Allen’s relations between two intervals. The relations not drawn above aretheir converses. Equality is its own converse.

The meets relation is powerful enough to express any other relation over lineartime:4

= , { (i, j) | ∃p∃q. p meets i meets q ∧ p meets j meets q };starts , { (i, j) | ∃p∃q∃r. p meets i meets q meets r ∧ p meets j meets r };ends , { (i, j) | ∃p∃q∃r. p meets q meets i meets r ∧ p meets j meets r };

during , { (i, j) | ∃p∃q∃r∃s. p meets q meets i meets r meets s ∧∧ p meets j meets s };

overlaps , { (i, j) | ∃p∃q∃r∃s∃t. p meets i meets s meets t ∧∧ p meets q meets j meets t ∧ q meets r meets s };

before , { (i, j) | ∃p. i meets p meets j }.

To define the inverse relations, it is sufficient to exchange the role of i and j. AllAllen’s relations are irreflexive.

Both precedence and inclusion can be defined using meets, as follows:

< , { (i, j) | i starts j ∨ i ends j ∨ i during j }≺ , { (i, j) | i before j ∨ i meets j }

Vice versa, meets can be defined using ≺:

meets , { (i, j) | i ≺ j ∧ ¬∃p. i ≺ p ∧ p ≺ j }.4i meets j meets k is a shorthand for i meets j ∧ j meets k.

Page 24: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

12 2. Intervals

Over linear orderings, < can be defined using ≺ (equality is also definable in termsof ≺), so it is redundant:5

= , { (i, j) | ∀p. ((p ≺ i↔ p ≺ j) ∧ (i ≺ p↔ j ≺ p)) }< , { (i, j) | i 6= j ∧ i ⊀ j ∧ j ⊀ i ∧∧ ∀p. ((p ≺ j → p ≺ i) ∧ (j ≺ p→ i ≺ p)) }.

We remark that the above definitions make sense if the flow of time is linear, or at leastit satisfies the linear interval property, even if, in the latter case, Allen’s relations donot cover all the possibilities (see Figure 2.6). If some form of “confluence” is allowed,then the above definitions do not work in all cases, as Figure 2.7 illustrates.

i

j

Figure 2.6: None of the thirteen Allen’s relations holds between i and j.

i

j

pq r

s

Figure 2.7: The Allen’s relation i during j holds, although i and j are disjoint.

Axiomatizations of first-order theories of structures corresponding to the abovementioned relations can be found in [58] and [4], respectively, and are briefly discussedin the following sections.

There is no reason to consider only binary relations. Actually, the semantics ofthe interval logic CDT (see Chapter 3) is based on a ternary relation, called the choprelation, defined, in terms of Allen’s relations, as follows:6

C , { (i, j, k) | i starts k ∧ j ends k ∧ i meets j }. (2.1)5This is true if the period structure, as defined in Section 2.4.1, is “sufficiently rich”: in particular,

it must satisfy the free postulate (see Section 2.4). See Example 2.4.10.6In [59], such definition for the chop operator is given, although in that paper the semantics is

meant to be reflexive, that is C(i, i, i) is assumed to hold. In this thesis, the chop relation alwaysdivides an interval properly, so our definition in terms of Allen’s relation is consistent.

Page 25: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

2.3. Allen and Hayes’s axioms 13

For our purposes, it is convenient to define the chop relation in terms of ≺ and <directly. The definition is as follows:

C , { (i, j, k) | i < k ∧ j < k ∧ i ≺ j ∧ ∀p. p < k →→ ∃u. (u < i ∧ u < p) ∨ (u < j ∧ u < p) }.

(2.2)

Figure 2.8 gives the intuitive picture.

i j

k

Figure 2.8: The relation C(i, j, k).

2.3 Allen and Hayes’s axiomsIn [4], the task of defining a “common-sense” theory of time is undertaken. The aim isto capture all interval relations in a linear model of time. Such theory considers timeperiods as primitive objects, and it relies on the only observation that two intervalsmay “meet”—which happens when they are disjoint, one precedes the other, andthere is no time between them.

The resulting first-order theory of time is based on a language over a vocabu-lary τ = {(‖, 2)}, where the binary relation symbol ‖ is interpreted by Allen’s relationmeets. The theory is axiomatized by the following axioms:7

m1 ∀p∀q∀r∀s((p ‖ q ∧ p ‖ s ∧ r ‖ q)→ r ‖ s

),

which asserts the uniqueness of “meeting places”.

m2 ∀p∀q∀r∀s((p ‖ q ∧ r ‖ s)→ (p ‖ s⊕ ∃t (p ‖ t ‖ s)⊕ ∃t (r ‖ t ‖ q))

),

which superimposes a linear ordering on the flow of time.

m3 ∀p∃q∃r (q ‖ p ∧ p ‖ r),

which states that time is unbounded both in the past and in the future.

m4 ∀p∀q∀r∀s((p ‖ q ‖ s ∧ p ‖ r ‖ s)

)→ q = r,

which intuitively implies that unique intervals share the same endpoints.

m5 ∀p∀q∀r∀s(p ‖ q ‖ r ‖ s→ ∃t (p ‖ t ‖ s)

),

7We write p ‖ q ‖ r as a shorthand for p ‖ q ∧ q ‖ r. The symbol ⊕ denotes exclusive disjunction.

Page 26: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

14 2. Intervals

which says that “intervals compose”.Let AH denote the theory of m1–m5. Theory AH serves the purpose for which it

has been formulated, as it defines the following class of structures.

Definition 2.3.1. Given an unbounded linear ordering T, a meets-structure is a pair(INT (T),M) where M is a binary relation defined, for all 〈a, b〉, 〈c, d〉 ∈ INT (T), by

〈a, b〉M 〈c, d〉 ⇐⇒ b = c.

Theorem 2.3.2 (Ladkin, [39]). The class of models of AH is (up to isomorphism)exactly the class of all meets-structures.

Remark 2.3.3. In dense linear orderings, introducing intervals of the form 〈b, b〉leads to the violation of the axioms: 〈a, b〉 meets 〈b, c〉, but 〈b, b〉 is between the two.There is no way to define meets to remedy this problem: point-intervals simply “justdon’t fit” [4].

In [5], a modified axiomatization is discussed, which has models (called packedmodels) of set-intervals over the rationals whose domain contains open intervals, somesingleton closed interval [a, a], and all their convex unions, e.g. if the domain contains(a, b), (b, c) and [d, d], with a < b < c < d, then it will also contain (a, c), (a, d]and (b, d]. The meets relation must be defined accordingly: if [b, b] is not in the domain,then (a, b) meets (b, c), otherwise (a, b) meets [b, b] meets (b, c), (a, b] meets (b, c),etc. . .

So, (INT (Z),M) is an example of a discrete model, and (INT (Q),M) is an ex-ample of a dense one. Mixed models, which are discrete in some places and denseelsewhere, are also allowed. Given the interval structure, it is possible to recoverthe underlying point structure by defining points as the equivalence classes of anequivalence relation ∼ over pairs of intervals, which identifies pairs that meet “at thesame place”—formally, for intervals p, q, r, s, (p, q) ∼ (r, s) if and only if p meets q,r meets s and p meets s (see [39]). By adding to Allen and Hayes’s theory a furtheraxiom expressing the density of the linear ordering “underlying” the interval structure(which is obtained by the method just described), an axiomatization of INT (Q) canbe obtained.

Theorem 2.3.4 (Ladkin, [39]). The first-order theory of (INT (Q),M) is axioma-tized by m1–m5, plus an axiom expressing the density of the linear ordering of the“underlying point structure”.

2.4 van Benthem’s axiomsA different perspective on intervals is obtained by taking a “more philosophical”approach. van Benthem [58] makes a thorough analysis of a “reasonable choice ofbasic principles embodying the minimum conditions for a structure to qualify asa ‘period structure’” (p. 68). His analysis leverages on two familiar examples of‘interval structures’, namely the closed intervals over the integers (which we may

Page 27: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

2.4. van Benthem’s axioms 15

identify with INT (Z)) and the open intervals over the rationals (which we may identifywith INT (Q)), and distillates principles by abstracting from such structures.

The primitive relations considered are inclusion < (“. . . it is a subinterval of. . . ”)and precedence ≺ (“. . . it is entirely before. . . ”). In terms of Allen’s relations, theformer may be identified with the union of starts, ends and during , and the latterwith the union of before and meets, as we have seen in Section 2.2. Note, however,that such a correspondence, giving a clear intuitive picture, implicitly commits themodel of time to a linear one, which is an assumption not made by van Benthem apriori (see the axioms below).

As we will share this choice of relations in subsequent chapters, we will defineperiod structures as triples (I,<,≺). Before giving the formal definition, we give alist of properties one may expect (some) period structures should satisfy. A thoroughdiscussion of the axioms can be found in [58]. We use the following abbreviations:

intersect(x, y) , ∃u (u v x ∧ u v y);covered(x, y) , ∃u (x v u ∧ y v u).

The following axioms simply express the properties of strict partial orderings:

irrefl(R): ∀x¬(x R x);

trans(R): ∀x∀y∀z (x R y ∧ y R z → x R z);

Both ≺ and < are assumed to be strict partial orderings, so both will be assumed tosatisfy the above two axioms.

As we have argued in Section 2.1, if two periods intersect in some way, then onemay expect that their intersection is a period, too. This requirement seems a verynatural one, and it is formalized by the following axiom, through the method of thegreatest lower bound:

conj: ∀x∀y(intersect(x, y)→ ∃z (z v x ∧ z v y ∧ ∀u (u v x ∧ u v y → u v z))

).

The axiom above allows us to define a partial operation ∩ over periods. Given twointersecting periods i and j, conj guarantees the existence of their intersection, thatis a maximal subperiod contained both in i and in j, which we denote by i ∩ j.

The following property asserts that there exists the “convex union” of any twoperiods.

disj: ∀x∀y(covered(x, y)→ ∃z (x v z ∧ y v z ∧ ∀u (x v u ∧ y v u→ z v u))

).

Similarly to the case of intersection, a partial operation ∪ can be defined over periods,such that, if there is a period containing both i and j, then there is a minimal periodi ∪ j having such property.

The following monotonicity property ties ≺ with < by establishing a minimalinterplay between the two relations: if a period is entirely before another, then theirsubperiods must share the same relative order.

mon: ∀x∀y(x ≺ y → (∀u (u < x→ u ≺ y) ∧ ∀u (u < y → x ≺ u))

).

Page 28: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

16 2. Intervals

Given two periods x and y, the following axioms are used to assert the existence ofadditional periods when it happens that x is not contained into y (free), and whenx does not precede y (free*).

free: ∀x∀y(x 6v y → ∃z (z v x ∧ ¬intersect(z, y)

);

free*: ∀x∀y(x ⊀ y → ∃w∃z (w v x ∧ z v y ∧ ∀u∀v (u v w ∧ v v z → u ⊀ v)

).

The property of freedom asserts that whenever x 6v y, there must exist a subintervalof x disjoint from y. Similarly, the property of star-freedom states that non-precedenceis witnessed by two periods w and z satisfying a sort of “strong non-precedence”, thatis, no subinterval of w precedes any subinterval of z.

Both ≺ and < can be bounded or unbounded in one or both directions. This isexpressed by the following axioms:

past: ∀x∃y. y ≺ x.

future: ∀x∃y. x ≺ y.

begin: ∀x∃y. (y � x ∧ ¬∃z. z ≺ y).

end: ∀x∃y. (x � y ∧ ¬∃z. y ≺ z).

asc: ∀x∃y. x < y.

desc: ∀x∃y. y < x.

max: ∀x∃y. (x v y ∧ ¬∃z. y < z).

atom: ∀x∃y. (y v x ∧ ¬∃z. z < y).

Sometimes, stronger formulations for (un)boundedness are needed:

dir: ∀x∀y covered(x, y).

found: ∀P.(∃xP (x)→ ∃x (P (x) ∧ ∀y ((P (y) ∧ y v x)→ y = x))

).

Well-foundedness (found) rules out, for example, the set of closed rational intervals(which includes intervals of the form [a, a]). A stronger version of desc is the followingdensity postulate:

dens*: ∀x∃y∃z C(y, z, x),

where

C(y, z, x) , y < x ∧ z < x ∧ y ≺ z ∧ ∀w (w < x→ intersect(w, y) ∨ intersect(w, z)).

The form of density expressed by the above axiom can be summarized by saying thatevery period can be chopped into two subperiods.

The property that time periods have “adjacent” periods is expressed by the fol-lowing formula:

Page 29: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

2.4. van Benthem’s axioms 17

neigh: ∀x∀y.(x ≺ y → ∃z (x ≺ z ∧ ¬∃u. x ≺ u ≺ z)

)∧

∧∀x∀y.(y ≺ x→ ∃z (z ≺ x ∧ ¬∃u. z ≺ u ≺ x)

).

The property of neighborhood asserts that, whenever periods are preceded or followedby other periods, then they have immediate neighbors.

Finally, two natural properties are a form of interval linearity (either one intervalis entirely before another, or they overlap is some way), and the convexity of periods:

lin*: ∀x∀y. (x ≺ y ∨ y ≺ x ∨ intersect(x, y)).

conv: ∀x∀y∀z.(x ≺ y ≺ z → ∀u ((x v u ∧ z v u)→ y v u)

).

2.4.1 Period and interval structuresNow we are ready to define period structures and interval structures.

Definition 2.4.1. A period structure I is a relational structure (I,<,≺), where I isa set whose elements are called intervals, < and ≺ are strict partial orderings, and Isatisfies conj and mon.

The above definition is tied to what we have established in Section 2.1 by thefollowing result.

Lemma 2.4.2 (van Benthem, [58]). Let P be a period base over a strict partialordering T = (T,<). Then, (P,<,≺) is a period structure, where < is set-theoreticproper inclusion, and ≺ is defined as follows: for every I, J ∈ P , I ≺ J if and only ift < t′ for every t ∈ I and t′ ∈ J .

It can be also proved that (P,<,≺) satisfies conv if P is convex, and (P,<,≺)satisfies lin* if T is linear.

Similarly, period structures can be built starting from intervals as pairs of points.

Lemma 2.4.3. Let I be an interval base over a strict partial ordering T = (T,<).Then, (I,<,≺) is a period structure, called the period structure induced by the intervalbase I, when inclusion and precedence are defined, for all 〈a, b〉, 〈c, d〉 ∈ I, as follows:

• 〈a, b〉 < 〈c, d〉 if and only if c ≤ a, b ≤ d and 〈a, b〉 6= 〈c, d〉;

• 〈a, b〉 ≺ 〈c, d〉 if and only if b ≤ c.

Moreover, (I,<,≺) satisfies conv, and if T is linear then (I,<,≺) satisfies lin*.

Proof. Irreflexivity and transitivity of ≺ and < are a direct consequence of the sameproperties for <. For conj, suppose that 〈a, b〉 v 〈c, d〉, and 〈a, b〉 v 〈e, f〉. As I isan interval base, 〈sup(c, e), inf(d, f)〉 ∈ I, and 〈a, b〉 v 〈sup(c, e), inf(d, f)〉.

As for monotonicity, 〈a, b〉 ≺ 〈c, d〉 implies b ≤ c, and 〈e, f〉 v 〈a, b〉 implies f ≤ b.Hence, 〈e, f〉 ≺ 〈c, d〉. The other case is symmetric.

Suppose that 〈a, b〉 ≺ 〈c, d〉 ≺ 〈e, f〉, 〈a, b〉 < 〈g, h〉 and 〈e, f〉 < 〈g, h〉. Then,g ≤ a < c and d < f ≤ h, so conv holds.

Page 30: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

18 2. Intervals

Finally, let T be a linear ordering, and let 〈a, b〉, 〈c, d〉 ∈ I. If b ≤ c then 〈a, b〉 ≺〈c, d〉. Suppose that c < b: then, either d ≤ a or a < d. If d ≤ a, then 〈c, d〉 ≺ 〈a, b〉.If a < d, then 〈max(a, c),min(b, d)〉 ∈ I. Such interval is clearly a subinterval of both〈a, b〉 and 〈c, d〉. So, 〈a, b〉 and 〈c, d〉 have a nonempty intersection. Therefore, lin*holds.

Structures derived from interval bases will play a prominent role in this thesis, sowe give them a name.

Definition 2.4.4. Let I be an interval base over T = (T,<). The period structureinduced by I is called an interval structure. An interval structure is canonical ifI = INT (T).

In [58], an axiomatization of theory of open rational intervals is given. It turnsout that the theory of (INT (Q),<,≺) is countably categorical, and hence decidable.As the meets relation can be defined in this structure, and vice versa, also the theoryof (INT (Q),M) is decidable. This is in sharp contrast with the results for modallogics of intervals (see Chapter 3), which are, in general, highly undecidable (thecrucial difference, of course, is in the ability of evaluating predicates over intervals).

2.4.2 Characterizations of interval structures over linear or-derings

Intervals and set-intervals are not equivalent concepts, but they are strictly related.The following result shows that, in the linear case, (canonical) interval structures canbe thought of as made of set-intervals.

Lemma 2.4.5. Let T = (T,<) be an unbounded linear ordering. Then

1. (I[T),<,≺) ∼= (I(T],<,≺) ∼= (INT (T),<,≺);

2. (I(T),<,≺) ∼= (INT (T),<,≺) if and only if T is dense;

3. (I[T],<,≺) ∼= (INT (T),<,≺) if and only if T is discrete.

Proof. Recall that I(T), I[T), I(T] and I[T] over a linear ordering T are period bases(see Corollary 2.1.6).

1. Actually, mapping each half-open interval [a, b) to 〈a, b〉 will do. For, suchmapping is clearly injective and surjective. Besides, [a, b) < [c, d) if and only if[a, b) ⊂ [c, d) if and only if c ≤ a, b ≤ d and at least one inequality is strict ifand only if 〈a, b〉 < 〈c, d〉. For precedence, [a, b) ≺ [c, d) if and only if b ≤ c ifand only if 〈a, b〉 ≺ 〈c, d〉. For left-open intervals, the proof is identical.

2. If T is dense, the same mapping as above works. Conversely, suppose that T isnot dense: then, as T is unbounded, there is a point x that has an immediatesuccessor, say x + 1. Consider the open intervals (v, w), (w, x + 1), (x, y), and(y, z): note that (w, x+1) ≺ (x, y), and there is no interval in between. Besides,

Page 31: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

2.4. van Benthem’s axioms 19

(w, x) < (w, x+1) and (x+1, y) < (x, y). For the sake of contradiction, supposethat f is an isomorphism mapping (v, w) to 〈a, b〉, (w, x+ 1) to 〈b, c〉 and (x, y)to 〈c, d〉. Then, (w, x) must be mapped to a subinterval of 〈b, c〉 that is aneighbor of 〈a, b〉 and 〈c, d〉. Yet, no such subinterval exists.

3. If T is discrete, define f : [a, b] 7→ 〈a, b+ 1〉, where b+1 is the immediate succes-sor of b. The mapping is easily seen to be a bijection preserving inclusion andprecedence.

Suppose that T is not discrete: then, there is a point x that does not have animmediate successor. Then, there is an infinite descending sequence of inter-vals 〈x, y〉 = 〈x, y′〉 = 〈x, y′′〉 = · · · . Suppose that 〈x, y〉 is mapped onto theclosed interval [a, b]. Then [a, a] < [a, b] and [a, a] has no subinterval.

Is is easily verified that the proof of Lemma 2.4.5 applies equally well to linearorderings that are bounded in one or both directions, the only difference regardingbounded discrete linear orderings: in this case, to preserve the isomorphism, thedomain of T must be augmented by one element max such that, for all t ∈ T , t < max,that is the following equivalence holds:

(I[T],<,≺) ∼= (INT (T+),<,≺) if and only if T is discrete,

where T+ is the augmented linear ordering.

Remark 2.4.6. By the above lemma, INT (Q) and I[Q] give rise to non isomorphicstructures (INT (Q) is isomorphic to the (half-)open intervals). This does not mean,however, that there is no interval structure isomorphic to the closed rational intervals.Indeed, the opposite is true: see Theorem 2.4.9.

We have seen that every interval structure over a linear ordering is a period struc-ture that satisfies conv and lin*. We now investigate to some extent the oppositedirection, that is we identify a class of period structures that can be represented asinterval structures over linear orderings.

Lemma 2.4.7. Let I = (I,<,≺) be a period structure. For every i, j ∈ I, if i v j,then i ⊀ j and j ⊀ i.

Proof. For the sake of contradiction, assume that i ≺ j (the other case is symmetrical).As i v j by hypothesis, mon implies i ≺ i, which violates irrefl(≺).

Lemma 2.4.8. If a period structure I = (I,<,≺) satisfies lin* and free, then Isatisfies conv.

Proof. Let u, x, y, z ∈ I such that x ≺ y ≺ z, x v u and z v u. For the sake ofcontradiction, suppose that y 6v u. Then, by free, there is w ∈ I such that w v yand ¬intersect(w, u). By lin*, either w ≺ u or u ≺ w. Suppose that w ≺ u (the othercase is symmetrical). Then, mon implies that w ≺ x. But, by hypothesis, x ≺ y, sowe get w ≺ y, which, by Lemma 2.4.7, is a contradiction.

Page 32: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

20 2. Intervals

Theorem 2.4.9. Let I be a period structure satisfying, neigh, lin*, free, pastand future. Then, I is isomorphic to an interval structure over an unboundedlinear ordering.

Proof. Note that, by Lemma 2.4.8, I satisfies conv. We must extract a point struc-ture from the period structure I. There are several ways to do this, such as definingpoints as filters over periods (see [58]), or as equivalence classes of periods (as in [39]),or by directly introducing them axiomatically (see [5]). We follow the latter approach.Let T = { b(i) | i ∈ I } ∪ { e(i) | i ∈ I }. Intuitively, we associate with each period i abeginning point b(i) and and ending point e(i). We then define a linear ordering <over T , as follows:

p1 e(i) = b(j) if and only if i ≺ j ∧ @k. i ≺ k ≺ j (that is, i meets j);

p2 e(i) < b(j) if and only if i ≺ j ∧ ∃k. i ≺ k ≺ j (that is, i before j);8

p1 and p2, together with the hypothesis, allow us to derive all the properties wemay intuitively expect. Some of them are mentioned below:

1. by past, future, neigh and p1, for every t ∈ T there are (in general, notunique) intervals i and j such that t = e(i) = b(j).

2. b(i) < e(i) for every i ∈ I: for, by past, future and neigh, there are j and ksuch that j meets i and i meets k; by p1, e(j) = b(i) and e(i) = b(k), and, byp2, e(j) < b(k), so b(i) < e(i).

3. Precedence behaves as expected: i ≺ j if and only if e(i) ≤ b(j). If there is no ksuch that i ≺ k ≺ j then, by p1, e(i) = b(j). Otherwise, p2 implies e(i) < b(j).The opposite direction is trivial.

4. < is irreflexive: for the sake of contradiction, suppose that e(i) < e(i). Byfuture and neigh, there is a right neighbor of i, say j, such that (using p1)e(i) = b(j). By hypothesis, e(i) < e(i) = b(j), that is e(i) < b(j), so (p2)there is an interval k such that i ≺ k ≺ j, which is a contradiction, becausewe have supposed that j is a neighbor of i. Suppose that b(i) < b(i). By pastand neigh, there exists j such that b(i) = e(j), hence we must have e(j) < e(j),which cannot be the case, by the above argument.

5. < is transitive: suppose that t < u and u < v for some t, u, v ∈ T . By property 1above, there are i, j, k and l such that t = e(i), u = b(j) = e(k) and v = b(l).So, e(i) < b(j) = e(k) < b(l). By applying p1 and p2, we get i ≺ j ≺ k ≺ l;then, the transivitity of ≺ implies i ≺ l. By p2, we have e(i) < b(l), that ist < v.

8Note that this definition is weaker than the one used by Allen, namely e(i) < b(j) if and only if∃k. e(i) = b(k)∧e(k) = b(j). In non-canonical structures it may well happen that i ≺ j∧∃k. i ≺ k ≺ j,but there is no interval met by i and meeting j at the same time. Split structures (see Chapter 3)are an example.

Page 33: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

2.4. van Benthem’s axioms 21

6. Inclusion behaves as expected: i < j if and only if b(j) ≤ b(i), e(i) ≤ e(j) andat least one inequality is strict. Note that, if i v j, then mon implies i ⊀ jand j ⊀ i: for, if i ≺ j or j ≺ i, then, by monotonicity, we would get i ≺ i,which is a contradiction. Suppose that i < j. By free and lin*, there existsk < j such that either k ≺ i or i ≺ k. Suppose that k ≺ i (the other caseis symmetrical). Let l be a left neighbor of j and r be a right neighbor of j(which exist by past, future and neigh), so that e(l) = b(j) and e(j) = b(r)(by p1). By mon, l ≺ k ≺ i and i ≺ r, so e(l) < b(i) and e(i) ≤ b(r), that isb(j) < b(i) and e(i) ≤ e(j). As for the converse implication, suppose that i 6v j.Then, by free, there is k v i such that (by lin*) either k ≺ j or j ≺ k.Suppose that k ≺ j (the other case is symmetrical). Then e(k) ≤ b(j), and, asb(j) < b(i) by hypothesis, we get (by p2) k ≺ i, which is a contradiction. So,i v j. But i 6= j because, by hypothesis, b(j) < b(i), hence i < j.

7. (T,<) is linearly ordered: let (property 1) t = e(i) and u = b(j) for somet, u ∈ T and i, j ∈ I. If i ≺ j then (property 3) t ≤ u. If j ≺ i, thenb(j) < e(j) ≤ b(i) < e(i), then u < t. Otherwise, by lin* and conj, i∩ j existsand i ∩ j ∈ I. So, (properties 6 and 2) u = b(j) ≤ b(i ∩ j) < e(i ∩ j) ≤ e(i) = t,that is u < t.

8. (T,<) is unbounded: let t ∈ T . For some i, j ∈ I, t = b(i) = e(j). By past andfuture (applied twice), there are k and l such that k ≺ i (without meeting i)and j ≺ l (without meeting l). Hence, e(k) < t and t < b(l).

9. i = j if and only if b(i) = b(j) and e(i) = e(j): for the sake of contradiction andwithout loss of generality, suppose that b(i) < b(j) (remind that < is a linearordering). By property 1, there is k such that e(k) = b(i) < b(j). So, there isno k′ such that k ≺ k′ ≺ i, but there exists k′ such that k ≺ k′ ≺ j. Hence,i 6= j. For the converse implication, suppose that b(i) = b(j) and e(i) = e(j).By lin*, we may distinguish three cases: if i ≺ j then e(i) ≤ b(j) < e(j), whichcontradicts the hypothesis; if j ≺ i then e(j) ≤ b(i) < e(i), again contradictingthe hypothesis. So, i and j must share a common subperiod; by conj, themaximal common subperiod is i ∩ j. Without loss of generality, suppose thati ∩ j < i: then, by property 6, either b(i) < b(i ∩ j) or e(i ∩ j) < e(i). Assumethat b(i) < b(i ∩ j) (the other case being similar). As i ∩ j is maximal, it mustbe b(i ∩ j) = b(j), so b(i) 6= b(j), which is against the hypothesis. The othercases leads to a similar contradiction. Therefore, i = i ∩ j = j.

The next step is to prove that the set J = { 〈b(i), e(i)〉 | i ∈ I } is an intervalbase over (T,<). By property 2, J ⊆ INT (T,<). Let 〈b(i), e(i)〉 and 〈b(j), e(j)〉 besuch that b(j) ≤ e(i) and b(i) ≤ e(j). As < is a linear ordering, e(i) 6< b(j) ande(j) 6< b(i), so (p2) i ⊀ j and j ⊀ i. By lin*, i and j have a nonempty intersection.Then, by conj, i ∩ j ∈ I: it is easy to see that b(i ∩ j) = max(b(i), b(j)) ande(i∩j) = min(e(i), e(j)). So, J is an interval base and the structure (J,<,≺) inducedby J is an interval structure.

Page 34: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

22 2. Intervals

To conclude, it is sufficient to note that the mapping i 7→ 〈b(i), e(i)〉 is a bijectionbetween I and (J,<,≺) (by property 9) that preserves < and ≺ (by properties 3and 6).

Example 2.4.10. Consider the period structure I = ({(pi)i∈N, q, r, (si)i∈N},≺,<)where ≺ and < are defined as follows:

• pi+1 ≺ pi for every i ∈ N;

• p0 ≺ q, p0 ≺ r, q ≺ s0 and r ≺ s0;

• si ≺ si+1 for every i ∈ N;

• ≺ is irreflexive and transitive.

• r < q.

See Figure 2.9.

q

r

p0pi s0 si

Figure 2.9: The period structure of Example 2.4.10.

It is easy to check that I is indeed a period structure. Besides, I satisfies neigh,lin*, past and future. It does not satisfy free, however, because r < q, but thereis no subinterval of q disjoint from r (in fact, no subinterval of q other than r exists).Then, the construction given in the proof of Theorem 2.4.9 would assign the same leftand right endpoints to both q and r, thus violating property 9. Moreover, < cannotbe defined by ≺ as we have done in page 12, because both q and r are preceded andfollowed by the same periods.

Not all interval structures over an unbounded linear ordering satisfy free, neigh,past or future. We conjecture that there is an exact correspondence between theclass of period structures satisfying conv and lin* and the class of interval structuresover linear orderings.

As regards neigh, past and future, there is a weak and natural condition thatcan be imposed on flows of time, which intuitively states that an interval structure isbuilt by using all the points of the underlying ordering in a “reasonable” way.

Lemma 2.4.11. Given a partial ordering T = (T,<), let I be an interval base over Tthat has the following property:

compl: ∀t ∈ T((∃u. u < t→ ∃u. 〈u, t〉 ∈ I) ∧ (∃u. u > t→ ∃u. 〈t, u〉 ∈ I)

).

Page 35: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

2.4. van Benthem’s axioms 23

Then, the interval structure I = (I,<,≺) induced by I satisfies neigh.

Proof. Suppose that 〈a, b〉 ≺ 〈c, d〉 for 〈a, b〉, 〈c, d〉 ∈ I. If b = c, then 〈c, d〉 is a rightneighbor of 〈a, b〉. If b < c, then compl implies that 〈b, e〉 ∈ I, for some e ∈ T . Theother case is symmetric.

compl can be paraphrased by saying that “no points are wasted”, that is, everypoint (which is not at the beginning or at the end of time) is the left endpoint ofan interval and the right endpoint of another interval. If T is an unbounded linearordering, compl entails past and future, too.

Note that the hypothesis of Lemma 2.4.11 does not imply that I is a canonicalinterval structure. Split structures of Chapter 3 satisfy compl, but they are notcanonical.

As a concluding remark, note that the theory axiomatized by the properties ofTheorem 2.4.9 is weaker than AH, because it has non-canonical models.

Page 36: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

24 2. Intervals

Page 37: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

3Split logics of intervals

In this chapter we propose to restrict the models of a propositional interval logicto a class of non-canonical structures, called split frames, which are related to thelayered structures for time granularity ([44, 23]). The idea is to interpret differentlygrained temporal domains as different ways of partitioning a given discrete or denselinear time axis into consecutive disjoint intervals. The outcome is an expressive,yet decidable, logic, which can be viewed as the interval counterpart of (a subset of)the monadic second-order theories of time granularity. A part of the results in thischapter can be found in [46].

3.1 Interval logics are undecidableInterval temporal logics provide a natural framework for dealing with time in vari-ous areas of computer science and artificial intelligence, such as planning and nat-ural language processing, where reasoning about time intervals rather than timepoints is far more natural and closer to common sense (differences and similaritiesbetween point-based and interval-based temporal logics are systematically analyzedin [58]). Unfortunately, most interval temporal logics proposed in the literature,such as Moszkowski’s ITL ([47]), Halpern and Shoham’s Modal Logic of Time Inter-vals (HS, [31]), Venema’s CDT logic ([59]), and Chaochen and Hansen’s NeighborhoodLogic (NL, [11]), are (highly) undecidable (see also [41], [55]).

The problem of finding decidable fragments of these logics has been raised byseveral authors, including Halpern and Shoham (cf. Problem 4 in [31]) and Venema(cf. Question 3.20 in [59]). In general, such fragments have been obtained by imposingsevere restrictions on the expressive power of the logics. As an example, decidablefragments of HS has been identified by reducing the set of modal operators. This isthe case of the logics with 〈B〉 (“in some beginning subinterval”) and 〈B〉 (“in someinterval started by the current interval”), or with 〈E〉 (“in some ending subinterval”)and 〈E〉 (“in some interval ended by the current one”) that can be easily reduced topoint-based logics (a reduction that in general is not possible, see [27]). As anotherexample, Moszkowski ([47]) proves the decidability of the fragment of PropositionalITL by imposing a locality constraint: each propositional variable is true over aninterval if and only if it is true at its first point/state. Decidability of Local ITL

Page 38: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

26 3. Split logics of intervals

can be easily proved by embedding it into Quantified Propositional Linear TemporalLogic.

In this chapter, we propose another way of achieving decidability: passing fromcanonical to non-canonical interval models. Our approach consists in equipping lay-ered structures for time granularity with the interval relations of inclusion and prece-dence. The resulting structures are indeed period structures (according to Defini-tion 2.4.1), satisfying several of van Benthem’s axioms. Their interval logics, however,turn out to be decidable.

3.2 Layered structures

Definition 3.2.1. The lth temporal layer Tl is the set {ml | m ∈ N }. For n ∈ N,the n-layered domain is the set Un =

⋃n−1l=0 Tl. The ω-layered domain is the set Uω =⋃

l∈N Tl.

Each temporal layer is a countable infinite set, whose elements are pairs denotedby nl, where l is the number of the layer (the “level of granularity”, as we will seebelow) and n the displacement from the origin, e.g. 02 is the origin of the secondtemporal layer. The domain of layered structures is made by a countable number oftemporal layers.

3.2.1 Bounded layered structures

Definition 3.2.2. Let k, n ∈ N. The k-refinable n-layered structure is the relationalstructure Nn = (Un, ↓0, . . . , ↓k−1, <), where

• Un is the n-layered domain;

• for i = 0, . . . , k − 1, ↓i is a binary relation, called the ith projection relation,such that, for all al1 , bl2 ∈ Un, ↓i(al1 , bl2) if and only if l1 < n − 1, l2 = l1 + 1and b = a k+ i; since this is a functional relation, we will often write ↓i(x) = yinstead of ↓i(x, y);

• < is a binary relation (in fact, a strict linear ordering) defined, for x, y ∈ Un,as follows:1

– < is irreflexive and transitive;

– a0 < (a+ 1)0, for all a ∈ N;

– ↓j(x) < ↓j+1(x), for 0 ≤ j < k − 1;

– x < ↓j(x), for 0 ≤ j ≤ k − 1;

– ↓k−1(x) < y whenever x < y and y 6∈ { z | (x, z) ∈⋃k−1

i=0 ↓+i }.

We will refer to a k-refinable n-layered structure as a bounded layered structure whenk and n are irrelevant or they can be inferred from the context.

Page 39: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

3.2. Layered structures 27

00 10

01 11 21

02 12 22 32 42 52

03 13 23 33 43 53 63 73 83 93 103 113

Figure 3.1: The 2-refinable 4-layered structure.

We introduce layered structures whose elements are labeled by symbols from acountable set.

Definition 3.2.3. Let Σ be a countable set. Given k, n ∈ N, let Nn be the k-refinablen-layered structure. A (Σ)-labeled n-layered structure is a structure (Nn, (Pa)a∈Σ)obtained by expanding Nn with a unary relation Pa ⊆ Un for every a ∈ Σ.

Figure 3.1 shows an example of a bounded layered structure. It is convenient tothink of such structures in two complementary ways. In the first place, an n-linearstructure is a finite set of infinite (more precisely, bounded in the past and with nobound in the future) temporal layers: under this interpretation, each layer representsa level of granularity in which time (whatever it is, provided that it is linear) ispartitioned, and the projection relation binds each granule of a given layer to its kcomponents in the next layer. So, the latter is a “finer” clock than the former, which is“coarser”. The fact that the structure is bounded implies that there is “the coarsest”temporal clock and “the finest” temporal clock. It can be verified that the relation <linearly orders each layer.

On the other hand, the projection relations dress a layered structure with a tree-like complexion. An n-layered structure can be viewed as an infinite sequence offinite complete k-ary tree, each one rooted at an element a0 ∈ Un and of height n−1.According to this point of view, ↓i(x) = y holds when y is the (i + 1)th child of x,and the linear ordering < corresponds to the preorder (root-left-right) visit of thenodes, for elements belonging to the same tree, and by the linear ordering of thetrees, for elements belonging to different trees. This interpretation enable us to usethe standard terminology for trees.

Definition 3.2.4. Let Nn be a k-refinable n-layered structure, and let x, y ∈ Un.The subtree of N rooted at x is the substructure of N induced by the set { y | (x, y) ∈⋃k

i=0 ↓∗i }. A path (of length l) from x is a sequence of elements x0, . . . , xl such that

x = x0 and, for every 0 ≤ i < l there is 0 ≤ j < k such that ↓j(xi) = xi+1. We say

1↓j(x) denotes the element y, where it exists, such that ↓j(x, y) holds.

Page 40: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

28 3. Split logics of intervals

that x is an ancestor of y if there is a path from x containing y. We say that x is adescendant of y if there is path from y containing x.

3.2.2 Downward unbounded layered structures

Definition 3.2.5. Let k ∈ N. The k-refinable downward unbounded layered struc-ture is the relational structure D = (Uω, ↓0, . . . , ↓k−1, <), where

• Uω is the ω-layered domain;

• for i = 0, . . . , k−1, ↓i is a binary relation, called the ith projection relation, suchthat, for all al1 , bl2 ∈ Uω, ↓i(al1 , bl2) if and only if l2 = l1+1 and b = a k+i; sincethis is a functional relation, we will often write ↓i(x) = y instead of ↓i(x, y);

• < is the strict linear ordering defined, for x, y ∈ Uω, as follows:2

– < is irreflexive and transitive;

– a0 < (a+ 1)0, for all a ∈ N;

– ↓j(x) < ↓j+1(x), for 0 ≤ j < k − 1;

– x < ↓j(x), for 0 ≤ j ≤ k − 1;

– ↓k−1(x) < y whenever x < y and y 6∈ { z | (x, z) ∈⋃k−1

i=0 ↓+i }.

00 10

01 11 21

02 12 22 32 42 52

03

13

23

33

43

53

63

73

83

93

103

113

Figure 3.2: The 2-refinable downward unbounded layered structure.

Definition 3.2.6. Let Σ be a countable set. A (Σ)-labeled downward unboundedlayered structure is a structure (D, (Pa)a∈Σ) obtained by expanding a downward un-bounded layered structure D with a unary relation Pa ⊆ Uω for every a ∈ Σ.

2↓j(x) denotes the element y such that ↓j(x, y) holds.

Page 41: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

3.2. Layered structures 29

See Figure 3.2 for an example. The ordering < is defined as for n-layered struc-tures, and a similar twofold interpretation of the structure is possible. A downwardunbounded layered structure is a countable infinite set of temporal layers (bounded inthe past and unbounded in the future), where each layer is linearly ordered by < andeach granule can be refined into k granules of the next layer through the projectionrelations. The distinctive feature of a downward unbounded layered structure is thatsuch “glass-magnifying” process can go on indefinitely: every granule can always bedecomposed into finer elements.

A downward unbounded layered structure can also be viewed as an infinite se-quence of infinite k-ary trees each one rooted at an element a0 ∈ Uω. Then, thelinear ordering < corresponds to the preorder (root-left-right) visit of the nodes, forelements, in the same tree, and to the linear ordering of the trees, for elements indifferent trees.

3.2.3 Upward unbounded layered structuresDefinition 3.2.7. Let k ∈ N. The k-refinable upward unbounded layered structureis the relational structure U = (Uω, ↓0, . . . , ↓k−1, <), where

• Uω is the ω-layered domain;

• for i = 0, . . . , k − 1, ↓i is a binary relation, called the ith projection relation,such that, for all al1 , bl2 ∈ Uω, ↓i(al1 , bl2) if and only if l1 > 0, l2 = l1 − 1and b = a k+ i; since this is a functional relation, we will often write ↓i(x) = yinstead of ↓i(x, y);

• < is the strict linear ordering defined, for x, y ∈ Uω, as follows:3

– < is irreflexive and transitive;

– a0 < (a+ 1)0, for all a ∈ N;

– ↓j(x) < ↓j+1(x), for 0 ≤ j < k − 1;

– ↓k−1(x) < y whenever x < y and y 6∈ { z | (x, z) ∈⋃k−1

i=0 ↓+i };

– x < ↓0(y) whenever x < y and x 6∈ { z | (y, z) ∈⋃k−1

i=0 ↓+i }.

Definition 3.2.8. Let Σ be a countable set. A (Σ)-labeled upward unbounded layeredstructure is a structure (U, (Pa)a∈Σ) obtained by expanding an upward unboundedlayered structure U with a unary relation Pa ⊆ Uω for every a ∈ Σ.

Figure 3.3 shows an upward unbounded layered structure. Note that the layersare counted from the bottom up. An upward unbounded layered structure has acountable infinite set of temporal layers (bounded in the past and unbounded in thefuture), where each layer is linearly ordered by < and each granule can be refined intok granules of the next layer through the projection relations. An upward unbounded

3↓j(x) denotes the element y, if it exists, such that ↓j(x, y) holds.

Page 42: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

30 3. Split logics of intervals

00 10

01 11 21

02 12 22

03 13

31 41 51

20 30 40 50 60 70 80 90 100 110

flow of time

coarser granularity

finer granularity

Figure 3.3: The 2-refinable upward unbounded layered structure.

layered structure has “the finest” layer, made of “atomic”, indivisible, granules, butcoarser and coarser layers.

An upward unbounded layered structure can also be viewed as infinite k-ary treebuilt up from the leaves and with no root. Then, the linear ordering < correspondsto the inorder (left-root-right) visit of the nodes.

3.2.4 Monadic theories over layered structuresIn [44], Σ-labeled layered structures are models for formulas written in the languageMSO [↓0, . . . , ↓k−1, <, (Pa)a∈Σ] (see Chapter 1), where the interpretation of the sym-bols between the square brackets is the obvious one. The decidability of the second-order theory of n-layered structures was proved in [44] by reducing it to the monadicsecond-order theory of one successor S1S.

Theorem 3.2.9 (Montanari, [44]). MSO [↓0, . . . , ↓k−1, <, (Pa)a∈Σ] on n-layered struc-tures is nonelementarily decidable.

The decidability of the second-order theory of downward unbounded layered struc-tures was proved in [45]by reducing it to the monadic second-order theory of k suc-cessors SkS.

Theorem 3.2.10 (Montanari et al., [45]). MSO [↓0, . . . , ↓k−1, <, (Pa)a∈Σ] over down-ward unbounded layered structures is nonelementarily decidable.

Finally, the decidability of the second-order theory of upward unbounded layeredstructures was proved in [45] by reducing it to S1Sk.

Theorem 3.2.11 (Montanari et al., [45]). MSO [↓0, . . . , ↓k−1, <, (Pa)a∈Σ] over up-ward unbounded layered structures is nonelementarily decidable.

Page 43: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

3.2. Layered structures 31

In this chapter we will transfer such decidability results to an interval logic inter-preted over “tree-like” period structures.

It will be convenient in what follows to use two partial orderings <1 and <2

equivalent to <, which, intuitively, have the following interpretation: x <1 y if x isin a tree before the tree where y is4 (<1 reduces to the empty relation on upwardunbounded layered structures); and x <2 y if y is different from x and y belongs tothe subtree rooted at x (i.e., y is a proper descendant of x).

Lemma 3.2.12 (Franceschet, [23]). MSO [↓0, ↓1, <,P] and MSO [↓0, ↓1, <1, <2,P] areexpressively equivalent over the class of bounded layered structures and over the classof downward unbounded layered structures.

Proof. We use the following abbreviations:

↓(x, y) , ↓0(x, y) ∨ ↓1(x, y);T0(x) , ¬∃y. ↓(y, x);

↓k(x, y) , ∃z1 · · · ∃zk+1.(x = z1 ∧ y = zk+1 ∧

k∧i=1

↓(zi, zi+1)), with k ≥ 1;

P (↓(x)) , ∃y ↓(x, y)→ ∃y∃z.(↓0(x, y) ∧ ↓1(x, z) ∧ P (y) ∧ P (z)

).

The formula T0(x) holds for all and only the elements in the upmost layer.5 Theformula ↓k(x, y) states that y is in the subtree rooted at x on a path of length k.

Recall that, on n-layered or downward unbounded structures, < is the orderingdefined by the preorder (root-left-right) visit within a tree, and by the ordering ofthe sequence of trees for elements in distinct trees. It is easy to verify that, over suchstructures, < can be defined as follows:

< ,{

(x, y)∣∣ x <1 y ∨ x <2 y ∨ ∃z.

( ∨0≤i,j≤1

(↓i(z) ≤2 x ∧ ↓j(z) ≤2 y)) }.

Vice versa, to define <1 and <2 consider the following formula stating that y is inthe subtree rooted at x:

reach(x, y) , ∀P(P (↓(x)) ∧ ∀z (P (z)→ P (↓(z)))→ P (y)

).

The definitions of <1 and <2 are as follows:

<1 ,{ (x, y) | ∃r∃s. (T0(r) ∧ T0(s) ∧ r < s ∧ reach(r, x) ∧ reach(s, y) };<2 ,{ (x, y) | reach(x, y) }.

Both definitions above are genuine second-order statements (see Lemma 3.2.14).

4In [23] such partial ordering is restricted to the roots of the trees. Our definition, however, isequivalent.

5T0(x) does never hold on upward unbounded layered structures.

Page 44: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

32 3. Split logics of intervals

Lemma 3.2.13 (Franceschet, [23]). The languages MSO [↓0, ↓1, <,P], MSO [↓0, ↓1, <2

,P] and MSO [↓0, ↓1,P] are expressively equivalent over the class of upward unboundedlayered structures.

Proof. In upward unbounded structures, < is given by the inorder (left-root-right)visit of the tree, so it can be defined by

< ,{

(x, y)∣∣ ∃z. ( ∨

0≤i,j≤1

(↓i(z) ≤2 x ∧ ↓j(z) ≤2 y)) },

which intuitively requires that x be in the left subtree and y be in the right subtree ofa tree rooted at a common ancestor (as the upward unbounded structure has no root,every two nodes have a common ancestor that is distinct from both nodes). Suchdefinition uses only the projectors ↓i.

The relation <2 can be defined as in the proof of Lemma 3.2.12.

Lemma 3.2.14. The relations <1 and <2 are not first-order definable in the languageof MFO [↓0, . . . , ↓k−1, <] over bounded or ω-layered structures.

Proof. The argument is of game-theoretic flavor (see Chapter 5). For the sake ofsimplicity, we consider 2-refinable structures.

For the sake of contradiction, suppose that φ = φ(x, y) is a first-order formula ofMFO [↓0, ↓1, <] defining <2 uniformly6 over the class of 2-refinable bounded layeredstructures. Let m be the quantifier depth of φ (see Definition 1.1.9). We show thatthere are two bounded layered structures N and N′ that satisfy the same sentences ofquantifier depth at most m, nonetheless they do not agree on φ(x, y). Assume that Nand N′ have both 2m+2 layers.

Consider the following sets of local isomorphisms

Ik ={p | p is a local isomorphism from N to N′ and ∀a, b ∈ dom(p).(δ(a, b) = δ(p(a), p(b)) ∨ (δ(a, b) ≥ 2m ∧ δ(p(a), p(b)) ≥ 2m)

) },

where δ is the distance in the Gaifman graph of (Un, ↓0, ↓1), that is the boundedlayered structure restricted to the projection relations.

In addition, we assume that every local isomorphism in Im maps every element inthe first and the last layer to the same element in the other structure, and every p ∈ Immaps 02m to 02m and 02m+1 to (22m

)2m . Note that 02m <2 02m+1 and 02m 6<1 02m+1 ,while 02m 6<2 (22m

)2m and 02m <1 (22m

)2m . Note also that δ(02m , 02m+1) ≥ 2m

and δ(02m , (22m

)2m) ≥ 2m. Of course, every such mapping respects both ↓i and <.We prove that the sequence of sets (Ik)0≤k≤m has the back and forth property.

Let us prove the forth property: let k < m, p ∈ Ik+1 and a ∈ Un. We distinguishtwo cases. First, suppose that there is a′ ∈ dom(p) such that δ(a, a′) < 2k. Thereare three possibilities: a′ is in the left subtree of a, a′ is in the right subtree of a, orthe path7 from a to a′ goes through the father of a. If a′ is in the left (resp., right)subtree, we choose b′ in the left (resp., right) subtree of b in a “matching way”.

6That is, the same formula φ defines <2 over n-layered structures, for every n ∈ N.7Here, we use the word “path” in a more general sense to denote a sequence of adjacent edges in

the tree.

Page 45: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

3.3. Split structures 33

Otherwise, if a′ is on the path from the root to a choose b on the path from theroot to b, at the same distance. Otherwise, a and a′ have a common ancestor c inthe tree, and a′ is either in the left subtree of c or in its right subtree. Choose baccordingly.

If for all a′, δ(a, a′) > 2k, then we must choose b such that δ(b, b′) > 2k for all b′.Here, we use the linear ordering <. Suppose that a′ < a < a′′ for some a′, a′′. Then,choose p(a′) < b < p(a′′).

The back property is proved in a similar way.

The above results show that MFO [↓0, ↓1, <,P] and MFO [↓0, ↓1, <1, <2,P] are notexpressively equivalent: the former language can be embedded in the latter, but notvice versa. MFO [↓0, ↓1, <1, <2,P] can be embedded in the second-order language.

In what follows we will refer to the layered structures with their < relation, but,given the equivalences established by Lemmas 3.2.12 and 3.2.13, we will use <1 and <2

when doing this simplifies the exposition.

3.3 Split structures

The theories of layered structures have been developed to provide a formal counterpartof the ability to reason at different “levels of time granularity”. In particular, theyabstract from the idea of time as instant-based (this is especially evident for downwardunbounded layered structures): what is considered to be a “point” at a certain level ofgranularity may reveal further structure when projected to a finer level of granularity.It seems quite natural, then, to interpret granules as time periods rather than timeinstants. Which kind of structures does this perspective lead to? Can they really beinterpreted as period structures in a formal sense?

From now on, we will focus on 2-refinable layered structures, although this restric-tion is not essential. We will consider layered domains as sets of intervals, and we willprovide them with some of the interval relations we have defined in Chapter 2. Theobvious choices are inclusion and precedence.

Definition 3.3.1. Let n ∈ N. A bounded split frame is a structure In = (Un,<,≺)where Un is the n-layered domain, and < and ≺ are the binary relations defined asfollows:8

al1 < bl2 ⇐⇒ l1 > l2 ∧ b · 2l1−l2 ≤ a < (b+ 1) · 2l1−l2 ,

al1 ≺ bl2 ⇐⇒ a < bb · 2l1−l2c.

Definition 3.3.2. The dense split frame is the structure I = (Uω,<,≺) where Uω isthe ω-layered domain, and < and ≺ are as in Definition 3.3.1.

8The < relation is this definition, and in the following ones, refers to the ordering of naturalnumbers.

Page 46: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

34 3. Split logics of intervals

Definition 3.3.3. The discrete split frame is the structure I = (Uω,<,≺) where Uω

is the ω-layered domain, and < and ≺ are the binary relations defined as follows:

al1 < bl2 ⇐⇒ l1 < l2 ∧ b · 2l2−l1 ≤ a < (b+ 1) · 2l2−l1 ,

al1 ≺ bl2 ⇐⇒ a < bb · 2l2−l1c.

Intuitively, i < j if i is in the subtree rooted at j, and i ≺ j if i belongs to atree that is before the tree that contains j (this can happen only in bounded or denseframes), or i and j have a common ancestor k, i is in the left subtree of k and j isthe right subtree of k.

Are we entitled to refer to such structures as period structures? The followingresult shows that they share the essential properties of period structures, and muchmore.

Theorem 3.3.4. If I = (I,<,≺) is (bounded, dense or discrete) split frame, then Iis a period structure that satisfies conv, free, free*, disj, begin, future, neigh,plus the following strengthened linearity condition:

strong-lin*: ∀i∀j i ≺ j ∨ j ≺ i ∨ i < j ∨ j < i ∨ i = j.

Moreover,

• if I is a bounded split frame, then it satisfies max and found;

• if I is a discrete split frame, then it satisfies found and dir;

• if I is a dense split frame, then it satisfies max and dens*.

Proof. Let I = (I,<,≺) be a bounded or dense split frame. Le us prove that Iis a period structure (the proof for discrete split frames is almost identical). It isimmediate to verify that < and ≺ are irreflexive. Let us prove that < and ≺ aretransitive. Suppose that al1 < bl2 and bl2 < cl3 . Then, l1 > l3. Besides, c · 2l2−l3 ≤ b,and b · 2l1−l2 ≤ a, so c · 2l2−l3 · 2l1−l2 ≤ a, that is c · 2l1−l3 ≤ a. As for the other side,a < (b+1) ·2l1−l2 and b < (c+1) ·2l2−l3 , so a < ((c+1) ·2l2−l3) ·2l1−l2 = (c+1) ·2l1−l3 .Hence, al1 < cl3 . As for precedence, suppose that al1 ≺ bl2 and bl2 ≺ cl3 . Then,a < bb · 2l1−l2c and b < bc · 2l2−l3c. Hence, a < bc · 2l1−l3c. So, precedence istransitive.

Now, suppose that al1 v bl2 and al1 v cl3 . If at least one equality holds, thenconj is trivially satisfied. So, we may assume that al1 < bl2 and al1 < cl3 . Supposethat l2 > l3. Then, b · 2l1−l2 ≤ a < (c+ 1) · 2l1−l3 , hence b < (c+ 1) · 2l2−l3 . On theother hand, c · 2l1−l3 ≤ a < (b+ 1) · 2l1−l2 , hence, c · 2l2−l3 ≤ b. Therefore, bl2 < cl3 ,and bl2 is the suitable witness for conj. The other cases are similar.

For (left) monotonicity, suppose that al1 ≺ bl2 , and cl3 < al1 . By hypothesis,a ≤ bb · 2l1−l2c − 1, and c < (a + 1) · 2l3−l1 . So, c < bb · 2l1−l2c · 2l3−l1 , that isc < bb · 2l3−l2c. Right monotonicity is proved in a similar way.

Let us prove the remaining properties:

Page 47: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

3.3. Split structures 35

begin: for every period al1 , 0l1 � al1 and there is no period preceding 0l1 .

future: for every period al1 , al1 ≺ (a+ 1)l1 .

strong-lin*: suppose that al1 6< bl2 , bl2 6< al1 , al1 ⊀ bl2 and bl2 ⊀ al1 . We wantto show that al1 = bl2 . The last two conditions can be rewritten as follows:a ≥ bb · 2l1−l2c and b + 1 > a · 2l2−l1 . Suppose that l1 ≥ l2. Then, we getb · 2l1−l2 ≤ a < (b + 1) · 2l1−l2 . As al1 6< bl2 , it must be l1 = l2. Besides, asb · 2l1−l2 ≤ a, we get a = b. The other case is symmetrical.

free: suppose that al1 6v bl2 . By strong-lin*, either bl2 < al1 or one of the twoperiods precedes the other. In the latter case, a suitable witness for freedom isal1 itself. So, suppose that bl2 < al1 . Let c = a · 2l2−l1 . If b > c, then cl2 ≺ bl2and, clearly, cl2 < al1 . If b = c, then let d = (a+ 1) · 2l2−l1 . Then, bl2 ≺ dl2 anddl2 < al1 .

free*: suppose that al1 ⊀ bl2 . We must find periods w and z such that w v al1 andz v bl2 and no subperiod of w precedes any subperiod of z. By strong-lin*,either bl2 ≺ al1 or one of the two periods is (not necessarily properly) containedinto the other. In the latter case, the subinterval is the suitable witness forstar-freedom. In the former case, w = al1 and z = bl2 will do.

neigh: consider a period al1 . It is trivial to check that (a + 1)l1 is a right neighborof al1 and, if a > 0, (a− 1)l1 is a left neighbor of al1 .

disj: suppose that there is al1 such that bl2 v al1 and cl3 v al1 . Then, bl2 and cl3are in the same tree. Then, the suitable witness for disj is their least commonancestor.

conv: as free and strong-lin* are satisfied, conv holds by Lemma 2.4.8.

Now, let I be a bounded or dense split frame. Then, for every period al1 , al1 v(ba ·2−l1c)0, and (ba ·2−l1c)0 is not contained in any other period. So, I satisfies max.Well-foundedness for bounded split frames and the discrete frame follows immediatelyfrom the well-foundedness of N (note that al1 < bl2 requires l1 > l2 in the caseof bounded split frames, and l1 < l2 for the discrete split frame). Moreover, inthe discrete frame, dir holds because every pair of periods has a common ancestor.Finally, in the dense split frame, it is trivial to check that, for every interval al1 ,(2a)l1+1 < al1 , (2a + 1)l1+1 < al1 , (2a)l1+1 ≺ (2a + 1)l1+1. Besides, any otherperiod bl2 < al1 is either contained into (2a)l1+1 or into (2a + 1)l1+1. So, dens*holds.

Split frames take their name after the following split condition (for the definitionof C(x, y, z) see page 16):

split: ∀i1∀j1∀k∀i2∀j2 C(i1, j1, k) ∧ C(i2, j2, k)→ i1 = i2 ∧ j1 = j2,

which intuitively asserts that intervals can be chopped in a unique way. Note thatsplit can be derived from the other axioms, in particular it is a consequence ofstrong-lin*.

Page 48: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

36 3. Split logics of intervals

3.4 Split Logics: Syntax and Semantics

The language of SL is based on a modal similarity type with four unary opera-tors 〈P〉, 〈F〉, 〈D〉 and 〈D〉, and three binary operators C, D, and T. The former areborrowed from HS ([31]), while the latter are the irreflexive variants of the operatorsof CDT ([59]). The well-formed formulas, denoted by φ, ψ, . . ., of SL are given by thefollowing grammar:

φ ::= p | φ ∨ φ | ¬φ | 〈P〉φ | 〈F〉φ | 〈D〉φ | 〈D〉φ | φ C φ | φ D φ | φ T φ,

where p ∈ Φ, and Φ is a countable set of propositional letters. For a unary modal-ity 〈X〉, we denote with [X] the formula ¬〈X〉¬φ.

We will interpret the interval language just defined over split frames.

Definition 3.4.1. A bounded (resp., dense, discrete) split model is a pair (I, V )where I is a bounded (resp., dense, discrete) split frame and V : Φ→ 2I is a valuationfunction mapping each propositional variable to a set of intervals.

Definition 3.4.2. Let M = ((I,<,≺), V ) be a split model, let i ∈ I be an interval φbe a formula. The satisfiability relation is inductively defined as follows.

• M, i p iff i ∈ V (p), where p ∈ Φ;

• M, i ¬φ iff M, i 1 φ;

• M, i φ ∨ ψ iff M, i φ or M, i ψ;

• M, i 〈P〉φ iff there is j such that j ≺ i and M, j φ;

• M, i 〈F〉φ iff there is j such that i ≺ j and M, j φ;

• M, i 〈D〉φ iff there is j such that j < i and M, j φ;

• M, i 〈D〉φ iff there is j such that i < j and M, j φ;

• M, i φ C ψ iff there are j, k such that C(j, k, i) and M, j φ and M, k ψ;

• M, i φ D ψ iff there are j, k such that C(j, i, k) and M, j φ and M, k ψ;

• M, i φ T ψ iff there are j, k such that C(i, j, k) and M, j φ and M, k ψ;

A formula φ is satisfiable if M, i φ for some model M and some interval i ∈ I; φis true in a model M, written M φ, if φ is true at every interval of M; finally, φis valid with respect to a class F of frames if, for every F ∈ F , for every valuation Vand for every state i, (F, V ), i φ.

Page 49: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

3.4. Split Logics: Syntax and Semantics 37

3.4.1 Interdefinability of modalities

CDT is expressive enough to capture all Allen’s relations on canonical linear intervalstructures (see [59]). This is no longer the case, when C, D and T are interpreted oversplit models: in this case, they act as a sort of multidimensional “next” operator, andtheir expressiveness is severely limited over split frames compared to the structuresbased on all the intervals over a linear ordering.

Lemma 3.4.3. None of 〈D〉, 〈D〉, 〈P〉, 〈P〉 is definable in the language with only C,D and T over either the class of bounded split frames, over the dense frame or overthe discrete frame.

Proof. In bounded and downward unbounded layered structures, there is an isomor-phism between the two {C,D,T}-split models of Figure 3.4, which exchanges the firstand the second tree, so that 〈P〉p holds in M at 21 but it is false in M′ at the bisimi-lar state 01. As truth is preserved under isomorphism, there is no {C,D,T}-formuladefining 〈P〉. A similar argument applies to 〈F〉.

M′

M

p

p

00 10 20

01 11 21 31 41 51

00 10 20

01 11 21 31 41 51

Figure 3.4: The two structures M and M′ are bisimilar with respect to the language of C,D and T, but when 〈P〉 is added to the language, this is no longer the case.

Suppose that φ is a {C,D,T}-formula defining 〈P〉p over (labeled) upward un-bounded layered structures. Let n be the modal depth of φ. Consider the two {C,D,T}-models M and M′ in Figure 3.5. It is easy to check that n0 in M and n0 in M′

are n-bisimilar (with respect to the chop relation and its “converses”), so they satisfythe same formula of degree n. But M, n0 φ while M′, n0 1 φ. As φ has degree n,this is a contradiction.

Finally, that 〈D〉 and 〈D〉 are not definable is a consequence of the form of theirfirst-order translation (see Section 3.5) and Lemma 3.2.14.

The binary modalities are not, however, definable using the unary modalities. Forbounded frames, this is true even when n is fixed.

Page 50: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

38 3. Split logics of intervals

M′

M

p

p

00 n0

00 n0

(2n)0

(2n)0

Figure 3.5: State n0 in M and in M′ are n-bisimilar, but 〈P〉p holds in M and it does nothold in M′.

Lemma 3.4.4. The modalities C, D and T are not definable by a {〈P〉, 〈F〉, 〈D〉, 〈D〉}-formula over either the n-layered split frame, for any fixed n ∈ N, or over the denseframe or over the discrete frame.

Proof. For the sake of contradiction, suppose that φ is a {〈P〉, 〈F〉, 〈D〉, 〈D〉}-formuladefining p C ¬p over the class of bounded split frames. Let n be the degree of φ.Consider the models of Figure 3.6. We assume that i and j are on the (2n + 1)thtree, and we show that they are n-bisimilar intervals. To prove this, we use a game-theoretic argument, that is we describe a winning strategy for Duplicator in a gamewith n rounds played on the models of Figure 3.6. The game starts at states i andj. At each round Spoiler chooses one of the two current states, and picks a new statethat is R-reachable from the chosen current state, where R is one of the accessibilityrelations corresponding to 〈P〉, 〈F〉, 〈D〉, or 〈D〉. Duplicator replies by choosing a statethat is R-reachable from the current state in the other structure. If the new statesdo not satisfy the same propositions, then Duplicator loses.

The winning strategy for Duplicator goes as follows. If Spoiler picks the left (resp.,right) son of i, then Duplicator replies with the right (resp., left) son of j—and viceversa. If Spoiler picks i (resp., j), then Duplicator replies with j (resp., i). The onlyinvariant that Duplicator needs to maintain is that at the kth round she must neverreply in the first m − k trees unless Spoiler has done so. The fact that i and j aresufficiently distant from the first tree is sufficient to guarantee that such invariant canbe maintained.

The proof straightforwardly extends to dense and discrete frames.

Of course, 〈D〉 and 〈D〉 can be defined over n-layered structures when n is known,because, in this case, every interval has a finite number of subintervals (as the struc-ture is well-founded) and it is contained in a finite number of intervals (by the existence

Page 51: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

3.5. Decidability of split logics 39

p p p

p p p

p

p

M

M′

00

00

i = (2n)0

j = (2n)0

Figure 3.6: default

of maximal intervals). If we define:

coarser(φ) , (true T φ) ∨ (true D φ),

then the formula ∨1≤i<n

coarseri(φ),

where coarseri(φ) is the ith iteration of the formula coarser(φ) (where coarser1(φ)coincides with coarser(φ)), defines the formula 〈D〉φ. The same can be done for 〈D〉as follows:

(φ C true) ∨ (true C φ) , finer(φ)

〈D〉φ ,∨

1≤i<n

fineri(φ).

Finally, when interpreted over upward unbounded layered structures, 〈F〉 and 〈P〉are redundant. In fact, they can be defined as follows:

〈F〉φ , (φ ∨ 〈D〉φ) T true ∨ 〈D〉((φ ∨ 〈D〉φ) T true

);

〈P〉φ , (φ ∨ 〈D〉φ) D true ∨ 〈D〉((φ ∨ 〈D〉φ) D true

).

3.5 Decidability of split logics

Decidability can be proved using the same techniques employed to prove decidabilityof layered structures, namely the reduction to the monadic second-order theory oftwo successors. By exploiting the existing results about layered structures, however,we are in a condition to face a much easier task.

Page 52: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

40 3. Split logics of intervals

Lemma 3.5.1. The relations <, ≺ and C are definable in MSO [↓0, ↓1, <] over n-layered or ω-layered structures.

Proof. Consider the following definitions:

< , { (x, y) | y <2 x }≺ , { (x, y) | x <1 y ∨ ∃z. (↓0(z) ≤2 x ∧ ↓1(z) ≤2 y }C , { (x, y, z) | ↓0(z) = x ∧ ↓1(z) = y }

Actually, we may translate the modal language into the classical language of lay-ered structures.

Definition 3.5.2. Let τ :ML(<,≺,Φ)→ L(↓0, ↓1, <,P) be the translation functiondefined as follows:

• τ(p) = P (x), where p ∈ Φ and P is a unary predicate symbol;

• τ(¬φ) = ¬(τ(φ));

• τ(φ ∧ ψ) = τ(φ) ∧ τ(ψ);

• τ(〈F〉φ) = ∃y((x <1 y∧τ(φ){x/y})∨∃z (↓0(z) ≤2 x∧↓1(z) ≤2 y∧τ(φ){x/y})

);

• τ(〈P〉φ) = ∃y((y <1 x∧τ(φ){x/y})∨∃z (↓0(z) ≤2 y∧↓1(z) ≤2 x∧τ(φ){x/y})

);

• τ(〈D〉φ) = ∃y (x <2 y ∧ τ(φ){x/y});

• τ(〈D〉φ) = ∃y (y <2 x ∧ τ(φ){x/y});

• τ(φ C ψ) = ∃y∃z(↓0(x) = y ∧ ↓1(x) = z ∧ τ(φ){x/y} ∧ τ(ψ){x/z}

);

• τ(φ T ψ) = ∃y∃z(↓0(z) = x ∧ ↓1(z) = y ∧ τ(φ){x/y} ∧ τ(ψ){x/z}

);

• τ(φ D ψ) = ∃y∃z(↓0(z) = y ∧ ↓1(z) = x ∧ τ(φ){x/y} ∧ τ(ψ){x/z}

).

Theorem 3.5.3. Let (I,<,≺) be a bounded (resp, dense, discrete) split frame, let(I, ↓0, ↓1, <) an n-layered (resp., downward unbounded, upward unbounded) structure,and let φ be a split formula. Then,

(I,<,≺) φ ⇐⇒ (I, ↓0, ↓1, <) |= ∀P1 · · · ∀Pm∀x. τ(φ),

where P1, . . . , Pm are the unary predicate symbols corresponding to the propositionalvariables in φ.

Page 53: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

3.5. Decidability of split logics 41

Proof. Let M = (I,<,≺, V ) be any model based on (I,<,≺), and let i be any intervalin I. Let p1, . . . , pm be the propositional variables occurring in φ, and let N =(I, ↓0, ↓1, <, V (p1), . . . , V (pm)). We only need to prove that

M, i φ ⇐⇒ N |= τ(φ)[x 7→ i],

where we assume that each unary predicate symbol Pi in τ(φ) is interpreted by thecorresponding V (pi). Note that, if the above equivalence holds, the thesis is obtainedby universally quantifying over P1, . . . , Pm and over all the intervals.

Let d(x, y), p(x, y) and c(x, y, z) the first-order formulas that define <, ≺ and thechop relation, respectively. The proof proceeds by induction on the complexity of φ:

• M, i p if and only if i ∈ V (p) if and only if N |= P (x)[x 7→ i].

• M, i ¬φ if and only if M), i 1 φ if and only if, by the inductive hypothesis,(N 6|= τ(φ) if and only if N |= ¬τ(φ).

• M, i φ ∨ ψ if and only if M, i φ or M, i ψ if and only if N |= τ(φ)[x 7→ i]or N |= τ(ψ)[x 7→ i] if and only if N |= τ(φ) ∨ τ(ψ)[x 7→ i].

• M, i 〈P〉φ if and only if there is j ≺ i such that M, j φ if and only if, by theinductive hypothesis and by applying a substitution, N |= τ(φ){x/y}[y 7→ j],and, by Lemma 3.5.1, N |= p(y, x)[x 7→ i, y 7→ j] if and only if N |= ∃y

(p(y, x)∧

τ(φ){x/y}).

• M, i 〈P〉φ if and only if there is j such that i ≺ j and M, j φ if and only if, bythe inductive hypothesis and by applying a substitution, N |= τ(φ){x/y}[y 7→ j],and, by Lemma 3.5.1, N |= p(x, y)[x 7→ i, y 7→ j] if and only if N |= ∃y

(p(x, y)∧

τ(φ){x/y}).

• M, i 〈D〉φ if and only if there is j < i such that M, j φ if and only if, by theinductive hypothesis and by applying a substitution, N |= τ(φ){x/y}[y 7→ j],and, by Lemma 3.5.1, N |= d(y, x)[x 7→ i, y 7→ j] if and only if N |= ∃y

(d(y, x)∧

τ(φ){x/y}).

• M, i 〈D〉φ if and only if there is j such that i < j and M, j φ if and only if, bythe inductive hypothesis and by applying a substitution, N |= τ(φ){x/y}[y 7→ j],and, by Lemma 3.5.1, N |= d(x, y)[x 7→ i, y 7→ j] if and only if N |= ∃y

(d(x, y)∧

τ(φ){x/y}).

• M, i φ C ψ if and only if there are j and k such that C(j, k, i), M, j φand M, k ψ if and only if, by the inductive hypothesis and by applyingtwo substitutions, N |= τ(φ){x/y}[y 7→ j] and N |= τ(ψ){x/z}[z 7→ k], and,by Lemma 3.5.1, N |= c(y, z, x)[j, k, i] if and only if N |= ∃y∃z.

(c(y, z, x) ∧

τ(φ){x/y} ∧ τ(ψ){x/z}).

• M, i φ D ψ if and only if there are j and k such that C(j, i, k), M, j φand M, k ψ if and only if, by the inductive hypothesis and by applying

Page 54: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

42 3. Split logics of intervals

two substitutions, N |= τ(φ){x/y}[y 7→ j] and N |= τ(ψ){x/z}[z 7→ k], and,by Lemma 3.5.1, N |= c(y, x, z)[j, i, k] if and only if N |= ∃y∃z.

(c(y, x, z) ∧

τ(φ){x/y} ∧ τ(ψ){x/z}).

• M, i φ T ψ if and only if there are j and k such that C(i, j, k), M, j φand M, k ψ if and only if, by the inductive hypothesis and by applyingtwo substitutions, N |= τ(φ){x/y}[y 7→ j] and N |= τ(ψ){x/z}[z 7→ k], and,by Lemma 3.5.1, N |= c(x, y, z)[i, j, k] if and only if N |= ∃y∃z.

(c(x, y, z) ∧

τ(φ){x/y} ∧ τ(ψ){x/z}).

Corollary 3.5.4. SL is embeddable in MSO [↓0, ↓1, <] over the class of bounded orω-layered structures. Hence, SL is decidable over such classes.

3.6 The classical fragment of SL

In the previous sections we have proved that split logics can be considered as fragmentsof the first-order theory of layered structures in the language MFO[<1, <2, ↓0, ↓1] overbounded or dense split frames, and as fragments of MFO[<2, ↓0, ↓1] over discrete splitframes. By inspecting the proof of Theorem 3.5.3 it can be verified that the giventranslations can be done using at most three variables, and that every first-order for-mula contains exactly one free variable, which intuitively marks the current interval.Moreover, such a translation actually maps split formulas into particular restrictionsof the previous theories, namely the guarded fragment ([9]) GF3 of MFO[<1, <2, ↓0, ↓1](of MFO[<2, ↓0, ↓1] for UULSs) with three variables and predicates at most ternary.It is possible to show that also every GF3-formula has an equivalent translation intosplit logic.

Let us first of all consider the case of n-LS s and DULSs (whose first-order languageis the same). We start by considering the guarded fragment GF3 of MFO[<1, <2

, ↓0, ↓1] restricted to three variables one of which is free.

Page 55: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

3.6. The classical fragment of SL 43

Definition 3.6.1. Let t be the following translation function:

t(x = x) = true;t(x <1 x) = false;t(x <2 x) = false;

t(P (x)

)= p;

t(↓i(x, x)

)= false, with i = 0, 1;

t(∃y (x <1 y ∧ φ(y))

)= 〈D〉(¬〈D〉true ∧ 〈F〉(t(φ) ∨ 〈D〉t(φ)))∨∨ ¬〈D〉true ∧ 〈F〉(t(φ) ∨ 〈D〉t(φ));

t(∃y (y <1 x ∧ φ(y))

)= 〈D〉(¬〈D〉true ∧ 〈P〉(t(φ) ∨ 〈D〉t(φ)))∨∨ ¬〈D〉true ∧ 〈P〉(t(φ) ∨ 〈D〉t(φ));

t(∃y (x <2 y ∧ φ(y))

)= 〈D〉t(φ);

t(∃y (y <2 x ∧ φ(y))

)= 〈D〉t(φ);

t(∃y (↓0(x, y) ∧ φ(y))

)= t(φ) C true;

t(∃y (↓1(x, y) ∧ φ(y))

)= true C t(φ);

t(∃y (↓0(y, x) ∧ φ(y))

)= true T t(φ);

t(∃y (↓1(y, x) ∧ φ(y))

)= true D t(φ);

t(∃y (x = y ∧ φ(y))

)= t(φ(x));

t(¬φ) = ¬t(φ);t(φ ∧ ψ) = t(φ) ∧ t(ψ).

Theorem 3.6.2. Let (I,<,≺) be a bounded (resp., dense) split frame, let (I, ↓0, ↓1, <)an n-layered (resp., downward unbounded) structure, and let φ(x) be a formula of thelanguage GF3(x)[↓0, ↓1, <1, <2]. Then,

(I, ↓0, ↓1, <) |= ∀P1 · · · ∀Pm∀x. φ(x) ⇐⇒ (I,<,≺) t(φ(x)),

where P1, . . . , Pm are the unary predicate symbols occurring in φ(x).

Proof. Recall that <1 and <2 are definable in MSO [↓0, ↓1, <], so formulas with <1

and <2 can be evaluated in layered structures.let N = (I, ↓0, ↓1, <, P1, . . . , Pm) be any labeled bounded or downward unbounded

layered structure, let p1, . . . , pm be the propositional variables occurring in t(φ(x))and let M = (I,<,≺, V ) be a model based on (I,<,≺), where V (pi) = Pi. We onlyneed to prove that

N |= φ(x)[x 7→ i] ⇐⇒ M, i t(φ(x)).

The proof proceeds by induction on the complexity of φ. Atomic cases are all straight-forward.

• N |= ¬φ(x)[i] if and only if N 6|= φ(x)[i] if and only if M, i 1 t(φ(x)) if and onlyif M, i ¬t(φ(x));

Page 56: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

44 3. Split logics of intervals

• N |= φ(x) ∧ ψ(x)[i] if and only if N |= φ(x)[i] and N |= ψ(x)[i] if and onlyif M, i t(φ(x)) and M, i t(ψ(x)) if and only if M, i t(φ(x)) ∧ t(ψ(x));

• Suppose that N |= ∃y (x <1 y ∧ φ(y))[i]; then, there is j such that N |= x <1

y[i, j] and N |= φ(y)[j]. The latter truth relation implies, by the inductivehypothesis, that M, j t(φ(y)). The former holds when j is in a tree before thetree containing i, so i ≺ j. By applying max, there are two maximal intervalsm,m′ such that i v m and j v m′, and m ≺ m′. By combining these semanticrelations, we get M, i 〈D〉(¬〈D〉true∧〈F〉(t(φ)∨〈D〉t(φ)))∨¬〈D〉true∧〈F〉(t(φ)∨〈D〉t(φ)). The other implication is developed in a similar way.

• The formulas with <2 are immediate, as they directly correspond to the trans-lation of 〈D〉 and 〈D〉.

• N |= ∃y (↓0(x, y) ∧ φ(y) if and only if there is j such that N |= ↓0(x, y)[i, j]and N |= φ(y)[j] if and only if M, i |= t(φ(x)) C true.

Lemma 3.6.3. Every SL-formula is equivalent to a GF3(x)[↓0, ↓1, <1, <2] formula.

Proof. Given an SL-formula φ, it is sufficient to prove that its translation τ(φ) isequivalent to a GF3-formula. Only the translations of 〈F〉 and 〈P〉 are not immediate.In n-LS s and DULS s it is sufficient to note that τ(〈P〉φ) is equivalent to the guardedformula ∃y (y <1 x∧ τ(φ){x/y})∨ ∃z (↓0(z) ≤2 y ∧ ∃y (↓1(z) ≤2 x∧ τ(φ){x/y})). 〈F〉has a similar translation.

Therefore, what Theorem 3.6.2 gives is the following result.

Corollary 3.6.4. SL is expressively complete with respect to GF3(x)[↓0, ↓1, <1, <2].

3.7 On Decidable Extensions of SLThe language of SL can be extended with other interval operators. We now lista few and give their translation into MFO [<1, <2, ↓0, ↓1]. Such translations, giventhe results of Section 3.5, imply the decidability of the extended logic. Besides, thefollowing formulas are not GF3-formulas: we conjecture that they are not equivalentto any GF3-formula and that the logics obtained by adding these operators are non-conservative (decidability-preserving) extensions of SL.

Given any split model M and any interval i, we define the semantics of the begin-ning subinterval and ending subinterval operators 〈B〉 and 〈E〉, and of the meetinginterval, operator 〈A〉 as follows:

• M, i 〈B〉φ iff there is j such that j starts i and M, j φ;

• M, i 〈E〉φ iff there is j such that j ends i and M, j φ;

• M, i 〈A〉φ iff there is j such that i meets j and M, j φ.

Page 57: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

3.8. On the semantics of split logics 45

We use the following definition as abbreviations:

y starts x , x <2 y ∧ ¬∃z (x <2 z ∧ ∃w (↓0(w) ≤2 z ∧ ↓1(w) ≤2 y));

y ends x , x <2 y ∧ ¬∃z (x <2 z ∧ ∃w (↓0(w) ≤2 y ∧ ↓1(w) ≤2 z));

maximal(x) , ¬∃y. y <2 x.

The translation τ (Definition 3.5.2) can be extended accordingly:

τ(〈B〉φ) = ∃y (y starts x ∧ τ(φ{x/y}));τ(〈E〉φ) = ∃y (y ends x ∧ τ(φ{x/y}));τ(〈A〉φ) = ∃y∃v∃w∃z

(↓0(z) = v ∧ ↓1(z) = w ∧ (x ends v ∨ x = v)∧

∧ (y starts w ∨ y = w) ∧ τ(φ{x/y}))∨ ∃y∃t∃u

(maximal(t)∧

∧maximal(u) ∧ t <1 u ∧ ¬∃z (t <1 z <1 u) ∧ (x ends t ∨ x = t)∧∧ (y starts u ∨ y = u) ∧ τ(φ{x/y})

).

3.8 On the semantics of split logicsInterval logics interpreted over split models differ from those interpreted over canon-ical models essentially for the absence of properly overlapping intervals (which is aconsequence of the strong-lin* property) , which entails a tree-like structure. Asimilar approach has been followed in [20], where an extended temporal logic inter-preted over ordered trees is proposed.

As we have seen in Section 3.5, decidable propositional interval logics are obtainedby restricting the class of models in this way. This is an alternative approach withrespect to other semantic restrictions such as locality or homogeneity: over splitmodels such principles are not required.

It is tempting to investigate if, and how, formulas interpreted over split modelsare related to formulas interpreted over more familiar interval models, such as theintervals over the (positive) rationals or over the natural numbers.

In the following, we compare the semantics of formulas over U and D with theirevaluation over the canonical interval structures9 INT (N) and INT (Q+), respectively.

We have already seen (Section 3.4.1) that C, D and T are strongly affected by thesplit condition. Consider the chop operator (the situation for D and T is similar, ofcourse). The formula p C q ∧ ¬p C ¬q is not satisfiable over split models; conversely,(p C q) C r ↔ p C (q C r) is valid over INT (N) and INT (Q+), but not over U and D,that is, associativity does not hold for the binary modalities over split models. Unaryoperators seem less constrained. The situation, however, is not much better. Let usanalyze the discrete case first.

Theorem 3.8.1. Let τ ∈ {{〈D〉}, {〈D〉}, {〈P〉}, {〈F〉}}. Then, there is a τ -formula φthat is valid on the discrete frame, but φ is not valid on INT (N).

9We write INT (N) to denote the interval structure (INT (N),<,≺), and similarly for INT (Q+).

Page 58: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

46 3. Split logics of intervals

Proof. The following formulas are valid on U but not on INT (N).

• φ = [D][D][D]false∧∧6

i=1

(〈D〉(

∧6j=1j 6=i¬pj ∧ pi ∧ q)

)→ [D]q is valid on U, but not

on INT (N); φ intuitively expresses the existence of an interval having exactly sixsubintervals (it is easy to check that such an interval does not exists in INT (N)).

• φ = [D][D](¬p∧¬q)∧〈D〉p∧〈D〉q → 〈D〉(p∧q) is valid on U, but not on INT (N);φ expresses the fact that every interval has a unique next superinterval (inINT (N), in general, every interval has two immediate superintervals, e.g. [m,n]extends to [m− 1, n] and [m,n+ 1]).

• φ = 〈P〉〈P〉〈P〉true ∧ [P][P][P][P]false ∧∧4

i=1

(〈P〉(

∧4j=1j 6=i¬pj ∧ pi ∧ q)

)→ [P]q is

valid on U (the antecedent being true only at 03), but not on INT (N); φ assertsthat there is an interval that has exactly four intervals in the past (it is easy tocheck that such an interval does not exists in INT (N)).

• Let φ = [F][F](¬p ∧ ¬q) ∧ 〈F〉p ∧ 〈F〉q → 〈F〉(p ∧ q). Then the formula φ ∨ 〈F〉φasserts that every interval has either a unique right neighbor or there is a futureinterval having such property. Such formula is valid on U (because atomicintervals have a unique right neighbor), but it is clearly not valid on INT (N),where every interval have an infinite number of neighbors.

Note that all the formulas in the above proof exploit the ability of counting thenumber of intervals in a certain part of the structure.

For the converse implication the following holds.

Theorem 3.8.2. Let τ ∈ {{〈D〉}, {〈P〉}}. Then, there is a τ -formula φ that is validon INT (N), but φ is not valid on U.

Proof. The following formulas will do the trick:

• φ = [D][D][D]false ∧∧5

i=1

(〈D〉(

∧5j=1j 6=i¬pj ∧ pi ∧ q)

)→ [D]q is valid on INT (N),

but not on U; φ intuitively expresses the existence of an interval having exactlyfive subintervals (every interval in U has an even number of subintervals).

• φ = 〈P〉〈P〉〈P〉true ∧ [P][P][P][P]false ∧∧6

i=1

(〈P〉(

∧6j=1j 6=i¬pj ∧ pi ∧ q)

)→ [P]q is

valid on INT (N), but not on U; φ asserts that there is an interval that hasexactly six intervals in the past (it is easy to check that such an interval doesnot exists in U).

One case gives us a positive result.

Theorem 3.8.3. Let φ be a {〈D〉}-formula. If INT (N) φ then U φ.

Page 59: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

3.8. On the semantics of split logics 47

Proof. Let φ be a {〈D〉}-formula. If INT (N) φ, in particular If INT (N), [0, 1] φ.But the set of intervals that [0, 1] can see is linearly ordered with respect to <, so itcan be mapped onto any ascending path in U. Hence, U φ.

The dense case does not seem as simple. First of all, a crucial difference betweensplit models and intervals on the rationals is that in the former case < is discrete,while in the latter the subinterval relation is dense. So, we virtually immediately getthe following.

Theorem 3.8.4. Let τ ∈ {{〈D〉}, {〈D〉}}. Then, there is a τ -formula φ that is validover INT (Q+), but φ is not valid on D.

Proof. The standard formula for density will do: 〈D〉p → 〈D〉〈D〉p, and 〈D〉p →〈D〉〈D〉p.

Theorem 3.8.5. There is a {〈D〉}-formula φ that is valid on the dense frame, but φis not valid on INT (Q+).

Proof. The following formula is valid on D but not on INT (Q+).

• 〈D〉p∧ 〈D〉q → 〈D〉(p∧ q)∨ 〈D〉(p∧ 〈D〉q)∨ 〈D〉(q ∧ 〈D〉p) is valid on D, but noton INT (Q+); φ expresses the “linearity” of the superinterval relation on splitmodels (the intervals above a given interval are linearly ordered with respectto <).

For the remaining cases the problem is open. Table 3.1 summarizes the situation.

Table 3.1: Transfer of validity.

DiscreteINT (N)→ U U→ INT (N)

〈D〉 no no〈D〉 yes no〈P〉 no no〈F〉 ? no

DenseINT (Q+)→ D D→ INT (Q+)

〈D〉 no ?〈D〉 no no〈P〉 ? ?〈F〉 ? ?

Page 60: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

48 3. Split logics of intervals

It should be noted that, although the above results are mostly negative, theremight be subclasses of formulas for which an equivalence could be established (e.g.,in dense models, formulas with the subinterval operator that do not entail density).In such a case, the decidability of split logic would transfer to the canonical case.

3.9 Applications of split logicsDespite their seemingly awkward semantical behavior—as it may be perceived com-pared to the “naïve” grasp of the meaning of interval relations—split logics may haveinteresting applications. We have already mentioned that they may be used to isolatedecidable fragments of interval logics. But split logics seem suitable to applicationsin computational linguistics, where the linear order of words in a sentence may beinterpreted as the time of speech, and constituent structures may be viewed as hi-erarchies of intervals. Properties of (English) sentences can easily be expressed, e.g.“After paragraph three, every noun is preceded by an adjective” can be formulatedas par(3) ∧ [F](noun → 〈A〉adj); or, “Consecutio temporum in type-II if-clauses is re-spected” may translate into type-II → (〈D〉simple-past) C (〈D〉(would ∧ 〈A〉infinitive)),and so on.

In the context of the analysis of a sentence in a natural language, the failing ofassociativity for the chop operator turns out to be a positive feature, as it allowsto resolve ambiguities: “Fruit flies like a banana” can be chopped as

((fruit flies) C

like)

C a banana or, possibly, as (fruit C flies) C like a banana.So, split logics may be used as specification formalisms for parsers or for grammat-

ical rules. They might also be helpful for the automatic acquisition of a grammar,10

which can be formulated in the following terms: the input is a (potentially infinite)sequence of analyzed sentences S1, S2, . . . (i.e. constituent structures without nonter-minals), generated by an unknown grammar G within a fixed class of grammars K.The goal is to find a sequence G1, G2, . . . ∈ K such that each Gi is consistent withthe examples S1, . . . , Si, and there exists a step t such that Gt is equivalent to theunknown grammar. The sequence of examples might be mapped onto a split model,and the output might be given as a set of formulas (possibly in some “clausal” theory)that are consistent with the model.

10We thank prof. Alexander Dikovsky for pointing out this problem.

Page 61: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

4Layered interval graphs of

constraints

In the previous chapters we have taken into account the qualitative aspects of intervalrelationships and reasoning. But the interval framework leads itself in a natural wayto quantitative analysis. We have stressed the fact that intervals have a duration, incontrast to dimensionless instants: so, one may ask how long an interval lasts, howfar two intervals are from each other, and how much they overlap. It is not difficultto provide a period structure with a metric, and to formalize questions about themeasurability of periods and about the quantitative relationships among them.

It is not the aim of this chapter, however, to provide such a formalization. Rather,we will focus our attention on finite linear structures, and we will describe an efficientalgorithm that solves distance constraints among intervals. Our choice is motivatedby a practical problem: the approximate search of “compound patterns” in biologicalsequences (see Section 4.3.1). This chapter is an extended version of [53].

4.1 IntroductionLet In = (I[Ln],<,≺) be the closed-interval structure over the finite linear order-ing Ln = ({1, . . . , n}, <) where < has the obvious interpretation. Let y − x be thelength of the interval [x, y]. Let M = (In, V ) be a model over In, where V associatespropositional variables among P1, . . . , Ps to the intervals of M. The problem we wantto solve is to determine the existence, or to output all the instances, of sequences ofintervals satisfying given propositions and quantitative constraints on their relativeposition. Examples of questions we want to give an answer to are:

1. Is there an interval i in M of length a where P1 holds, such that there isan interval j that starts during i, and j has length between 2a and 3a andsatisfies P2?

2. Find all the sequences of intervals i1, . . . , ik in M such that i1 ≺ · · · ≺ ik, eachij has length 2j and satisfies Pj , and the distance between ij and ij+1 is nomore than j · k.

Page 62: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

50 4. Layered interval graphs of constraints

Such questions can be restated as constraint satisfaction problems (CSP for short).Intuitively, a constraint satisfaction problem is a set of requirements about the valuesthat a finite number of variables, each one ranging over a given domain, may as-sume (see [6]). For the purposes of the present introduction, the variables will denoteendpoints of intervals, and the domains will be subsets of {1, . . . , n}. Consider, forinstance, the first of the two problems above: let i = [x1, y1] and j = [x2, y2]. Then,we may reformulate the question by the following set of constraints:

y1 − x1 = a,

2a ≤ y2 − x2 ≤ 3a,0 ≤ y1 − x2 ≤ a,

where the first two expressions constrain the length of the intervals, and the thirdone expresses the desired relationship between i and j: the beginning point of j mustbe contained into i. Besides, the variables must range over suitable domains: thedomain of x1 is Dx1 = { c | ∃d. [c, d] ∈ I[Ln]∧ [c, d] ∈ V (P1) }, and the domain of y2 isDy2 = { d | ∃c. [c, d] ∈ I[Ln]∧ [c, d] ∈ V (P2) }. So, the problem can be translated intothe question whether the above constraint satisfaction problem over finite domains isconsistent.

For 1 ≤ j ≤ k, let ij = [xj , yj ]. The second problem can be reformulated as a setof constraints of the form:

yj − xj = 2j ,

0 ≤ xj+1 − yj ≤ j · k.

Moreover, the domain of each xj (resp., yj) is the set of left endpoints (resp., rightendpoints) of intervals satisfying Pj . So, the original problem now amounts to findingall the solutions of the above constraint satisfaction problem.

In general, the constraints that we will allow are of two types: either inequalitiesspecifying the length of one interval or inequalities that relate the right endpoint ofan interval to the left endpoint of the next interval. So, given two intervals [x1, y1]and [x2, y2], the general form of admissible constraints of the first type is

a ≤ y1 − x1 ≤ b,c ≤ y2 − x2 ≤ d,

where a, b, c, d ∈ N, and the general form of admissible constraints of the second typeis

e ≤ x2 − y1 ≤ f,where e, f ∈ Z.

4.2 A simplified algorithmIn this section we describe a simplified version of an algorithm to solve the kind ofconstraint satisfaction problems we have outlined at the beginning of this chapter.This will serve to introduce the fundamental ideas used in the general algorithm.

Page 63: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

4.2. A simplified algorithm 51

Let D1 = (D1, <), . . . ,Dk = (Dk, <) be finite strict linear orderings of integers,let x1, . . . , xk be variables ranging over D1, . . . , Dk, respectively, and let ai, bi ∈ Z,for 1 ≤ i < k. We give an algorithm for solving the following constraint satisfactionproblem:

C ,

a1 ≤ x2 − x1 ≤ b1,

...ak−1 ≤ xk − xk−1 ≤ bk−1,

(4.1)

where x1 ∈ D1, . . . , xk ∈ Dk. We denote the constraint involving variables xi and xi+1

by C[xi, xi+1]. If a pair of elements di ∈ Di and di+1 ∈ Di+1 satisfies C[xi, xi+1], thenwe write (di, di+1) ∈ C[xi, xi+1].

The main idea is that we can build a graph whose nodes are the elements ofthe finite domains, and each edge joins two nodes that satisfy the correspondingconstraint. We will show that:

1. such construction can be performed in time and space that are linear in the size(i.e., the number of nodes) of the graph;

2. infeasible nodes, that is nodes that do not participate in any solution of theCSP, can be detected in linear time;

3. the graph can be transformed in linear time into another graph, which is alinear-space representation of all the solutions of the original CSP.

Note that, in general, the number of different solutions of the above CSP growsexponentially in the number of variables involved.

Definition 4.2.1. The (explicit) constraint graph for (4.1) is a directed acyclic graphG = (

⋃ki=1Di, E) where (a, b) ∈ E if and only if, for some 1 ≤ i < k, a ∈ Di,

b ∈ Di+1 and (a, b) ∈ C[xi, xi+1]. Every node without entering edges is called asource, and every node without outgoing edges is called a leaf.

Remark 4.2.2. It is easy to verify that a k-tuple d1, . . . , dk is a solution of (4.1) ifand only if (d1, d2), (d2, d3), . . . , (dk−1, dk) ∈ E.

The number of edges in a constraint graph can be quadratic in the sum of thecardinalities of the domains. In what follows, we develop a compact way to representall such solutions by manipulating an implicit representation of the constraint graph.As we have assumed that the domains are ordered, we can build the closed-intervalstructure (I[Di],<,≺) over each domain Di. Then, for each node of the explicitconstraint graph, only two outgoing edges are necessary: they are directed to theendpoints of the interval of elements in the next domain that satisfy the correspondingconstraint. This is a consequence of the peculiar form of (4.1): it is trivial to checkthat, if (a, b), (a, c) ∈ C[xi, xi+1] and b < c, then (a, d) ∈ C[xi, xi+1] for every d suchthat b < d < c.

Page 64: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

52 4. Layered interval graphs of constraints

Definition 4.2.3. The interval [b, c] ∈ I[Di] is induced by a ∈ Di−1 if (a, b), (a, c) ∈C[xi−1, xi]. An interval [b, c] induced by a is maximal if there is no [d, e] induced by asuch that [b, c] < [d, e]. We denote the maximal interval i induced by a with a→ i, ifsuch i exists; we write a→ ∅ otherwise.

This point of view based on the notion of an interval leads to an equivalent defi-nition for the constraint graph.

Definition 4.2.4. The implicit constraint graph for (4.1) is the relational struc-ture G = (V, E), where V =

⋃ki=1Di and E = { a → x | a ∈ N } is the set of

maximal intervals induced by the elements of V . A path of length l − 1 in G is asequence of elements a1, . . . , al ∈ V such that, for 1 ≤ i < l, there is ai → j ∈ E suchthat ai+1 ∈ j.

An implicit constraint graph can be depicted as a directed acyclic graph in whicheach node is either a leaf or it has two outgoing edges directed towards two nodesbelonging to the next domain. The explicit constraint graph can be recovered byadding to such graph all the “internal edges”: for every a → [b, c] in the implicitgraph, and b ≤ d ≤ c there is an edge (a, d) in the explicit constraint graph for thesame CSP. The notion of a path in G corresponds in an obvious way to the notionof a path in G. Given such equivalence, building a constraint graph amounts todetermining the maximal intervals induced by all the nodes. To do this in an efficientway, we may consider the possible Allen’s relations between two induced intervals.

Lemma 4.2.5. Let a, a′ ∈ Di such that a < a′. Suppose that a → [b, c] and a′ →[d, e] are the nonempty maximal intervals induced by a and a′ respectively. Then,either [d, e] = [b, c], or [d, e] ends [b, c], or [d, e] overlaps [b, c], or [d, e] ≺ [b, c].

Proof. Let C[xi+1, xi] be ai ≤ xi+1 − xi ≤ bi. Then, by hypothesis,

ai ≤ b− a ≤ c− a ≤ bi,ai ≤ d− a′ ≤ e− a′ ≤ bi.

As a < a′, we have ai < d − a, and, since [b, c] is maximal, we get b ≤ d. Similarly,we have c− a′ ≤ bi and, since [d, e] is maximal, we get c ≤ e.

By Lemma 4.2.5, maximal induced intervals can be determined by scanning thenodes of each Di in increasing order, without ever going back, i.e. a linear scan willdo. Algorithm 1 gives a description of the procedure.

In general, the constraint graph will contain nodes that do not participate in anysolution of the original CSP, so they must be deleted from the graph. Such infeasiblenodes can be easily identified: by Remark 4.2.2, they do not belong to any path oflength k− 1. So, if a node n belongs to Di, and the length of the longest path from asource to n is not i− 1, or the length of the longest path from n to a leaf is not k− i,then that node is infeasible. So, we may compute such lengths for every node, anddetermine which nodes are feasible.

Page 65: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

4.2. A simplified algorithm 53

Algorithm 1 Implicit Constraint Graph ConstructionRequire: occurrences in each Di must be sorted.

1: Build-Constraint-Graph2: V ←

⋃ki=1Di

3: E ← ∅4: for i← 1 to k − 1 do {For each layer but the last}5: lp ← 16: for every element x ∈ Di, in increasing order, do7: {Determine the left endpoint of the maximal interval induced by x}8: while lp ≤ |Di+1| and Di+1[lp]− x < ai do9: lp ← lp + 1

10: end while11: if lp ≤ |Di+1| and Di+1[lp]− x ≤ bi then12: E ← E ∪ {(x,Di+1[lp])} {Add edge}13: end if14: end for15: rp ← 116: for every element x ∈ Di, in decreasing order, do17: {Determine the right endpoint of the maximal interval induced by x}18: while rp ≥ 1 and Di+1[rp]− x > bi do19: rp ← rp − 120: end while21: if rp ≤ 1 and Di+1[rp]− x ≤ ai then22: E ← E ∪ {(x,Di+1[rp])} {Add edge}23: end if24: end for25: end for26: return the implicit constraint graph G =

(V, E

)

As we are manipulating the implicit representation of the graph, however, wecannot simply delete the infeasible nodes. We must first check whether there aremaximal induced intervals whose endpoints are infeasible, and “shrink” the intervalsaccordingly, that is replace such intervals with maximal subintervals having feasibleendpoints.

Algorithm 2 computes a transformation of the graph that returns a compact repre-sentation of all the solutions. In fact, at the end of the execution, every node inducesa nonempty closed interval made of feasible points: therefore, every path from a nodein D1 reaches a leaf in Dk: then, by definition, it is a solution of (4.1). Besides, thereare no sources in D2, . . . , Dk, and there are no leaves in D1, . . . , Dk−1, because suchnodes would be infeasible nodes.

Page 66: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

54 4. Layered interval graphs of constraints

Algorithm 2 Find all the solutions of the CSP1: for every 1 ≤ i ≤ k do2: for each node n ∈ Di do3: compute the length L;n of the longest path from a source to n4: compute the length Ln; of the longest path from n to a leaf5: if L;n = i− 1 and Ln; = k − i then6: mark the node as “feasible”7: else8: mark the node as “infeasible”9: end if

10: end for11: end for12: for all maximal induced intervals a→ [b, c] in the graph do13: replace [b, c] with the maximal subinterval [b′, c′] v [b, c] such that [b′, c′] has

feasible endpoints14: end for15: Delete all infeasible endpoints from the graph

4.3 Finding structured motifs

In this section we describe a generalized version of the constraint solver of the preced-ing sections. Before giving the relevant definitions, we shortly explain the motivationthat lead to the development of our algorithms, and the related work in that context.

4.3.1 The application context

A relevant task of computational biology consists in identifying conserved featuresin a set of DNA or protein sequences. The great amount of raw biological datain databases needs to undergo a process of analysis and interpretation in order toproduce meaningful biological information. This step is called “annotation” and it isthe conditio sine qua non to obtain from large sequence data a contextual increasing inbiological knowledge ([56]). At nucleotide level, annotation comprises different tasks:gene finding, searching for non-coding RNAs and for regulatory regions, identificationof large segmental duplications, identification of repetitive elements.

We will focus on the localization of structured motifs, which can be thought ofas “compound patterns” made of a list of simple motifs and a list of intervals thatspecify at what distances adjacent motifs should occur (see [12]). In what follows, theterms “motif” and “pattern” will be used interchangeably.

As a concrete example, a significant biological problem consists in finding a partic-ular kind of transposable elements called LTR retrotransposons ([37, 36]). The overallstructure of a retrotransposon is shown in Figure 4.1. They are characterized by anapproximate repetition of a sequence (the so called Long Terminal Repeats, LTRs forshort) that varies in size from 100 base pairs to several kilobases. Therefore, one

Page 67: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

4.3. Finding structured motifs 55

LTR

PBS

POL

GAG RT RH INAP

PPT

LTR

Figure 4.1: A complete LTR-retrotransposon belonging to the Gypsy family. Two longterminal repeats (LTRs) delimit encoded gene products (gag and pol) and other strongsignals such as a primer-binding site (PBS) and a polypurine tract (PPT).

can try to locate retrotransposons by identifying such repeats. This can be done byprograms like REPuter ([38]) or by more specific tools like LTR_STRUC ([42]).

Sometimes, when one or both LTRs are missing, this approach cannot be pursuedand it is necessary to search for conserved domains inside the retroelement. Dataavailable through experiments ([10, 60]) have allowed to establish, by multiple align-ment, a number of conserved features. For example, many retrotransposons belongingto the Ty1-copia group contain, in correspondence to the gene encoding the reversetranscriptase, a match of:

MT[115, 136]MTNTAYGG[121, 151]GTNGAYGAY,

which consists of three patterns (MT, MTNTAYGG and GTNGAYGAY) written in the IUPACalphabet, and two intervals imposing constraints on the relative distances betweenadjacent patterns.

Another class of structures that is amenable to be represented as a structured motifis given by Helitrons. Helitrons are a category of eukaryotic DNA transposons that hasbeen recently characterized. Helitrons transpose by rolling circle replication; they havefew conserved sequence features: 5′-TC and CTRR-3′ termini, 16 to 20 bp hairpinsseparated by 10–12 nucleotides from the 3′-end and transpose precisely between the5′-A and T-3′, with no modifications of the AT target; they do not have terminalrepeats and their length can reach a dimension up to 15 Kbps ([33]). They seem tohave played an important role in genomes evolution, constituting up to 2% of both theArabidopsis thaliana and Caenorhabditis elegans genomes; in maize large and highlyrepetitive Helitron insertions were proven to be responsible for mutations ([40]). Theweakness of their conserved signals in this particular class of transposable elementsin plant genomes makes it an ideal candidate for searching with the tool like the onewe describe in Section 4.3.8. We will say more about this in Section 4.4.

In general, structured models span from a few to a few hundreds bases and havegaps of even several dozens bases. Although they are usually specified by the IUPACalphabet, an effective search requires allowing a positive (although in general verysmall) number of errors. But that is not enough yet: when searching for complexstructured motifs it is likely that not all of their component patterns will be found inthe searched sequence. Nonetheless, if enough patterns are present we may say thatan approximate occurrence of the structured motif has been found. This leads us tothe problem of locating partial matches.

Page 68: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

56 4. Layered interval graphs of constraints

4.3.2 Related work

Structured motifs are called Classes of Characters and Bounded Gaps (CBG) expres-sions in [50]. Although their definition is equivalent to the one used in this chapter,the use of these expressions is quite different: in [50], the underlying motivation isthat of giving an efficient algorithm for finding aminoacidic sequences in a databaselike PROSITE. A sequence of this kind is, for example, [RK]-x(2, 3)-[DE]-x(2, 3)-Y ,where brackets match any of the letters inside and x(2, 3) is a gap of length between2 and 3. In practice, the considered CBG expressions are usually not very long: theparts between gaps typically consist of a few characters and distances also span a fewletters. In their experiments, they used patterns for which the maximum length of amatch did not exceed the number of bits of a computer word. The algorithm givenin [50] is very efficient in solving the problem of finding such patterns, by making useof bit parallelism in implementing a non-deterministic ε-automaton. However, theiralgorithm becomes less efficient as gaps get longer, because the size of the automa-ton increases accordingly. Also, bit operations are more costly when they have to beperformed on several computer words instead of one.

[43] and [48] give an algorithm for finding network expressions with spacers, wherea network expression is a regular expression without Kleene star and spacers are dis-tance ranges between adjacent network expressions. Two algorithms are describedin [48]: the first is an approximate regular expression matching procedure based onthe construction of an ε-automaton called an alignment graph; the second is a back-tracking procedure with an optimization technique to determine the best backtrackingorder (according to a statistical criterion) . As [48], we use a separate subroutine inorder to search for simple motifs but our approach is not based on a backtrackingstrategy—instead, we build and solve a constraint satisfaction problem.

Constraint solving techniques have already been employed to the search of pat-terns in biosequences, e.g. [18]. However, as we only consider distance constraints,the constraint satisfaction problem we obtain is simpler than others proposed in theliterature, and the method we use to solve it is more specialized.

4.3.3 Basic definitions

For the sake of clarity, from now on we assume that the component patterns of astructured motif are DNA motifs written in the IUPAC alphabet and that they arematched either exactly or approximately under the unit cost scheme. We remark,however, that our approach can be applied also using different matching criteria, e.g.based on alignment procedures or weight matrices (see [29]).

We use the standard alphabets ΣIUPAC = {A, C, G, T, R, Y, W, S, M, K, H, B, V, D, N} andΣDNA = {a, c, g, t}. Given a string S = s1 · · · sn, we say that a string F is a factorof S if F = si · · · sj for some 1 ≤ i ≤ j ≤ n.

Definition 4.3.1. A structured model, or structured motif is a pair (P, I), whereP = (P1, . . . , Pk) is a sequence of patterns and I = ([l1, u1], . . . , [lk−1, uk−1]), withli, ui ∈ Z and li ≤ ui for 1 ≤ i < k, is a sequence of closed intervals [12]. A

Page 69: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

4.3. Finding structured motifs 57

structured motif is usually written as an expression of the form

P1[l1, u1]P2[l2, u2]P3 · · ·Pk−1[lk−1, uk−1]Pk. (4.2)

Definition 4.3.2. An exact match of (P, I) in a sequence S is a k-tuple (F1, . . . , Fk)of factors of S such that

1. Fi matches Pi, for 1 ≤ i ≤ k, possibly according to different matching criteria;

2. the distance di between the end position of Fi and the start position of Fi+1 issuch that li ≤ di ≤ ui, for 1 ≤ i < k.

Note that, although the structured motif is said to occur exactly, some or even allthe component patterns may occur approximately.

To search for partial matches, in Section 4.3.5 we derive constraints on non-adjacent patterns. In general terms, we can assume that for each pair of simplemotifs Pi and Pj we have a constraint C(i, j) on their relative distance. With thisassumption, we can give the following definition.

Definition 4.3.3. For an integer q such that 1 ≤ q ≤ k, a q-approximate match(briefly q-match) of (P, I) in a sequence S is a q-tuple (F1, . . . , Fq) of factors of Ssuch that

1. there is a sequence of indices 1 ≤ j1 < · · · < jq ≤ k such that Fi matches Pji,

for 1 ≤ i ≤ q, possibly according to different matching criteria;

2. the distance di between the end position of Fi and the start position of Fi+1 issuch that the constraint C(ji, ji+1) is satisfied, for 1 ≤ i < q.

The problem discussed in Section 4.3.1 is formalized as follows: given a structuredmodel (P, I) with k component patterns, a sequence S ∈ Σ∗

DNA and an integer q suchthat 1 ≤ q ≤ k, find all q-matches of (P, I) in S. For convenience we define q = k− q,i.e. q is a constant representing the maximum number of missing patterns in a validmatch.

The algorithm we are going to describe is a two-step procedure:

1. find the occurrences of all the component patterns of the structured model;

2. combine the occurrences that satisfy the distance constraints into a structuredmotif.

The first step reduces to using some standard pattern matching algorithm. The secondstep amounts to the definition and resolution of a CSP over finite domains in a waysimilar to what we have done in Section 4.2.

Page 70: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

58 4. Layered interval graphs of constraints

4.3.4 Searching for simple motifs

Since efficient algorithms exist for many of the pattern matching problems discussedin Section 4.3.3, we can decide to search for all the component patterns of (P, I)independently, then combine those occurrences which fit the model. Given a se-quence S = s1 · · · sn and a structured motif (P, I), the first step of our algorithmis: find all the occurrences of P1, . . . , Pk in S with edit distances (supplied by theuser) e1, . . . , ek, respectively. We assume that the output of the search is the list,sorted by start position, of the occurrences of the Pi’s, where each occurrence is apair (s, f) representing its start and its end position. For convenience, we define theend position f to be one character beyond the last character of a match. Table 4.1shows the result of searching for the component patterns of a structured motif in thesample sequence of Figure 4.2.

T G T a a a a C T g g T G T1 2 3 4 5 6 7 8 9 10 11 12 13 14

C T c a G G a G G C T c g C15 16 17 18 19 20 21 22 23 24 25 26 27 28

T c c G G a T A G G a A C A29 30 31 32 33 34 35 36 37 38 39 40 41 42

a A C A a a A C A a a a a a43 44 45 46 47 48 49 50 51 52 53 54 55 56

Figure 4.2: A sample DNA sequence. Matches to the simple motifs of the structured modelin Table 4.1 are shown with uppercase letters.

tgt: r11 = (1, 4), r12 = (12, 15);ct: r21 = (8, 10), r22 = (15, 17), r23 = (24, 26), r24 = (28, 30);gg: r31 = (19, 21), r32 = (22, 24), r33 = (32, 34), r34 = (37, 39);ta: r41 = (35, 37);

aca: r51 = (40, 43), r52 = (44, 47), r53 = (49, 52).

Table 4.1: The result of the exact search for the component patterns of the structuredmodel tgt[4, 20]ct[2, 5]gg[0, 1]ta[2, 15]aca in the sequence shown in Figure 4.2.

We say that a match of Pi is contained into another if there are two occur-rences (s, f) and (s′, f ′) of Pi such that s ≤ s′ < f ′ < f . We assume that thesearch for simple motifs never produces an occurrence that is contained into another.In particular, no two matches of the same pattern can have the same start position.The reason for this technicality is explained in Section 4.3.6.

Page 71: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

4.3. Finding structured motifs 59

The complexity of this step depends on which kind of search is required. When ei =0 for all i, Aho-Corasick algorithm can be applied, which runs in linear time. Thesame complexity can be achieved by preprocessing the sequence to build a suffix tree,which is what we have done in our implementation (see [29] for a thorough discussionof these topics). If ei > 0 for some i, some approximate pattern matching procedure isneeded. Multiple approximate string matching algorithms exist that achieve optimalaverage performance ([24]). Finally, the restriction that the output be sorted usuallydoes not require further computations, because most algorithms already produce asorted output.

4.3.5 Building the constraint graph

Different occurrences of simple motifs must then be combined into a valid occurrenceof the structured model. Let Di = {(si1, fi1), . . . , (simi

, fimi)} be the set of the start

and end positions of the found occurrences of Pi (see Section 4.3.4). A constraintsystem with variables X1, . . . , Xk, such that Xi ∈ Di, can be defined as follows.Adjacent patterns are constrained as specified by the structured model: for 1 ≤ i < kwe must have

li ≤ (Xi+1)1 − (Xi)2 ≤ ui, (4.3)

where (·)1 and (·)2 are the first and the second component of a pair, respectively.As we admit the possibility of missing at most q patterns, we must derive con-

straints on non-adjacent patterns. How to specify this is a matter of biological consid-erations rather than algorithmic ones. The question is: why is a pattern not found?One answer may be that the evolutionary process caused that pattern to be deletedfrom the sequence, thus shortening it. Another possibility is that the pattern degen-erated by mutations or our search criteria are too stringent: so, the pattern existsbut we are not able to detect it. To take into account at least these possibilities,we choose to generalize the interval condition to possibly non-adjacent patterns Pi

and Pi+h, for 1 ≤ i < k and 1 ≤ h ≤ min{k − i, q + 1}, as follows:

i+h−1∑r=i

lr ≤ (Xi+h)1 − (Xi)2 ≤ ui +i+h−1∑r=i+1

(|Pr|+ er + ur). (4.4)

where |Pr|+ er is the maximum length of a match of Pr according to the model. Wedenote the set of these constraints by C. For any distinct pair of variables, there is atmost one constraint involving those variables. The problem of finding q-matches ofa given structured model is equivalent to finding the solutions of all the C[X]’s suchthat X is a subsequence of variables Xi1 , . . . , Xi`

, with ` ≥ q.CSPs similar to this one, but over continuous intervals, have been investigated

in [13], where they are called simple temporal problems (STPs). The approach in [13],however, does not work when finite domains are considered in place of intervals.

Let M =∑k

i=1mi be the total number of occurrences of all the Pi’s and let rij ∈Di denote the jth occurrence of Pi. We define a linear ordering ≺ over each Di ∪{∞}, as follows: given two nodes r1 = (s1, f1) and r2 = (s2, f2) in the same Di,

Page 72: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

60 4. Layered interval graphs of constraints

r11 r12

r21 r22 r23 r24

r31 r32 r33 r34

r41

r51 r52 r53

D1

D2

D3

D4

D5

Figure 4.3: The constraint graph for q = 4, derived from the example in Table 4.1.

we say that r1 precedes r2, written r1 ≺ r2, if s1 < s2. Moreover, r ≺ ∞ forevery r. The immediate successor of a node r with respect to ≺ is written succ(r).We define succ(∞) =∞.

To deal with the possibility of missing patterns, we give the following generaliza-tion of the definition of an explicit constraint graph.

Definition 4.3.4. The (explicit) constraint graph for C is a directed acyclic graphwith M nodes labelled by the rij’s such that there is an edge from rij to r(i+h)l if andonly if the constraint1 C[Xi, Xi+h] is satisfied when Xi and Xi+h are instantiated byrij and r(i+h)l, respectively.

The set of nodes in the graph can be partitioned into k layers D1, . . . , Dk, eachone corresponding to the (ordered) set of occurrences of a component pattern. Toemphasize this, we denote the graph by ((D1, . . . , Dk), E), where

⋃ki=1Di is the set

of vertices and E is the set of edges. The edges connect only vertices between layersDi and Dj where 1 ≤ j− i ≤ q+1, and they are always directed towards a layer withhigher index. We denote an edge from node r to node r′ by r → r′. Figure 4.3 showsan example of such graph.

As we have seen in Section 4.2, to build the graph it is not necessary to store allthe edges explicitly. If r → r1, r → r2 ∈ E are two edges of the constraint graphand r1 ≺ r2, then for all nodes r3 such that r1 ≺ r3 ≺ r2 we have r → r3 ∈ E.The only difference with respect to the discussion in Section 4.2 is that now we allowfor at most q missing patterns: hence, every node needs to have at most 2(q + 1)outgoing edges to the successive q + 1 layers. For each layer, the first edge goesinto the occurrence with the lowest start position and the second edge goes into theoccurrence with the highest start position, that satisfy the corresponding constraint.We call these two edges the low edge and the high edge, respectively. The remaining

1We assume that the empty set of constraints is trivially satisfied.

Page 73: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

4.3. Finding structured motifs 61

r11 r12

r21 r22 r23 r24

r31 r32 r33 r34

r41

r51 r52 r53

D1

D2

D3

D4

D5

Figure 4.4: The implicit constraint graph, where infeasible nodes have been grayed. Asingle edge has been drawn where low and high edges coincided.

edges are implicitly determined. Given a low edge r → r′, where r ∈ Di and r′ ∈ Di+j ,we denote r′ by r.lowj and we say that r → r′ is the low j-edge of r. Similarly, ifr → r′ is a high edge, we denote r′ by r.highj , and we say that r → r′ is the high j-edgeof r. If a node r has no outgoing j-edges for some j, we define r.lowj = r.highj =∞.We call the representation of the graph by means of low and high edges the implicitrepresentation of the explicit constraint graph (see Figure 4.4). We denote the set oflow and high edges with E.

The construction of the implicit graph can be done in O(M) time under theassumption that the nodes in each layer are sorted. Low and high edges betweenlayers Di and Di+h can be determined in O(mi + mi+h) time by executing twolinear scan, the first determining all the low edges and the second all the highedges. Algorithm 3 gives a description of the procedure. The two innermost forloops (lines 9–17 and 20–29) take O(mi + mi+h) time to add O(mi) edges. Thisis done for

∑q+1h=1(k − h) pairs of layers. So, the time complexity in the worst case

is O(∑q+1

h=1

∑k−hi=1 (mi + mi+h)

)= O(M). The total number of edges is bounded

by 2(q + 1)M , so the space requirement is also O(M).

4.3.6 Properties of the constraint graph

Given a node r ∈ Di and an integer j, we denote the closed interval induced byrwith intj(r) = [r.lowj , r.highj ]. If r has no outgoing j-edges, then intj(r) = [∞,∞] =∅. Of course, each node induces at most q+1 non-empty intervals. The basic propertyof induced intervals is expressed by the following simple lemma.

Lemma 4.3.5. Let r ∈ Di. For each r′ ∈ intj(r), the constraint C[Xi, Xi+j ] issatisfied when instantiated with (r, r′).

Proof. By construction, the pairs r, r.lowj and r, r.highj both satisfy C[Xi, Xi+j ], i.e.

Page 74: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

62 4. Layered interval graphs of constraints

Algorithm 3 Constraint Graph ConstructionRequire: occurrences in each Di must be sorted by increasing start position.

1: Build-Constraint-Graph({|Pi|, ei, Di}1≤i≤k, {[li, ui]}1≤i≤k−1, q

)2: Let (D1, . . . , Dk) be the (layered) set of nodes of the graph3: E ← ∅4: for i← 1 to k − 1 do {For each layer but the last}5: for h← 1 to min{k − i, q + 1} do {and for each reachable layer}6: Let L and U be the lower and upper bound, respectively, on the relative

distance between two occurrences of Pi and Pi+h

7: {Determine low edge target}8: l← 1 {Low edge pointer}9: for j ← 1 to mi do {For each node in layer Di}

10: while l ≤ mi+h and s(i+h)l − fij < L do11: l← l + 112: end while13: if l ≤ mi+h and s(i+h)l − fij ≤ U then14: {Add low edge to (i+ h)th layer}15: E ← E ∪ {(sij , fij)→ (s(i+h)l, f(i+h)l)}16: end if17: end for18: {Determine high edge target}19: u← mi+h {High edge pointer}20: for j ← mi to 1 do21: while u > 0 and s(i+h)u − fij > U do22: u← u− 123: end while24: if u > 0 and s(i+h)u − fij ≥ L then25: {Add high edge to (i+ h)th layer}26: E ← E ∪ {(sij , fij)→ (s(i+h)u, f(i+h)u)}27: end if28: end for29: end for30: end for31: return the implicit constraint graph G =

((D1, . . . , Dk), E

)

Page 75: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

4.3. Finding structured motifs 63

(a) (b)

Figure 4.5: Two comparable induced intervals can only overlap or be disjoint.

they satisfy (4.4). By hypothesis, r.lowj � r′ � r.highj . So we have

(r.lowj)1 − (r)2 ≤ (r′)1 − (r)2 ≤ (r.highj)1 − (r)2.

Therefore, the pair (r, r′) satisfies C[Xi, Xi+j ], too.

For convenience, we write I1 B I2 if r2 ≺ r3, and I1 O I2 if r1 � r3 � r2 � r4.The following lemma expresses an important property of the graph, which we willextensively use in the sequel: only two relations are possible between comparableintervals induced by nodes in the same layer: either they overlap (Figure 4.5(a)) orone entirely precedes the other (Figure 4.5(b)).

Lemma 4.3.6. Suppose that no match of a component pattern is contained intoanother. Let r1 and r2 be two nodes of the constraint graph such that r1 � r2. If, fora given j, intj(r1) 6= ∅ then either intj(r1) O intj(r2) or intj(r1) B intj(r2).

Proof. If r1 = r2 then intj(r1) O intj(r2) for any j. So, suppose that r1 ≺ r2.If intj(r2) = ∅, then intj(r1) B intj(r2). Otherwise, by hypothesis, we have

L ≤ (r1.lowj)1 − (r1)2 ≤ (r1.highj)1 − (r1)2 ≤ U andL ≤ (r2.lowj)1 − (r2)2 ≤ (r2.highj)1 − (r2)2 ≤ U,

where L and U are computed as specified by (4.4). Let r1 = (s1, f1), r2 = (s2, f2),r1.lowj = (s3, f3), r1.highj = (s4, f4), r2.lowj = (s5, f5) and r2.highj = (s6, f6). Theabove inequalities can be rewritten as

L ≤ s3 − f1 ≤ s4 − f1 ≤ U and (4.5)L ≤ s5 − f2 ≤ s6 − f2 ≤ U. (4.6)

Since no match is contained into another, we also have f1 ≤ f2. Therefore, L ≤ s5−f1.Since (s3, f3) is, by hypothesis, the least occurrence satisfying the lower bound in (4.5),we must conclude that s3 ≤ s5, so r1.lowj � r2.lowj . A similar reasoning applies to s4and s6: from (4.5) and by using the hypothesis, we get s4 − f2 ≤ U . Since (s6, f6)is the maximum occurrence satisfying the upper bound in (4.6), we must concludethat s4 ≤ s6, and so r1.highj � r2.highj . Therefore, if r2.lowj � r1.highj , we haveintj(r1) O intj(r2), otherwise intj(r1) B intj(r2).

Page 76: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

64 4. Layered interval graphs of constraints

Corollary 4.3.7. r1.lowj � r2.lowj and r1.highj � r2.highj.

The correctness of the graph construction algorithm is based on Corollary 4.3.7.It means that, in order to draw low (resp., high) j-edges, it is sufficient to scan thenodes located j layers below from left to right (resp., from right to left) without evergoing back, i.e. a linear scan will do.

Also the nodes whose edges go into a given node r form an interval. This is whatthe following lemma states.

Lemma 4.3.8. Suppose that no match of a component pattern is contained intoanother. Let r1, r2 and r3 be three nodes such that r1 � r2 � r3. If intj(r1) 6= ∅ andintj(r1) O intj(r3), then intj(r2) 6= ∅, intj(r1) O intj(r2) and intj(r2) O intj(r3).

Proof. By Corollary 4.3.7, the only fact that must be proved is that intj(r2) 6= ∅.Let r1 = (s1, f1), r2 = (s2, f2), r3 = (s3, f3) and r3.lowj = (s4, f4). By hypothesis,we have L ≤ s4 − f3, where L has been computed according to the leftmost sumin (4.4). As the intervals induced by r1 and r3 overlap, then r3.lowj ∈ intj(r1),so, by Lemma 4.3.5, L ≤ s4 − f1. Moreover, f1 ≤ f2 ≤ f3, because no match iscontained into another. Thus, L ≤ s4 − f2. A similar reasoning allows us to provethat the upper bound is also satisfied. Then, r2 must have a j-edge to r3.lowj , thatis intj(r2) 6= ∅.

Given a node r ∈ Di, let parentj(r) = { r′ | r′ ∈ Di−j ∧ r′ → r ∈ E } be the set ofnodes in layer Di−j having an outgoing edge entering r (in the explicit graph). Wedefine parentj(r) = ∅ if j ≥ i. We call parentj(r) the parent (j-)interval of r. Thename is justified by the following corollary.

Corollary 4.3.9. For any node r and integer j, parentj(r) is an interval.

The endpoints of parent intervals can be determined in a way similar to inducedintervals and analogous properties can be proven.

4.3.7 How to output all the solutionsOnce the graph has been built, in order to get the solutions, i.e. all the q-matches ofthe structured motif, it is sufficient to output the paths (of the explicit graph) whoselength is at least q−1. Every such path corresponds to a valid match of the structuredmodel. The problem of what to report when searching for complex patterns such asregular expressions has been tackled by [49]. Using their terminology, componentpatterns can be seen as the tagged subexpressions of the translation of the structuredmotif into a regular expression. The problem with these approaches is that, in theworst case, the number of possible matches is exponential in the number k of sim-ple/tagged motifs. Although the constraint graph is, in practical cases, sparse—andso computing all the paths is not impractical—we can definitely do better than that.The idea is that we can give a suitable transformation of the graph as a convenientand compact output, which can be computed in time proportional to the size of thegraph.

Page 77: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

4.3. Finding structured motifs 65

Let us fix some terminology and notation. A source is a node that, in the explicitversion of the graph, has no incoming edges. A leaf is a node that has no outgoingedges. We denote a path from r to r′ with r ; r′. In the following, we always referto paths in the explicit representation of the graph. Given a node r, let L;r bethe length of the longest path from a source to r, and let Lr; be the length of thelongest path from r to a leaf. A node is feasible if L;r + Lr; ≥ q − 1. A feasiblenode represents an occurrence of a component pattern that certainly belongs to anapproximate or exact match to the structured motif. Conversely, an infeasible nodecannot belong to any solution.

If we are able to modify the low and high edges in a way that they always pointto feasible nodes, that is if we are able to shrink each induced interval [r1, r2] to amaximal subinterval [r′1, r

′2] such that r′1 and r′2 are feasible nodes, then the solution

can be implicitly characterized by the subgraph of the modified graph restricted tothe set of feasible nodes. Indeed, this is true only if q = k: if q < k, not necessarilyevery path from a source to a leaf spells a valid match, so some other manipulationof the graph is mandatory.

The first problem to solve is to determine L;r and Lr; for every r. All suchvalues can be computed in O(M) time by a careful propagation through induced(resp., parent) intervals. Such bound can be reached because the graph is acyclic andits edges span a number of layers bounded by a constant.

For a feasible r ∈ Di, it must be max{0, i−1−q} ≤ L;r ≤ i−1 and max{0, q−i} ≤Lr; ≤ k − i. We call such values the feasible values for nodes in layer Di. Now,suppose that all lengths are initialized to zero. The values associated with a nodeneed to be updated only if they can receive a larger and feasible value. If a node ris assigned only feasible values, L;r and Lr; must be updated at most a constantnumber of times, namely q+1 times, because this is the maximum number of differentfeasible values.

Algorithm 4 loops through all pairs of connected layers to compute the Lr;’sbottom up. For each layer Di, starting from the penultimate and going upwards,the adjacency sets of nodes r ∈ Di are examined and the maximum length value isdetermined. The adjacency sets are scanned by going through layers Di+1, . . . , Di+q+1

sequentially. For each pair Di and Di+j the procedure updates Lr; for each r ∈ Di

if the maximum length value in intj(r) is feasible and larger than the current valueof Lr; (lines 15–16). Nodes in layer Di+j are scanned from left to right, and twopointers are kept: rightend is the first node in Di+j not yet reached, and rmax is therightmost node (i.e., the maximum node with respect to ≺) in the interval intj(r)having the maximum length value if such value is feasible, otherwise it coincideswith rightend . Of course, it is always rmax � rightend .

The inner if clause (lines 10–14) avoids redundant computation by skipping theinterval of already scanned nodes whose maximum length value has already beencomputed. By doing so, nodes less than rmax are no longer taken into consideration.Let I1 and I2 be two induced intervals such that I1 O I2, and suppose that maxand rmax have been computed for I1. If rmax ∈ I2, then the maximum length valuein I1∩ I2 is max , so we only need to check the nodes in I2 \ I1 (line 11). If rmax 6∈ I2,we must scan all I2 (line 13), and nodes in I1 ∩ I2 are examined again. However, we

Page 78: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

66 4. Layered interval graphs of constraints

know that the maximum value in I1 ∩ I2 must be strictly less than max . So, if rmaxfor I2 happens to be in I1 ∩ I2, then the corresponding max must be less than theprevious value. This guarantees that after at most q + 1 steps rmax must be movedon, because the corresponding node has an infeasible value. Thus, for each pair oflayers Di and Di+j , the time needed to update the values in Di is O(mi+(q+1)mi+j).This work must be done for

∑q+1j=1(k−j) pairs of layers. Hence, the total time required

by Compute-Lr; is O(∑q+1

j=1

∑k−ji=1 (mi + (q + 1)mi+j)

)= O(M).

Algorithm 4 Compute Lr; for all nodes r

1: Compute-Lr;(G)2: for all nodes r ∈

⋃ki=1Di do

3: Lr; ← 04: end for5: for i← k − 1 to 1 do {For each layer but the last, in decreasing order}6: for j ← 1 to min{k − i, q + 1} do {and for each next feasible layer}7: rmax ← rightend ← the first node in Di+j

8: for all nodes r ∈ Di, in increasing order, do9: if intj(r) 6= ∅ then {If r has j-edges}

10: if rmax ∈ intj(r) then11: let max be the maximum among Lrmax; and the values in intj(r) ∩

[rightend ,∞]12: else13: let max be the maximum among the values in intj(r)14: end if15: if max is a feasible value then16: Lr; ← max{Lr;,max + 1}17: rmax ← the rightmost node r′ ∈ intj(r) such that Lr′; = max18: else {Skip infeasible nodes}19: rmax ← succ(r.highj)20: end if21: rightend ← succ(r.highj)22: end if23: end for24: end for25: end for

The L;r’s can be computed by a symmetric procedure using parent intervalsinstead of induced intervals. However, since storing parent intervals doubles therequired space for the graph, one can also devise a procedure propagating L;r fromeach r to its induced intervals. Algorithm 5 shows how this can be done in lineartime when q = k. The extension to the general case q ≤ k requires the use of q + 1pointers to nodes instead of only one, but the idea is the same. At the ith iteration,the variable ptr contains the first node in Di+1 that has not been yet scanned. Suchpointer is used to avoid assignments to already examined nodes (lines 9–10). Thus,

Page 79: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

4.3. Finding structured motifs 67

the time complexity of Compute-L;r is O(M). As before, allowing q < k only addsa constant factor to such bound.

Algorithm 5 Compute L;r for all nodes r when q = k

Require: q = k1: Compute-L;r(G)2: for all nodes r ∈

⋃ki=1Di do

3: L;r ← 04: end for5: for i← 1 to k − 1 do {For all layers, but the last, from top to bottom}6: Let ptr be the first node in layer Di+1

7: for all nodes r ∈ Di, in increasing order, do8: if L;r = i− 1 then {If r has a feasible length value}9: for all nodes r′ ∈ [ptr ,∞] ∩ int1(r) do

10: L;r ← i11: end for12: ptr ← succ(r.high1)13: end if14: end for15: end for

After computing path lengths, feasible nodes can be determined. If a low edgeenters an infeasible node, that low edge must be moved “to the right”, if possible.The same holds for a high edge, the only difference being that it must be moved“to the left”. That is, induced intervals must be restricted to maximal subintervalshaving feasible endpoints. Moving a low (resp., high) edge from a node to its successor(resp., predecessor) corresponds to deleting one edge in the explicit constraint graph.Such edge connects two matches of simple motifs that locally satisfy their distanceconstraint, but one of them does not belong to any match of the structured model.Shrinking induced intervals can be done by two linear scans of the nodes, one movingthe low edges and the other the high edges, and by keeping track, during each scan,of edges having an infeasible target.

Algorithm 6 shows how this operation can be done on low edges. When a layer isprocessed and a feasible node r is encountered, all low edges pointing to non-feasiblenodes before r are moved to target r. Such low edges can be easily retrieved if q + 1pointers are maintained, each one performing a linear scan of one of the q + 1 layersabove the current layer. The overall time complexity is therefore O

(∑ki=2(mi +∑q+1

j=1 mi−j))

= O(M). High edges can be processed by a symmetric procedure,examining nodes in decreasing order. Figure 4.6 is an example of restricted graph.

Let G′ =(D′

1, . . . , D′k), E′) be the implicit constraint graph after the execution of

the previous algorithms, where each D′i ⊆ Di is the subset of feasible nodes of Di. If

q = k, then every node in each layer induces a non-empty interval in the next layer.Therefore, all the (explicit) paths starting from a node in the first layer reach a nodein the last layer traversing all layers, i.e. each path represents a valid match of the

Page 80: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

68 4. Layered interval graphs of constraints

Algorithm 6 Shrink induced intervals to have feasible left endpoints

1: Adjust-Low-Edges(G)2: for i← 2 to k do {For all layers but the first, in increasing order}3: Let ptr be the first node in Di

4: for all nodes r ∈ Di, in increasing order, do5: if r is feasible then6: for all induced intervals [r1, r2] with ptr � r1 ≺ r � r2 do7: replace [r1, r2] with [r, r2]8: end for9: ptr ← succ(r)

10: end if11: end for12: change all remaining induced intervals to [∞,∞]13: end for

r11 r12

r22 r24

r32 r33

r41

r51 r52 r53

D1

D2

D3

D4

D5

Figure 4.6: The graph of Figure 4.4 restricted to feasible nodes.

structured model. So, G′ is a compact representation of all the solutions, which canbe given as a suitable output.

If q < k, two situations must be considered. First, an edge can join two feasiblenodes, but the corresponding occurrences must not necessarily belong to the samematch of the structured motif (as for r12 → r32 in Figure 4.6). Such an edge must bedeleted. Second, although a valid path always exists that passes through a feasiblenode, not necessarily all the paths are long enough (see Figure 4.6). To detect thesesituations a slightly modified depth first search is done. The difference with respectto a standard dfs is as follows: a node is re-visited (and then it is duplicated) everytime it is reached through a path with a different length. The code for the modifiedvisit is in Algorithm 7.

Page 81: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

4.3. Finding structured motifs 69

Let G′ = (V ′, E′) be the graph produced by Constraint-Graph-Visit. Thenodes in G′ are pairs (r, l) where r is a node of G′ and l is the length of a pathreaching r from a source. When a node r is visited through a path of length l, anode r′ adjacent to r is visited only if the current path can be extended to a feasiblepath by going through r′ (line 4 in procedure Visit) and if r′ has not yet been reachedby a path of length l+ 1 (lines 5–6). So, a node can be visited (and then duplicated)as many times as the number of different feasible values, which is bounded by q + 1.Therefore, the number of nodes in the output graph is still O

(∣∣⋃ki=1D

′i

∣∣) (whichis O(M), although, in typical practical situations,

∣∣⋃ki=1D

′i

∣∣ � M), and the timecomplexity of the visit is asymptotically the same as a standard depth first search.The visit reduces to a standard dfs of G′ when q = k.

The conditional statement in line 4 of procedure Visit avoids following paths thatare necessarily too short, so it permits to cut off all infeasible paths. It can be easilyverified that, for every path r1 → r2 → · · · → rn from a source to a leaf of (theexplicit version of) G′, there are two possibilities: either n < q, in which case thereis no corresponding path in the output graph, or n ≥ q, in which case there is apath (r1, 0)→ (r2, 1)→ · · · → (rn, n− 1) in the output graph. Figure 4.7 shows theoutput of our running example. It may be noted that the output, in spite of beinglinear, is not, in general, a minimal graph: some nodes may undergo unnecessaryduplications (as the leaves in Figure 4.7).

CT GG

ACA

GGCT

TGT

ACA

ACATA

TGT ACA

ACA

ACA

GG TA

T G T a t c g C T g g TGT C T c a G G a G G C T c g CT cc GG a T A G G a A C A g ACA g a A C A

Figure 4.7: The output graph (to be read left to right) derived from the visit of the graphin Figure 4.6. A path and the corresponding 4-match have been highlighted.

4.3.8 Experimental results

The algorithm described in the previous sections has been implemented in a programcalled SMaRTFinder2. SMaRTFinder also implements an exact pattern matching

2where ‘SM’ stands for structured motif, and ‘RT’ reminds of our motivating problem, i.e. findingretrotransposons.

Page 82: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

70 4. Layered interval graphs of constraints

Algorithm 7 Visit of the modified graph restricted to feasible nodes

1: Constraint-Graph-Visit(G′)2: V ′ ← E′ ← ∅3: for all sources s do4: Visit(s, 0)5: end for6: return (V ′, E′)

1: Visit(r, l)2: V ′ ← V ′ ∪ {(r, l)}3: for all nodes r′ ∈

⋃q+1j=1 intj(r) do {Explore r’s adjacency set}

4: if l + 1 + Lr′; ≥ q − 1 then {If there is a feasible path from r′}5: if (r′, l + 1) 6∈ V ′ then6: Visit(r′, l + 1)7: end if8: E′ ← E′ ∪ {(r, l)→ (r′, l + 1)}9: end if

10: end for

algorithm with Kurtz’s suffix trees ([26]) and a naïve dynamic programming algorithmfor approximate pattern matching ([29]). The latter, being suboptimal, has not beenincluded in the tests that are described below. Both algorithms can work with theIUPAC alphabet3. The program is written in standard C++ (apart from Kurtz’scode, which is in C).

The performances of Anrep ([43]) and SMaRTFinder have been compared by pro-cessing a 5Mb DNA sequence to search for k-matches, with no errors, out of a setof 1000 structured models over ΣIUPAC, generated by randomly choosing, for eachmodel, the number k ∈ [3, 8] of simple motifs, the length l ∈ [5, 10] of each motif andk−1 subintervals of [0, 100] as gaps. The test was executed on a PowerPC G4 400Mhzmachine with 384Mb RAM running Mac OS X. Both programs had been compiledwith gcc v3.3 with flag -O3.

Since Kurtz’s suffix trees can be built either lazily or eagerly, we tested both cases.The results of this experiment are shown in Figures 4.8 and 4.9. Two considerationscan be made. First of all, the time needed to build the suffix tree lazily is quicklyamortized, and hence there is no big difference when many searches are performed onthe same sequence, between having a pre-constructed suffix tree and building it incre-mentally. Second, SMaRTFinder outperforms Anrep in most cases, and it has a muchmore stable linear behaviour. The running time of Anrep strongly depends on thestatistical technique used to determine the best backtrack order of the search ([48]).In cases where such strategy is effective (for instance, when the structured motif hasone long rare component pattern and the remaining patterns are very short) Anrepproduces better results, but Figures 4.8 and 4.9 show that it is usually much slower

3Actually, they can work with any predefined scheme for comparing characters.

Page 83: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

4.3. Finding structured motifs 71

than our program. Moreover, it would be possible to introduce statistical strategiessimilar to the ones used in Anrep to guide the search phase of our algorithm and geteven better performances.

0

5

10

15

20

25

30

35

40

0 200000 400000 600000 800000 1000000 1200000 1400000

Tim

e (s

)

Number of matches

Eager SMaRTFinderAnrep

Figure 4.8: Eager SMaRTFinder compared with Anrep.

As a second experiment, we processed the whole genome of Arabidopsis Thaliana([14]) searching for 4-, 5- and 6-occurrences of the structured model shown in Fig-ure 4.10, which we had obtained by the multiple alignment of several BAC clones ofthe rice genome (Oryza sativa). Arabidopsis Thaliana was chosen because it is a wellstudied and annotated genome. This test was done on a Pentium IV 1.6Ghz machinewith 512Mb RAM running Linux. Table 4.2 shows the results, averaged over 10 trials.As expected, allowing missing patterns does not affect the running time dramatically.The whole genome can be processed in less than 100 seconds, and this time reducesby a factor of 10 if the suffix trees of the sequences are available in advance.

The best qualitative results were obtained allowing one missing pattern, the num-ber of occurrences found being of the same order of magnitude as other results in theliterature (see, for example, [14]). Besides, in that case we found no false positives,i.e. all computed elements we checked are annotated as “retroelements”, or at leastas “genes”, in current databases. The reason for that lies, of course, in the “goodquality” of the structured model we used.

We can draw the following conclusion: when patterns are specified in the IUPACalphabet and we can combine a certain number of them into a structured motif, the

Page 84: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

72 4. Layered interval graphs of constraints

0

5

10

15

20

25

30

35

40

0 200000 400000 600000 800000 1000000 1200000 1400000

Tim

e (s

)

Number of matches

Lazy SMaRTFinderAnrep

Figure 4.9: Lazy SMaRTFinder compared with Anrep.

TNGA[12,14]TWNYTNNA[19,21]TNTMYRT[4,6]WNCCNNNNRG[72,95]TGNNA[100,125]TNTANRTNRAYGA

Figure 4.10: A very well conserved feature of a Copia retrotransposon.

search can be effective even if we do not allow errors inside each pattern (or we allowa small number of errors, e.g. one error). Effectiveness arises from the combinationof the patterns: in this perspective, allowing missing patterns is a valuable feature.

4.4 Extending the algorithm

In Section 4.3.1, we briefly described the main features of Helitrons, and justifiedtheir importance in the study of genomes. As we discussed, one of the strong signalswitnessing their presence is a short hairpin, which in terms of the linear DNA trans-lates into a complemented palindrome. There is a growing literature about findingstructures like that (e.g., [18, 15, 28, 35]), but we want to use this example to sketchhow a different algorithmic idea can be embodied into our framework.

Let us extend the notion of a structured model P1[l1, u1] · · · [lk−1, uk−1]Pk as fol-lows: we let some of the Pi’s to have the form

X(a, b)[lX , uX ]XR, (4.7)

Page 85: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

4.4. Extending the algorithm 73

Eager LazySequence Size 6/6 5/6 4/6 6/6 5/6 4/6

chr1AT 29 Mb 22.8 23.7 24.6chr2AT 19 Mb 1.8 2.4 3.0 14.0 14.6 15.1chr3AT 22.7 Mb 2.2 3.3 3.6 16.9 17.6 18.3chr4AT 16.9 Mb 1.8 2.1 2.6 12.5 13.0 13.5chr5AT 25.7 Mb 2.6 3.7 4.0 20.2 20.9 21.8

Table 4.2: Running time of SMaRTFinder for different kinds of search for the structuredmotif of Figure 4.10. Time is expressed in seconds. Times for chr1AT in the eager caseare missing, because the program went out of memory. Nonetheless, the sequence could beprocessed lazily.

where X(a, b) is a pattern matching any string having length between a and b char-acters, XR is its complemented reverse, and [lX , uX ] is a distance constraint. So, forinstance, X(4, 6)[2, 3]XR is matched by tggacaatcca, where X = tgga, but not bytggacaaagtcca (because the distance constraint is violated) or by tggaacca (becausethe palindrome is too short). We also allow errors, evaluated as the edit distance be-tweenX and the complemented reverse of XR. So, for example, tggacaatcaa matchesthe previous pattern with one error.

Finding exact palindromes of length L in a sequence S can be done in linear timeby building the generalized suffix tree of S and SR. If palindromes are approximate,things become more complicated. An approach is to look for exact “seeds” andthen extending them ([38]). This requires exponential time in the worst case. Ifa palindrome is specified as a component pattern of a structured model, the beststrategy is probably to search for the remaining simple patterns, combining them intoa partial match, and then testing the regions inside such matches for the existence ofapproximate palindromes. So, the structured model

P1[l1, u1] · · ·Pi[li, ui]X(a, b)[lX , rX ]XR[li+1, ui+1]Pi+1 · · · [lk−1, uk−1]Pk

is translated into

P1[l1, u1] · · ·Pi[li + 2a+ lX + li+1, ui + 2b+ uX + ui+1]Pi+1 · · · [lk−1, uk−1]Pk.

Once the output graph of the above model has been built, only the regions betweena match of Pi and a match of Pi+1 need to be further analyzed. Of course, if errorsor missing patterns are allowed, these must be taken into account when the model istranslated.

Page 86: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

74 4. Layered interval graphs of constraints

Page 87: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

5Intervals and games on words

The Ehrenfeucht-Fraïssé method was introduced in [22] in its algebraic form, and theninterpreted in a game-theoretic framework in [17]. We will refer to the latter as anEF-game. The importance of the method rests on its intuitive appeal and its wideapplicability: it is one of the few tools in model theory that can still be used whenrestricted to finite structures, and thus, particularly relevant to problems in computerscience.

EF-games are two-player combinatorial games of perfect information (that is, nochance or probability or information hiding mechanism are involved), which can beused to compare two structures. The first player is called Spoiler and the secondDuplicator. Roughly speaking, Spoiler aims at proving that the two structures are“different”, while Duplicator wants to show that they are “equivalent”. Tipically,they must achieve their purpose in a fixed, bounded, number of rounds (althoughinfinite variants of the game can be defined). The structures form the playground,and in each round the players pick elements from them.

The rules of an EF-game usually have a counterpart in a logic, in a way thatthe possession of a winning strategy by one of the players relates to the ability ofcertain formulas of that logic to distinguish the structures used in the game. As aconsequence, the main use of EF-games is to prove inexpressibility results. As wewill see (Theorem 5.1.7), if a property P of a class of structures is not definable by agiven logic, this can be proved by showing that, no matter how many rounds are tobe played, there are always two (finite) structures A and B such that A satisfies P, Bdoes not satisfy P, and Duplicator has a winning strategy in the game correspondingto the logic played on A and B.

The main feature we want to stress in this paper is this comparison power of EF-games. They are used to tell whether two structures can be distinguished or not (by alogic), so they are widely recognized as a handy tool to measure the expressive powerof a logic. But EF-games can also provide information on “how much” and “where”two structures differ. We argue that this feature may be useful in contexts wherethe degree of similarity of structures is relevant, e.g. in the comparison of biologicalsequences. EF-games provide a mathematically precise, yet flexible, way to definewhat similarity is. Besides, they bring in logical languages that can formally describehow the structures look alike. So, instead of using games to study properties of a

Page 88: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

76 5. Intervals and games on words

logic, we tailor our approach towards a use of games for the study of properties ofstructures.

In order to use games in this way structural characterizations of playgrounds areneeded. The existence of a winning strategy for Duplicator implies that the structuresinvolved must share common features, and viceversa. Moreover, the ability to exhibita winning strategy in an effective way can lead to further insight into the similaritiesand discrepancies of the two structures.

It turns out to be difficult to give such characterizations. In this chapter we willonly consider EF-games adequate for first-order logic. Several sufficient conditionsfor Duplicator to be able to win such games have been proposed in the literature, andthey are shortly reviewed in Section 5.6. But complete knowledge is achieved only inspecial cases, the simplest of which is probably the case of (unlabeled) linear orderings(thoroughly analyzed in Section 5.5). A characterization of linear orderings extendedwith unary predicates, i.e. word models, is still an open problem. In Section 5.7, wesolve the problem for the case of labeled sets with a successor relation.

5.1 Basic definitionsDefinition 5.1.1. The isomorphism type of a τ -structure A is the class of structuresisomorphic to it. We write A ∼= B if A and B are isomorphic. Thus, the isomorphismtype of A is [A] ∈ {C | C is a τ -structure }/∼=

.

Definition 5.1.2. Let A and B be two structures over a vocabulary τ and let a,btwo n-tuples of elements of A and B, respectively. The structures (A,a) and (B,b)are m-equivalent, written (A,a) ≡m (B,b), if

(A,a) |= ϕ(x) ⇐⇒ (B,b) |= ϕ(x).

for all first-order formulas ϕ(x) with quantifier depth at most m.

Lemma 5.1.3. The relation ≡m is an equivalence relation of finite index.

Definition 5.1.4. Given two τ -structures A and B, a local (or partial) isomor-phism p ⊆ A×B is an injective (partial) function from A to B preserving constantsand relations, that is such that

• for every c ∈ τ , cA ∈ dom(p) and p(cA) = cB, and

• for every (R,n) ∈ τ and all a1, . . . an ∈ dom(p),

RA(a1, . . . , an)⇐⇒ RB(p(a1), . . . , p(an)).

A local isomorphism p is an isomorphism between the substructures of A and Binduced by dom(p) and cod(p), respectively.

Remark 5.1.5. A local isomorphism does not necessarily extends to an isomorphism.For example, {(0, e), (2, π)} is a local isomorphism between (N, <N) and (R, <R), butno isomorphism exists between the two structures.

Page 89: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

5.1. Basic definitions 77

Definition 5.1.6. A set of sentences Φ defines a class of structures K if, for everyτ -structure A,

A |= Φ ⇐⇒ A ∈ K.

The notion of m-equivalence is related to definability in first-order logic by thefollowing result.

Theorem 5.1.7. A class K of finite structures is first-order definable if and only ifthere is m ∈ N such that, whenever A ∈ K, B 6∈ K, then A 6≡m B.

Theorem 5.1.7 is usually used in a negative form to prove inexpressibility results:if for all m ∈ N there are τ -structures A and B such that A ∈ K, B 6∈ K and A ≡m B,then K is not first-order definable.

This entire chapter is about different ways of describing m-equivalence.

5.1.1 Distance in structures

Gaifman’s theorem (see Theorem 5.4.5) states that every first-order sentence is equiv-alent to a boolean combination of “local” sentences, whose evaluation only requiresthe inspection of a set of small substructures which are far from one another. In otherwords, first-order logic only captures local properties of structures. This fact is alsoimplicit in Hanf’s theorem (Theorem 5.6.2), and it is crucial for most results aboutEF-games that exist in the literature. We will exploit this fact, too, in Section 5.7.To make the notion of “locality” precise, we must define a metric over structures.

Definition 5.1.8. The Gaifman graph of a structure A is an undirected graph whoseset of nodes is A, having an edge (a1, a2) whenever a1, a2 occur in the same tuple ofsome relation of A.

Recall that we assume that every structure contains equality: the Gaifman graphof a structure A therefore contains all edges of the form (a, a) for a ∈ A. The Gaifmangraph of an undirected graph is the graph itself, plus all self-loops.

Definition 5.1.9. The distance δ(a1, a2) between two elements a1, a2 of a structure Ais the distance in the Gaifman graph of A, that is the length of a shortest path1 from a1

to a2 in the Gaifman graph. Given two tuples a = a1, . . . , ak and b = b1, . . . , bl, thedistance δ(a,b) between a and b is the minimum distance between any two elementsof a and b, that is

δ(a,b) = min{ δ(ai, bj) | 1 ≤ i ≤ k ∧ 1 ≤ j ≤ l }.

Definition 5.1.10. Given a structure A and a tuple of elements a of A, the ball BAr (a)

of radius r around a is the set

BAr (a) = { c ∈ A | δ(c,a) ≤ r } ⊆ A.

1We assume δ(a1, a2) = ∞ if there is no such path.

Page 90: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

78 5. Intervals and games on words

Definition 5.1.11. Given a structure A and a tuple of elements a of A, the (r-)neighbourhood NA

r (a) around a is the substructure of A induced by BAr (a).

Definition 5.1.12. The degree d(a) of an element a is the number of its adjacentelements in the Gaifman graph, that is

d(a) = |BA1 (a)| − 1.

The degree of a structure A is the maximum degree of its elements.

Definition 5.1.13. Given two tuples a = a1, . . . , ak and b = b1, . . . , bk, we say thatNA

r (a) is isomorphic to NBr (b), written NA

r (a) ∼= NBr (b), if there is an isomorphism

between the two neighborhoods mapping ai to bi, for 1 ≤ i ≤ k. The isomorphismtype of a neighborhood is the class of neighborhoods isomorphic to it.

Definition 5.1.14. Let A be a class of τ -structures, let ≡ be an equivalence relationover A, and let A ∈ A. The multiplicity ρA(A)≡ of A in A with respect to ≡is |[A]≡|, that is the cardinality of the corresponding equivalence class.

Usually, we will takeA as the collection of substructures of a given structure. Thus,the multiplicity of a substructure counts the number of occurrences of ≡-equivalentsubstructures in a given structure.

5.2 Algebraic characterizationWe are interested in local isomorphisms that can be extended a certain number oftimes. Fraïssé’s work was concerned with the following notion of m-isomorphism,which is a weakening of isomorphism well suited for capturing m-equivalence.

Definition 5.2.1. Let a = a1, . . . , ak and b = b1, . . . , bk. Two structures (A,a) and(B,b) are m-isomorphic, written (A,a) ∼=m (B,b), if there is a sequence of nonemptysets I0, . . . , Im of local isomorphisms such that {(ai, bi)}1≤i≤k ∈ Im and satisfying,for every k = 1, . . . ,m, the following back-and-forth property:

(forth property) for every p ∈ Ik and for every a ∈ A there is b ∈ B such thatp ∪ {(a, b)} ∈ Ik−1;

(back property) for every p ∈ Ik and for every b ∈ B there is a ∈ A such thatp ∪ {(a, b)} ∈ Ik−1.

Thus, Ik contains local isomorphisms that can be extended k times. The impor-tance of m-isomorphism rests on the fact that it captures the notion of m-equivalence,as the following theorem states. Thus, local isomorphisms just cover the particularcase of 0-equivalence.

Theorem 5.2.2 (Fraïssé, [22]). For structures A and B, k-tuples a ∈ Ak,b ∈ Bk

and m ≥ 0,(A,a) ∼=m (B,b) ⇐⇒ (A,a) ≡m (B,b).

The algebraic characterization of m-equivalence will be used in the proof of The-orem 5.7.21.

Page 91: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

5.2. Algebraic characterization 79

5.2.1 ExamplesThe algebraic characterization of m-equivalence is a genuine tool to prove inexpress-ibility results in the finite. As an example, we consider the property of connectivity ofgraphs, that is structures with a single binary relation E (the edge relation). A graphis connected2 if, for any two nodes a, b there is a path from a to b. First, we showthat connectivity is not first-order definable over arbitrary (also infinite) graphs. Theproof is a standard argument based on the compactness theorem.

Proposition 5.2.3. The class of connected graphs is not first-order definable.

Proof. For the sake of contradiction, suppose that ϕ is a first-order sentence thatholds of all and only connected graphs. Let ∆r(x, y) be a formula with two freevariables stating that there is a path from x to y of length at most r (see Section 5.4).Consider the following set of formulas:

Γ = {ϕ} ∪ {¬∆r(c, d) | r ∈ N },

where c and d are two constant symbols. It is easy to check that every finite subsetof Γ is satisfiable. Then, by the compactness theorem, Γ has a model G. So, G isconnected, because G |= ϕ, but there is no path from c to d, because G |= ¬∆r(c, d)for every r ∈ N. This is a contradiction.

The above proof gives no hint about the definability of connectivity in the finite.One can use Fraïssé’s theorem to prove that connectivity is not definable on the classof finite graphs.

Proposition 5.2.4. The class of finite connected graphs is not first-order definable.

Proof. Let m ∈ N and let r ≥ 2m. Consider the following two graphs G1 and G2.

G1

G2

Let G1 have r nodes, let G2 be made of two copies of G1. Note that G1 is connected,but G2 is not. Define the following sequence of sets of local isomorphisms, for 0 ≤k ≤ m:

Ik ={p | p is a local isomorphism from G1 to G2 and ∀a, b ∈ dom(p).(δ(a, b) = δ(p(a), p(b)) ∨ (δ(a, b) ≥ 2k+1 ∧ δ(p(a), p(b)) ≥ 2k+1)

) }.

To prove the forth property, let p ∈ Ik and c ∈ G1. We distinguish two cases. If thereis a ∈ dom(p) such that δ(a, c) < 2k, then choose d in G2 such that δ(a, c) = δ(p(a), d)(and d lies on the same side w.r.t. p(a) as c w.r.t. a). By the inductive hypothesis,

2This definition coincides with strong connectivity in directed graphs.

Page 92: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

80 5. Intervals and games on words

p ∪ {c, d} ∈ Ik−1. If, for every a ∈ dom(p), δ(a, c) > 2k, then, by the inductivehypothesis, there are e, f ∈ G2 such that δ(e, f) > 2k+1. So, choose d halfwaybetween e and f . The back property is proved in a similar way. Therefore, G1 ≡m G2.

5.3 Game-theoretic characterizationWe now give a more precise definition of EF-games for first-order logic. Throughoutthis section, all structures are assumed to be defined over a fixed relational vocabu-lary τ .

The game is played by two players, Spoiler and Duplicator : to help distinguishbetween the two, we conventionally refer to the former as a male and to the latter asa female player. The playground is made by two τ -structures A and B. The gameis divided into n rounds, and each round consists of a move by Spoiler followed by amove by Duplicator.

Definition 5.3.1. A configuration of an EF-game played on structures A and Bis a relation p ⊆ A × B. Given tuples a = a1, . . . , ak of elements of A and b =b1, . . . , bk of elements of B, we write ((A,a), (B,b)) to denote the configuration p ={(ai, bi)}1≤i≤k.

Definition 5.3.2. A position in an EF-game played on structures A and B is a triple((A,a), (B,b), j) where j is the number of rounds yet to be played.

A position is a configuration specifying the number of remaining rounds. Thus, inthe game-theoretic view, relations are viewed configurations in a game; a play from aninitial position ((A,a), (B,b),m), with m ≥ 0, consists in performing m extensionsof the initial configuration according to the following rules:

• Spoiler chooses one of the two structures (say A) and an element c in it;

• Duplicator replies by choosing an element d in the other structure (say B);

• the new position becomes ((A,a, c), (B,b, d),m− 1).

The game ends at positions of the form ((A,a), (B,b), 0).

Remark 5.3.3. We may assume, without loss of generality, that all the elementsin a (resp., b) are distinct. In this case, a configuration is always a partial injectivefunction from A to B. This assumption corresponds to the addition of a rule imposingthat Spoiler cannot pick a previously chosen element, that is he cannot repeat one ofhis or Duplicator’s moves. The ending condition is adapted to this situation by addingto the set of ending positions all the positions violating this rule.

Definition 5.3.4. An ending position is winning for Duplicator if and only if the finalconfiguration is a local isomorphism between A and B. Duplicator has a winning strat-egy from position ((A,a), (B,b),m), written D((A,a), (B,b),m), if she can reach awinning ending position no matter how Spoiler plays. We write S((A,a), (B,b),m)to denote that Duplicator does not have a winning strategy.

Page 93: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

5.4. Logical characterization 81

As EF-games are finite and do not have draw positions, it is not difficult to provethat they are determined, that is exactly one of the players has a winning strategy.

Theorem 5.3.5 (Ehrenfeucht, [17]). For structures A and B, k-tuples a ∈ Ak,b ∈Bk and m ≥ 0,

D((A,a), (B,b),m) ⇐⇒ (A,a) ≡m (B,b).

Corollary 5.3.6. A class K of τ -structures is first-order definable if and only if thereis m ∈ N such that, whenever A ∈ K and B 6∈ K, then S(A,B,m).

Proof. Immediate from Theorem 5.1.7.

Corollary 5.3.6 can be used to prove that a property is not first-order definable:it is sufficient to show that Duplicator has a winning strategy in suitable EF-games.Proving this, however, can be very difficult.

5.4 Logical characterizationOne can give a logical description of the equivalence classes of the relation ∼=m byformulas of quantifier depth at most m, that is, for each structure (A,a), a for-mula ϕm

(A,a)(x) that holds exactly in structures m-isomorphic to (A,a). The followingdefinition provides the desired characterization.

Definition 5.4.1 (Hintikka formulas). For a structure (A,a), let

ϕ0(A,a)(x) ,

∧ϕ(x) atomic(A,a)|=ϕ(x)

ϕ(x) ∧∧

ϕ(x) atomic(A,a)|=¬ϕ(x)

¬ϕ(x)

and, for m ≥ 0,

ϕm+1(A,a)(x) ,

∧a∈A

∃xn+1 ϕm(A,a,a)(x, xn+1) ∧ ∀xn+1

∨a∈A

ϕm(A,a,a)(x, xn+1).

The Hintikka formula ϕ0(A,a)(x) describes the isomorphism type of the substructure

of A induced by a. In general, ϕm(A,a)(x) describes to which isomorphism types the

tuple a can be extended in m steps by adding one element in each step.Note that the above conjunctions and disjunctions are finite, even if the structure

is infinite (provided that the vocabulary is finite).

Theorem 5.4.2. Let (A,a) and (B,b) be two τ -structures. Then,

(B,b) |= ϕm(A,a)(x) ⇐⇒ (A,a) ∼=m (B,b).

Given a first-order formula ϕ(x) of quantifier depth m, the class of structuresin which ϕ(x) holds must be the union of a finite number of ≡m-classes, that is,by Theorem 5.2.2, the union of ∼=m-classes. By Theorem 5.4.2, it follows that ϕ(x)is equivalent to the disjunction of a finite number of Hintikka formulas, each onedescribing one ∼=m-class.

Page 94: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

82 5. Intervals and games on words

Theorem 5.4.3. Let ϕ(x) be a formula of quantifier depth at most m. Then

|=(ϕ(x) ←→

∨{ [(A,a)]∼=m |(A,a)|=ϕ(x) }

ϕm(A,a)(x)

)This representation is called distributive normal form for first-order formulas. It is

only one of many possible normal forms. Another interesting characterization of first-order logic, strictly related to its “locality”, is based on the following observations.

Given a relational vocabulary τ and a natural number r, one can write a first-orderformula in two free variables that holds exactly when interpreted by two elementswhose distance (in the Gaifman graph) is at most r. That is, there is a formula∆r(x, y) such that, for any τ -structure A and a, b ∈ A,

A |= ∆r(x, y)[a, b] ⇐⇒ δ(a, b) ≤ r.

The formula ∆r(x, y) is inductively defined as follows:

∆0(x, y) , x = y,

∆r+1(x, y) , ∆r(x, y) ∨ ∃z(∆r(x, z)∧∨

(R,k)∈τ

∃v1 · · · ∃vk

(R(v1, . . . , vk) ∧

∨1≤i,j≤k

(vi = z ∧ vj = y))).

This formula is easily generalized to more variables, by defining, for a tuple x =x1, . . . , xk, ∆r(x, y) as the disjunction ∆r(x1, y)∨· · ·∨∆r(xk, y). For any τ -structure Aand a ∈ A, the formula ∆r(x, y) holds for all k-tuples of points of A that are in BA

r (a)when y is assigned the value a.

The next step consists in relativizing the truth of a formula to a neighborhood ofpoints. Given r ∈ N, a formula is translated into a “localized” version, with respectto some variables x, by inductively replacing quantifiers according to the followingrule3: [

∃z ψ(x,y)]Br(x)

, ∃z(∆r(x, z) ∧

[ψ(x,y)

]Br(x)).

where z can be in x or in y. Quantifier-free ψBr(x) coincides with ψ. One can verifyby induction that, for any τ -structure A, a ∈ A and b ∈ BA

r (a), we have

A |=[ψ(x,y)

]Br(x)[a,b] ⇐⇒ NAr (a) |= ψ(x,y)[a,b].

Using this translation we may define “local” sentences, whose satisfiability can bechecked by looking at small neighborhoods of a scattered set of points.

Definition 5.4.4. Let ϕ(x) a first-order formula and let r, k ∈ N. A first-ordersentence is basic local if it has the form

∃x1 · · · ∃xk

∧1≤i≤j≤k

(¬∆r(xi, xj) ∧

[ϕ(xi)

]Br(xi)).

3Here, ψ(x,y) denotes a formula where variables in x,y occur free.

Page 95: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

5.5. Structural characterizations 83

A basic local sentence is satisfied by a k-tuple of points which are far apart fromeach other, and each of them satisfies a local condition described by a first-orderformula. The importance of basic local formulas is related to the following result.

Theorem 5.4.5 (Gaifman, [25]). Every first-order sentence is logically equivalent toa boolean combination of basic local sentences.

Theorem 5.4.5 provides another normal form for first-order logic. Normal formsof the Gaifman type have been proposed in [34], where they are related to variants ofEF-games (see Section 5.6.4).

5.5 Structural characterizationsAs it has already been pointed out, a winning strategy for Duplicator in an EF-gameexpresses the (in)ability of the underlying logic to distinguish two structures. So, onemay ask whether a logic can express a given property of a class of structures andtry to answer (in the negative) by exhibiting a winning strategy for Duplicator. Thequestion can be turned up and posed in the following terms: which features must twostructures have in common in order to be considered indistiguishable? Or, in otherwords, is it possible to give an explicit description of ≡m-classes? This question is, ingeneral, very difficult to answer. The following result assesses the complexity of theproblem of deciding whether two τ -structures are m-equivalent.

Theorem 5.5.1 (Pezzoli, [51]). Let τ be a vocabulary containing at least one binaryand one ternary relation. Given two τ -structures A and B and m ∈ N, the problemof determining whether D(A,B,m) is PSPACE-complete.

The proof is based on a complex reduction of the satisfiability problem for Quan-tified Boolean Formulas to the problem of establishing the winner of an EF-game.

Although the problem is hard in general, for specific classes of structures betterresults can be obtained. As an example, we describe (unlabeled) linear orderings, oneof the few cases for which the complete picture is known.

Definition 5.5.2. For a given n ∈ N, the <-structure of size n is the relationalstructure

Ln = ([1, n], <n),

where [1, n] ∈ INT (N) and <n is the ordering of natural numbers restricted to [1, n].

The existence of a winning strategy for Duplicator entirely depends on the size ofthe structures and on the number of available rounds in the following way.

Theorem 5.5.3. Let Ln and Lp be two <-structures, and m ∈ N. Then,

D(Ln,Lp,m) ⇐⇒ Ln∼= Lp ∨ n, p ≥ 2m − 1.

Thus, determining the winner of a game simply requires comparing the size ofthe structures. The proof of Theorem 5.5.3 is based on the following property of <-structures.

Page 96: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

84 5. Intervals and games on words

Lemma 5.5.4 (Splitting property). Given Ln, Lp and m ∈ N, D(Ln,Lp,m+ 1) ifand only if the following two conditions are verified:

(forth) ∀a ∈ [1, n] ∃b ∈ [1, p].(D(La−1,Lb−1,m) ∧ D(Ln−a,Ln−b,m)

);

(back) ∀b ∈ [1, p] ∃a ∈ [1, n].(D(La−1,Lb−1,m) ∧ D(Ln−a,Ln−b,m)

);

A nice property of linear orderings is that winning strategies can be composed,because m-equivalence over <-structures is a congruence: if D((Ln1 ,a), (Lp1 ,b),m)and D((Ln2 , c), (Lp2 ,d),m), then D((Ln1+n2 ,a, c + n1), (Lp1+p2 ,b,d + p1),m).

Theorem 5.5.3 is what we call a structural characterization: it provides a necessaryand sufficient condition, based on some features of the considered models (in this case,their sizes), to establish whether a given position is winning for Spoiler or Duplicator.It gives no clue, however, about how the two players should actually play. This maybe judged irrelevant for the analysis of the expressive power of a logic—in this case,knowing the existence of a winning strategy is often all that is required—but foralgorithmic purposes a detailed specification of the optimal moves for each playersis needed. Albeit the game is determined, the player who has a winning strategymust be able to exploit it. A winning strategy is not the same as an optimal strategy:intuitively, the player who is able to win wants to do so is as few rounds as possible: thequicker (s)he can win, the clever it may be considered. On the other hand, the playerwho is doomed to lose might want to try to resist as long as possible, maybe hopingthat the opponent will make a blunder. Such questions are typical in the field ofcombinatorial game theory, and EF-games are just perfect-information combinatorialgames.

In the case of linear orderings the task of describing an optimal strategy is notdifficult to achieve. The methodology we adopt takes the structural characterizationas the fundamental result that is needed to compute the “remoteness” of the game,which is a sort of “distance” from the end of the game. If Spoiler has a winningstrategy, then the remoteness can be used to determine a strategy that minimizes thenumber of moves he needs to force the end of a game. If Spoiler does not have awinning strategy, the remoteness is used to determine the strategy that guaranteesthe longest play to him.

Definition 5.5.5. An unbounded EF-game ( uEF-game for short) from the configu-ration ((A,a), (B,b)) is played according to the rules of EF-games, but without anybound on the number of rounds. The game ends just before either of the followingsituations is going to occur:

1. Spoiler chooses an element that is in the current configuration (such moves arecalled repetitions);

2. the current configuration is not a local isomorphism.

The last player that is able to move is the winner. A configuration ((A,a), (B,b)) iswinning for Spoiler if Spoiler has a winning strategy in the uEF-game from position((A,a), (B,b)); otherwise, ((A,a), (B,b)) is winning for Duplicator.

Page 97: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

5.5. Structural characterizations 85

As repetitions are ruled out, any uEF-game on finite structures ends in a finitenumber of rounds, there are no draws or ties and the game is determined. Thefollowing facts follow immediately from Definition 5.5.5.

Proposition 5.5.6. Let ((A,a), (B,b)) be the initial configuration of a uEF-game.Then,

1. ((A,a), (B,b)) is winning for Duplicator if and only if (A,a) ∼= (B,b);

2. Spoiler wins the uEF-game in m rounds if and only if S((A,a), (B,b),m).

How many rounds does the player having a winning strategy need to win? Forconfigurations that are winning for Duplicator the answer is easy: if (A,a) ∼= (B,b),the corresponding uEF-game will last no more than |A| − |a| rounds, provided thatDuplicator mimics Spoiler (and it will last exactly this number of rounds if Spoilerdoes not make repetitions). Configurations that are winning for Spoiler are moreinteresting: in this case, the aim of Spoiler is to quit the game as quickly as possible,while Duplicator longs for longer plays (according to the motto in [8]: “Win Quickly!Lose Slowly!”).

Definition 5.5.7. The remoteness of a configuration ((A,a), (B,b)) that is win-ning for Spoiler is the minimum number of rounds in which the uEF-game from((A,a), (B,b)) is guaranteed to end, no matter how Duplicator plays. The remotenessof a configuration ((A,a), (B,b)) that is winning for Duplicator is |A| − |a|.

Definition 5.5.8. An optimal strategy for the winning player of an uEF-game from((A,a), (B,b)) is a strategy that allows that player to play a uEF-game, no matterwhat the opponent does, with a number of rounds no greater than the remoteness ofthe initial configuration. Dually, an optimal strategy for the losing player is onethat allows that player to play a uEF-game with a number of rounds no less than theremoteness, no matter what the opponent does. An optimal move for a player is onebelonging to an optimal strategy for that player.

The remoteness of a configuration is zero if and only if it is not a local isomorphism.To illustrate the kind of analysis we want to undertake, we describe strategies for

games over (unlabeled) linear orderings, one of the few cases for which the completepicture is known.

Using Theorem 5.5.3 the remoteness of a configuration can easily be computed.

Corollary 5.5.9. Let n 6= p. The remoteness of (Ln,Lp) is blog2(min(n, p)+1)c+1.

A nice property of linear orderings is that winning strategies can be composed,because m-equivalence over <-structures is a congruence. So, every configuration ofthe form ((Ln,a), (Lp,b)) can be viewed as a combination of |a|+ 1 configurations ofthe form (Li,Lj), and its remoteness is easily seen to be the least remoteness amongthe component configurations that are winning for Spoiler, if any such componentexist; otherwise, it is the sum of all the remotenesses. Therefore, to determine theoptimal strategies for both players, it is sufficient to analyze configurations (Ln,Lp)with n 6= p.

Page 98: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

86 5. Intervals and games on words

Theorem 5.5.10. Let n, p ∈ N with n < p. A move of Spoiler from position (Ln,Lp)is optimal if and only if Spoiler picks:

• an element in [bn/2c+ 1, p− bn/2c − 1] in Lp, or

• (n− 1)/2 in Ln, if n is odd.

Proof. As we have observed before, Spoiler will play from (Ln,Lp) in such a way as tominimize the least odd remoteness of the resulting component configurations. Afterone round, the reached configuration ((Ln, a), (Lp, b)) is the combination of (Ln1 ,Lp1)and (Ln2 ,Lp2), where n1 = a− 1, n2 = n− a, p1 = b− 1 and p2 = n− b.

Assume, without loss of generality, that n < p. Let f(x) = 2blog2(x + 1)c + 1.So, the remoteness of the initial configuration is f(n). Spoiler plays an optimalmove if and only if, after one round, no matter what Duplicator has done, the leastodd remoteness of the resulting component configurations is f(x) ≤ f(n) − 2. Theinequality holds if x ≤ (n− 1)/2. We distinguish a few cases.

• Suppose that Spoiler has picked a in Ln. Then, no matter which element bDuplicator chooses, the remoteness of ((Ln, a), (Lp, b)) will not be larger thanf(max(n1, n2)). Duplicator can reach this upper bound by choosing b thatsplits Lp into two parts, one of them isomorphic to Lmin(n1,n2). So, if Spoilerplays in Ln, he will try to minimize max(n1, n2). If n is even he can do so bychoosing a = n/2 or a = n/2 + 1: in both cases max(n1, n2)) = n/2. Theseare not optimal moves. If n is odd, Spoiler will choose a = (n − 1)/2, gettingmax(n1, n2) = (n− 1)/2. This is an optimal move.

• Suppose that Spoiler has picked b in Lp, instead.

– If b ∈ [1, bn/2c]∪ [bn/2c, p], Duplicator can maximize the least odd remote-ness by choosing a that splits Ln into two parts, one of them isomorphicto Lmin(p1,p2). The least odd remoteness will then depend on max(n1, n2) ≥dn/2e. Thus, none of Spoiler’s moves in this case is optimal.

– If b ∈ [bn/2c + 1, p − bn/2c − 1], then the least odd remoteness will bedetermined by min(n1, n2), so Duplicator will try to maximize this value.If n is even she can do so by choosing a = n/2 or a = n/2 + 1: in bothcases min(n1, n2) = n/2 − 1. If n is odd, Duplicator will choose a =(n+ 1)/2, getting min(n1, n2) = (n− 1)/2. Therefore, all Spoiler’s movesin the above interval are optimal.

The proof of Theorem 5.5.10 also establishes the optimal strategy for Duplicator.Algorithm 8 and Algorithm 9 describe the optimal, nondeterministic, plays of bothplayers from a given position. Their correctness is based on the above proof.

In these algorithms, we assume that in addition to the chosen elements, also abit indicating the structure it belongs to is returned. The preconditions ensure thata move is possible from the current configuration (apart from a1 < · · · < ak in

Page 99: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

5.5. Structural characterizations 87

Algorithm 8 Spoiler’s optimal strategy from ((Ln, a1, . . . , ak), (Lp, b1, . . . , bk))

Require: ((Ln, a1, . . . , ak), (Lp, b1, . . . , bk)) is a local isomorphism.Require: a1 < · · · < ak.Require: k < max(n, p).

Spoiler-Move(n, p, a1, . . . , ak, b1, . . . , bk

)Let a0 ← b0 ← 1, ak+1 ← n and bk+1 ← pDecompose ((Ln, a1, . . . , ak), (Lp, b1, . . . , bk)) into k + 1 component configurations(Lai+1−ai−1,Lbi+1−bi−1) for 0 ≤ i ≤ k, and compute their remotenessesif all components have even remoteness then

return an element not among a1, . . . , ak in Ln or an element not among b1, . . . , bkin Lp

elseLet j ∈ [0, k] be the index of a component with least odd remotenessLet n′ ← aj+1 − aj − 1 and p′ ← bj+1 − bj − 1if n′ < p′ then

if n′ is even thenreturn an element in [aj + n′/2 + 1, aj + p′ − n′/2− 1] in Lp

elsereturn an element in [aj+bn′/2c+1, aj+p′−bn′/2c−1] in Lp, or aj+(n−1)/2in Ln

end ifelse

{Symmetric case}end if

end if

Spoiler’s strategy, which is assumed only for convenience). If k = max(n, p), thenn = p (because the first precondition requires that the current configuration is alocal isomorphism), so Spoiler loses because he should repeat a previous move. Alsonote that only the information relative to the component where Spoiler has playedis relevant to Duplicator’s strategy, so her algorithm is referred to such componentonly. If p = 0 then Duplicator cannot move and loses. We point out that Duplicator’sstrategy is simpler than Spoiler’s one: this may account for the fact that the analysisof <-structures is quite easy. In general, the converse is true. Describing a strategy forSpoiler is an easier task, because, in logical terms, it is sufficient to exhibit a suitableformula that holds in one structure but not in the other. To prove that Duplicatorhas a winning strategy one needs to show that there is no way to build such a formula.The kind of analysis we have done for linear orderings may become overwhelminglycomplicated, if possible at all, for more general classes of structures.

Page 100: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

88 5. Intervals and games on words

Algorithm 9 Duplicator’s optimal strategy from position (Ln,Lp)Require: c is the element chosen by Spoiler in Ln

Require: p > 0Duplicator-Move

(n, p, c

)if n = p then

return celse if n < p then

if c− 1 < n− c thenreturn c

elsereturn p− (n− c)

end ifelse {n > p}

if c ∈ [1, bp/2c] thenreturn c

else if c ∈ [bp/2c, n] thenreturn p− (n− c)

elsereturn either bp/2 + 1c or dp/2e

end ifend if

5.6 Review of literature

5.6.1 Hanf’s theoremOne of the first general conditions to be developed for guaranteeing Duplicator a vic-tory can be linked to the work of Hanf ([32]). Such work was not directly relatedto EF-games: rather, it is concerned with elementary equivalence (two structures areelementarily equivalent if they satisfy the same first-order sentences). As such, itbetter applies to infinite structures. It states that elementary equivalence is guaran-teed provided that the structures realize the same multiset of isomorphism types ofr-neighborhoods.

Definition 5.6.1. Given two τ -structures A and B, we write A �r B if there is abijection f : A→ B such that NA

r (a) ∼= NBr (f(a)) for every a ∈ A.

Theorem 5.6.2 (Hanf). Two structures A and B are elementarily equivalent if A �r

B for all r ∈ N.

For every isomorphism type of neighborhoods, either both structures have in-finitely many points of that isomorphism type or both structures have the same finitenumber of points of that isomorphism type.

Theorem 5.6.2 is not very interesting for finite structures, because two finite struc-tures are elementarily equivalent if and only if they are isomorphic. Fagin et al. [21]

Page 101: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

5.6. Review of literature 89

have adapted the theorem to the finite: since elementary equivalence is too stronga notion, it is replaced by a weaker form of equivalence, based on the existence ofa winning strategy for Duplicator in an EF-game. By Theorem 5.3.5, this notioncoincides with m-equivalence. Intuitively, they require that every isomorphism typeoccurs equally often in both structures or it occurs very often in both structures. Thisis sufficient to ensure a winning strategy for Duplicator.

Given a τ -structure C and r ∈ N, let Ctr = { c ∈ C | |[NC

r (c)]∼=| ≤ t }. The set Ctr

contains the elements of the domain whose r-neighborhood does not occur very often(no more than t times) in the structure.

Definition 5.6.3. Given two τ -structures A and B, we write A �tr B if there is a

bijection f : Atr → Bt

r such that NAr (a) ∼= NB

r (f(a)) for every a ∈ Atr.

If A �tr B, then isomorphic r-neighborhoods occur the same number of times in

both structures or they occur more than t times in both structures. It is not difficultto prove that, if A �t

r B then A �t′

r′ B for every r′ < r and t′ < t.Now we are ready to state the theorem. Instead of using games directly, we follow

[16, 57] and give a proof based on Fraïssé’s theorem. We will use Fraïssé’s theoremalso in the proof of our results in Section 5.7.

Theorem 5.6.4 (Sphere lemma, [21]). Let A and B be two τ -structures with degreeat most d, and let m ∈ N. If A �t

r B for r = 3m−1 and t = m · d3m

, then A ≡m B.

Proof. By Theorem 5.2.2, we only need to prove that A ∼=m B. Note that r onlydepends on m, and that the cardinality of any 3i-ball, for 0 ≤ i < m, is bounded by∑3m−1

k=0 dk = (d3m−1)/(d−1) ≤ d3m

. So, for any tuple a1, . . . , ai, with 1 ≤ i ≤ m, and0 ≤ j < m, |B3j (a1, . . . , ai)| ≤ m · d3m

.Let a = a1, . . . , ai and b = b1, . . . , bi. Let I0, . . . , Im be a sequence of sets

of local isomorphisms such that Im = {∅} and, for 0 < i ≤ m, a local isomor-phism ((A,a), (B,b)) belongs to Im−i if and only if NA

3m−i(a) ∼= NB3m−i(b). We

verify the forth property (the back property is proved in a similar way). Assumethat the condition holds for i and let ai+1 ∈ A. We must find bi+1 ∈ B such thatNA

3m−i−1(a, ai+1) ∼= NB3m−i−1(b, bi+1). We distinguish two cases:

1. for some 1 ≤ j ≤ i, ai+1 ∈ NA2·3m−i−1(aj). In this case, NA

3m−i−1(ai+1) is a sub-structure of NA

3m−i(aj), and NA3m−i(aj) ∼= NB

3m−i(bj) by the inductive hypothesis.So, we may choose bi+1 as the mapping of ai+1 under such isomorphism.

2. ai+1 6∈ NA2·3m−i−1(a). In this case, BA

3m−i−1(ai+1) ∩ BA3m−i−1(a) = ∅, so we

must choose bi+1 such that BB3m−i−1(bi+1) ∩ BB

3m−i−1(b) = ∅. The existenceof an element satisfying this property is guaranteed by the hypothesis on themultiplicity of the neighborhoods. In fact, by the inductive hypothesis, BA

3m−i(a)and BB

3m−i(b) contain the same number of 3m−i−1-neighborhoods isomorphicto NA

3m−i−1(ai+1), and this number is bounded by t. Therefore, there must bean element b 6∈ BB

3m−i−1(b).

Page 102: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

90 5. Intervals and games on words

In [21], Theorem 5.6.4 is used together with a particular formulation of second-order EF-games (the so called Ajtai-Fagin games) and a technique based on playinggames on random structures to give simpler proofs of the following results:

• connectivity of finite (directed) graphs is not expressible in monadic Σ11, that

is by a formula of existential second-order logic where second-order quantifiersrange only over sets.

• As the above problem is easily seen to be in monadic Π11 (that is, univer-

sal second-order logic with monadic second-order quantifiers), it follows thatmonadic Σ1

1 does not coincide with monadic Π11.

The above results are shown to hold even in the presence of “built-in”4, or pre-interpreted, relations of “small” degree (for instance, in the presence of a successorrelation), namely of degree (log n)o(1), where n is the cardinality of the domain of thestructure.

The main features of the sphere lemma can be summarized as follows:

1. m-equivalence is captured by counting the multiplicity of substructures up to acertain threshold ;

2. such substructures are isomorphic neighborhoods of points;

3. it is essential that the two structures have bounded degree.

Theorem 5.6.4 has strong requirements. For instance, the multiplicities of sub-structures of different size need not have to be subject to the same threshold. More-over, substructures can be indistinguishable by Spoiler even if they are not isomorphic.In the next section, we will see how the latter requirement can be weakened.

5.6.2 Arora and Fagin’s conditionIn general, two (sub)structures need not be isomorphic for Duplicator to be able towin a game. So, the requirement of having isomorphic neighborhoods is too strong.In [7], Arora and Fagin exploit this fact to give a more versatile sufficient conditionfor the second player to have a winning strategy. Their result is still based on amultiplicity argument, but elements having the same “approximately isomorphic”neighborhoods are taken into consideration. Additional hypotheses, however, areneeded to counterbalance this less restrictive condition, the main of which regardsthe fact that neighborhoods are assumed to be tree-like structures.

Although Arora and Fagin’s theorem holds for structures over arbitrary languages,for the sake of simplicity we will refer to directed colored graphs, that is we fix alanguage γ = {(E, 2), (P1, 1), . . . , (Pk, 1)}, where E is the edge relation of the graph,and the unary predicates that label the nodes determine their color. Note that thereare at most 2k different colors, one for each possible combination of the truth values of

4Given an auxiliary vocabulary τ ′ disjoint from τ , a built-in relation is defined by an interpretationof symbols in τ ′ for each domain (up to isomorphism).

Page 103: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

5.6. Review of literature 91

the unary predicates. A color can be viewed as a description of the “type” of a node.The following definition generalizes this idea from single points to r-neighborhoodsaround points, and at the same time it weakens Definition 5.6.3.

Definition 5.6.5. Let G a γ-structure, and m, r ∈ N. The (m, r)-color of a node a ∈G is inductively defined as follows:

1. the (m, 0)-color of a is its color along with a description of whether it hasa self-loop (that is, whether EG(a, a) holds) and whether it is a distinguishedelement;

2. the (m, r + 1)-color of a is its (m, r)-color together with the following triples ofvalues, one for every possible (m, r)-color τ :

• the number of nodes b having (m, r)-color τ such that EG(a, b) holds andEG(b, a) does not hold, or ∞ if such number is at least m.

• the number of nodes b having (m, r)-color τ such that EG(a, b) does nothold and EG(b, a) holds, or ∞ if such number is at least m.

• the number of nodes b having (m, r)-color τ such that both EG(a, b) andEG(b, a) hold, or ∞ if such number is greater than m.

Given two γ-structures G,H we write G mr H if there is a bijection f : G→ H

such that a and f(a) have the same (m, r)-color, for all a ∈ G.

So, the (m, r)-color of a node partially describes the r-neighborhood around thatnode. The main feature of (m, r)-colors is related to the following remark: assumethat (undirected versions of) r-neighborhoods are trees. If two nodes a, b have thesame (m, r)-color, and there is a node c at distance δ from a having (m, r−δ)-color τ ,then there is a node d at distance δ from b having (m, r− δ)-color τ . Note that this isnot true in general: this is the reason why the following theorem requires that smallneighborhoods do not possess (undirected) cycles.

In the following result, the (m, r)-color of an edge is the ordered pair of the (m, r)-colors of the corresponding nodes.

Theorem 5.6.6. Let G and H be two γ-structures with degree at most d, and letm ∈ N. Then D(G,H,m) if the following conditions are satisfied:

1. G mr H for r = 32m;

2. G and H do not have undirected cycles of length less than r;

3. if EG(a, b) holds but EH(f(a), f(b)) does not hold, or viceversa, then there areat least dr edges in both structures having the same (m, r)-color as (a, b) (resp.,as (f(a), f(b))).

In [7] Theorem 5.6.6 is used to give a simpler proof than the one of [2] that directedreachability is not in monadic Σ1

1, and another proof that graph connectivity in not inmonadic Σ1

1 (see Section 5.6.1). Both results are shown to hold even in the presence

Page 104: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

92 5. Intervals and games on words

of particular families of built-in relations of degree no(1), where n is the size of thestructure.

As in the case of Fagin, Stockmeyer and Vardi’s theorem, the condition expressedby Theorem 5.6.6 is essentially based on counting the multiplicity of “equivalent” sub-structures, where “equivalence” is formalized as “having the same (m, r)-color”, thatis, roughly speaking, as having approximately the same local tree-like substructures5.

5.6.3 Schwentick’s extension theoremA question one may ask about EF-games is: Under which conditions can a “local”strategy be extended? For instance, we have seen (see Section 5.5) that m-equivalenceover linear orderings is a congruence, and this gives a simple way to compose winningstrategies. Answering this question for arbitrary structures leads to a somewhatdifferent approach with respect to what we have seen in previous sections.

In [54] a method to show the existence of a winning strategy for Duplicator basedon the extension of a local winning strategy is proposed. For the method to work, thestructures must be isomorphic except for some small parts, for which local winningstrategies exist by hypothesis. The advantage is that there are no further constraints,either on the degree or on the inner details of the substructures.

Suppose that C and D are two τ -structures such that D(C,D,m) for some m.Moreover, suppose that C and D are substructures of two τ -structures A and B,respectively. Duplicator still has a winning strategy from position (A,B,m) if thefollowing two conditions are satisfied:

1. Duplicator’s strategy for (C,D,m) can be extended to a winning strategy for(NA

2m(C), NB2m(D),m) in such a way that in every round the two chosen elements

have the same distance from C and D, respectively;

2. there is an isomorphism α : (A \ C) → (B \D) such that δ(x,C) = δ(α(x), D)whenever x ∈ BA

2m(C) \ C.

To parallel the exposition of shrinking games in Section 5.6.4, we define the fol-lowing “swelling game”. Let A and B be two τ -structures, let C ⊆ A and D ⊆ B,and let m ∈ N. A (C,D)-swelling game starts from position (A,B,m), with an initialinner area and an initial outer area, defined as follows:

initial inner area: I1 = C ∪D;

initial outer area: O1 = (A \BA2m(C)) ∪ (B \BB

2m(D)).

At round i Spoiler picks an element in one structure, possibly extending the innerarea or the outer area, and Duplicator replies by picking an element in the otherstructure, as in EF-games. The result is a new position, and, possibly, a larger innerarea Ii+1 or a larger outer area Oi+1. There are three kinds of rounds, governed bythe following rules:

5We mention that the constraint on the absence of small cycles can be relaxed at the expenseof adding further hypotheses, namely that edges satisfying the third condition of Theorem 5.6.6 are“far enough” from any small cycle. See [7] for the details.

Page 105: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

5.6. Review of literature 93

Inner round: Spoiler picks an element in Ii ∩ A (resp., Ii ∩ B). Then, Duplicatorreplies by choosing an element in Ii ∩ B (resp., Ii ∩ A). The inner and outerareas remain unchanged: Ii+1 = Ii and Oi+1 = Oi.

Outer round: Spoiler picks an element in Oi∩A (resp., Oi∩B). Then, Duplicatorreplies by choosing an element in Oi ∩ B (resp., Oi ∩ A). The inner and outerareas remain unchanged: Ii+1 = Ii and Oi+1 = Oi.

Extension round: Spoiler picks an element x in A \ (Ii ∪Oi) (resp., B \ (Ii ∪Oi)).If x is closer to the inner area, then the inner area is grown: Ii+1 = BA

δ(x,C)(C)∪BB

δ(x,C)(D), and the outer area remains unchanged: Oi+1 = Oi. If x is closerto the outer area, then the outer area is grown: Oi+1 = (A \ BA

δ(x,C)−1(C)) ∪(B \ BB

δ(x,C)−1(C)), and the inner area remains unchanged: Ii+1 = Ii. Then,Duplicator replies by picking an element in the opposite structure that belongsto the extended area.

The winning condition is the same as in EF-games, that is Duplicator wins if thefinal configuration is a local isomorphism. It is trivial to check that the possession ofa winning strategy in a swelling game immediately implies a winning strategy for theEF-game played from the same position. We now state Schwentick’s theorem in itssimplest form.

Theorem 5.6.7. Given two τ -structures A and B, let C ⊆ A and D ⊆ B, andlet m ∈ N. Duplicator has a winning strategy in a (C,D)-swelling game from posi-tion (A,B,m) if the following conditions are satisfied:

1. there is an isomorphism α from A � (A \ C) to B � (B \D);

2. Duplicator has a winning strategy in an EF-game from (NA2m(C), NB

2m(D),m)such that δ(a,C) = δ(b,D) whenever (a, b) is in a final configuration that iswinning for Duplicator;

3. for every a ∈ (A \ C), either δ(a,C) = δ(α(a), D) or both δ(a,C) > 2m andδ(α(a), D) > 2m.

Under these hypotheses, a winning strategy for Duplicator is guaranteed because,if Spoiler plays in the inner area, Duplicator then replies according to her local win-ning strategy, which exists by hypothesis (2); and if Spoiler plays in the outer area,Duplicator then replies according to the isomorphism α. The following invariant ismaintained:

Separation invariant: after round i the distance from every element in the innerarea and every element in the outer area is greater than 2m−i.

So, at the end of the game, no inner point is adjacent to any outer point. Let((A, i,o), (B, i′,o′)) be the final configuration, where i, i′ are the tuples of elementsin the (final) inner area and o,o are the tuples of elements in the (final) outer area.Then, ((A, i), (B, i′)) is a local isomorphism because Duplicator played according to

Page 106: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

94 5. Intervals and games on words

a winning strategy, and ((A,o), (B,o′)) is a local isomorphism because Duplicatorplayed according to the isomorphism α. As the separation invariant implies that noelement in i (resp., i′) is adjacent to an element in o (resp., o′), it follows that thefinal configuration of the swelling game is a local isomorphism.

Theorem 5.6.7 can be extended in several ways:

• different distance functions can be used (even two different functions for the twostructures of a game), the only requirement being that, for a distance function δ,and for any pair of points a, b, if δ(a, b) > 1 then the two points do not occur inthe same tuple of a relation of their structure.

• Winning strategies for several pairs of substructures can be combined.

• The separation invariant may be required for some relations, but not for others,by adding a kind of homogeneity condition that states that elements in the innerand outer areas behave in the same way with respect to the relations that do notsatisfy the separation invariant. For example, the separation invariant cannotbe satisfied if a linear ordering is present, because all elements are related toeach other. The theorem, however, can be modified to deal with this situation,by requiring that every outer element a of A relates in the same way, withrespect to the linear ordering, to all elements in the inner area of A, and thatits image α(a) relates in the same way in B.

As an application of (generalizations of) Theorem 5.6.7, in [54] it is proved thatconnectivity of finite graphs is not expressible in monadic Σ1

1 in the presence of built-in relations of degree no(1), which generalizes previous results (see Sections 5.6.1and 5.6.2), or even in the presence of a built-in linear ordering. Moreover, it isproved that monadic Σ1

1 with a pre-interpreted linear ordering is more expressivethan monadic Σ1

1 with a pre-interpreted successor relation.

5.6.4 Shrinking gamesThe idea of shrinking games, proposed in [34], is similar to Schwentick’s extensiontheorem, but it works in the opposite direction, by shrinking the playground accordingto a sequence of “scattering parameters”.

Definition 5.6.8. Let s = s0, s1, s2, . . . be a possibly infinite sequence of naturalnumbers, called scattering parameters. The sequence of local radii associated to s isdefined as follows:

r0 = 1,rn+1 = 2rn + sn.

Example 5.6.9. Let t ∈ N. The base t exponential scattering sequence and theassociated local radii are defined as follows:

si = (t− 2)ti,

ri = ti.

Page 107: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

5.6. Review of literature 95

A shrinking game hinges on a specific sequence of scattering parameters (and onthe associated local radii). Depending on these parameters, a move made by Spoileris considered either “local”, that is played in the neighborhood of another point inthe current configuration, or “scattered”, that is, played far from all the points of thecurrent configuration.

Definition 5.6.10. Let A be a τ -structure and s ∈ N. A set C ⊆ A is called s-scattered if δ(a, b) > s for all distinct a, b ∈ C.

The relevance of Definition 5.6.10 rests on the following observation, which iscrucial in the proof of Theorem 5.6.13.

Remark 5.6.11. Let s = s0, s1, . . . be a scattered sequence and A be a τ -structure.If, for some j, 2rj ≤ sj and C ⊆ A is an sj-scattered set, then the rj-neighborhoodaround any c ∈ C does not contain any other point of C apart from c itself.

Given two τ -structures A and B, let a = a1, . . . , ak and b = b1, . . . , bk be tuples ofelements of A and B respectively, let m ∈ N, and let s = s0, . . . , sm−1 be a sequenceof scattering parameters. The s-shrinking game from position ((A,a), (B,b),m) pro-ceeds according to the following rules. Spoiler chooses an integer 0 ≤ i < m, and hedecides whether to play a local round or a scattered round.

A local round is played as follows:

• Spoiler picks an element a ∈ BAri+si

(a) (resp., b ∈ BBri+si

(b));

• Duplicator replies with b ∈ BBri+si

(b) (resp., a ∈ BAri+si

(a));

• the new position is ((A,a, a), (B,b, b), i).

A scattered round is played as follows:

• Spoiler chooses a nonempty finite si-scattered set6 C ⊆ BAri

(a) (resp., C ⊆BB

ri(b)) such that Duplicator wins an (s0, . . . , si−1)-shrinking game from posi-

tion ((A, c), (A, d), i) (resp., ((B, c), (B, d), i)) for all c, d ∈ C, and if |a| = 0(resp., |b| = 0) then |C| ≤ m− i;

• Duplicator replies with an si-scattered set D ⊆ BBri

(b) (resp., D ⊆ BAri

(a)) suchthat |D| = |C|.

• Spoiler picks d ∈ D;

• Duplicator picks c ∈ C;

• the new position is ((A, c), (B, d), i) (resp., ((A, d), (B, c), i)).

During a scattered round, Spoiler proposes a set of equivalent points which are farfrom each other and are in the neighborhood of the current configuration. Duplicatormust do the same in the other structure.

6Here we assume that BAri

(a) is the whole domain A when |a| = 0, and the same for BBri

(b).

Page 108: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

96 5. Intervals and games on words

A shrinking game from position ((A,a), (B,b),m) has m rounds or less. Theending and winning conditions are the same as for EF-games. It is easy to showthat a winning strategy for Duplicator from ((A,a), (B,b),m) implies the existenceof a winning strategy for Duplicator from ((A,a), (B,b), j) for any j ≤ m. So, asm increases, the number of scattering moves available to Spoiler increases, becausehe can move from the current position by choosing an si-scattered set of points forany i < m.

Remark 5.6.12. The role of local radii has to do with the ability of combining strate-gies for “far enough” configurations. It can be proved by induction on m that, if Du-plicator has a winning strategy in s-shrinking games from positions ((A,a), (B,b),m)and ((A, c), (B,d),m), and δ(a, c) > rm and δ(b,d) > rm, then such strategies canbe joined into a winning strategy for Duplicator in an s-shrinking game from position((A,a, c), (B,b,d),m).

Unlike swelling games, it is by no means obvious that a winning strategy for aplayer in a shrinking game implies a winning strategy for that player in an EF-gamefrom the same position. The following result states that this is actually the case whenthe scattering sequence shrinks rapidly enough, that is if the ith scattering parameteris at least as twice as large as the ith local radius.

Theorem 5.6.13. Let m ∈ N, and let s = s0, . . . , sm−1 be a sequence of scatteringparameters such that 2ri ≤ si for all 0 ≤ i < m. If Duplicator has a winning strategyin the s-shrinking game from position (A,B,m), then D(A,B,m).

The proof of Theorem 5.6.13 shows, by induction on m, that Duplicator can winthe EF-game if she maintains the following invariant:

Shrinking invariant: after i rounds, Duplicator has a winning strategy in the(s0, . . . , si−1)-shrinking game from position ((A, a1, . . . , ai), (B, b1, . . . , bi),m −i), where a1, . . . , ai and b1, . . . , bi are the elements chosen by the players in thefirst i rounds of the EF-game.

The difficult part of the proof is when the element chosen by Spoiler in the EF-game is not in the neighborhood of the current configuration. Let a = a1, . . . , ai−1

and b = b1, . . . , bi−1 be the elements chosen in the first i − 1 rounds, and assumethat the shrinking invariant holds for i − 1. Suppose that, at round i, Spoiler picksai 6∈ BA

rm−i+sm−i(a). Then, Duplicator wants to find an element bi 6∈ BB

rm−i(b) such

that she can win the shrinking game from position ((A, ai), (B, bi),m − i). If shecan do so, by Remark 5.6.12, the shrinking invariant is satisfied. We say that anelement b ∈ B (resp., a ∈ A) is ai-good if Duplicator has a winning strategy in the(s0, . . . , si−1)-shrinking game from ((A, ai), (B, b),m−i) (resp., ((A, ai), (A, a),m−i)).

By contradiction, suppose that Duplicator cannot find bi as above. This meansthat all ai-good elements are in BB

rm−i(b). We consider a play of a shrinking game

from position ((A,a), (B,b),m− i) where Spoiler plays a scattered move by selectinga maximal sm−i-scattered set C ⊆ BB

rm−i(b) of ai-good points.

By Remark 5.6.11, Spoiler may pick at most one point around each element of thetuple b. Therefore, C contains at most i − 1 elements. By hypothesis, Duplicator

Page 109: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

5.7. Characterization of labeled sets with successor 97

can match Spoiler’s move by selecting a corresponding set D ⊆ BArm−i

(a) of sm−i-scattered ai-good points such that |D| = |C|. Note that ai 6∈ D, by hypothesis, andthat D ∪ {ai} is sm−i-scattered.

Now consider another play of the s-shrinking game from position (A,B,m), where,at the first round, Spoiler chooses j = m − i and plays a scattered round by select-ing D ∪ {ai}. We have just seen that this is an sm−i-scattered set of ai-good points.Moreover, |D ∪ {ai}| ≤ m − j, so this is a legal move indeed. As, by hypothesis,Duplicator has a winning strategy in this game, she must be able to choose an sj-scattered set of ai-good points in B, whose cardinality is |D ∪ {ai}| = |C| + 1. Wehave assumed that all ai-good points in B are inside BB

rm−i(b). So, this contradicts

the hypothesis that C had been chosen as a maximal set having those properties.

Games with a shrinking horizon are used in [34] to get a parametrized family ofnormal form theorems of the Gaifman type for first-order logic (see Section 5.4).

5.7 Characterization of labeled sets with successorThroughout this section, two expressions will recur very often, namely 2m−i − 1and 2m−i−1 (as we will see, they are the radii of entailing and reachable intervals atround i in an EF-game with m rounds). To make notation a little more compact, wewill give them names. So, let

emi , 2m−i−1, and rm

i , 2m−i − 1,

where “e” stands for “entailing” and “r”stands for “reachable”. To manipulate thesequantities symbolically, the following list of equations will be useful:

m−1∑k=i

emk = rm

i , (5.1)

emi = 2em

i+1, (5.2)

rmi = 2em

i − 1. (5.3)

5.7.1 Successor structures

Definition 5.7.1. For a given n ∈ N, the successor structure (or s-structure) ofsize n is the relational structure

Sn = ([1, n], sn),

where [1, n] ∈ INT (N) and sn = { (i, i+ 1) | i ∈ [1, n− 1] }.

Successor structures can be represented as linear graphs, or paths.The distance δ(a, b) (see Definition 5.1.9) between two elements of a structure Sn

is δ(a, b) = |a− b|.

Page 110: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

98 5. Intervals and games on words

We start by analyzing strategies involving moves in the neighborhoods of currentconfigurations. In each round, Spoiler can constrain Duplicator to make a specificmove when he plays within certain regions — which we will call “entailing” — whosesize halves after each round. The move Duplicator is forced to do inside such regionsmust “mimic” Spoiler’s action: she must select an element that has exactly the samedistance from close elements as Spoiler’s choice, and it lies “on the same side” withrespect to them. The following definition formalizes this concept.

Definition 5.7.2. Let a = a1, . . . , ak and b = b1, . . . , bk, and let m, i ∈ N, with i <m. A position ((Sn,a), (Sp,b),m − i) is locally safe for Duplicator if, for all 1 ≤j, l ≤ k, whenever δ(aj , al) ≤ em

i−1 or δ(bj , bl) ≤ emi−1, then aj − al = bj − bl.

The following lemma shows that Spoiler is able to force pairs in the neighborhoodsof previously chosen points, in the sense that for certain moves by Spoiler there is atmost one reply by Duplicator that preserves the local isomorphism.

Lemma 5.7.3. Let Sn and Sp be two s-structures, and let a = a1, . . . , ak andb = b1, . . . , bk be tuples of elements of [1, n] and [1, p], respectively. Let m, i ∈ Nwith i ≤ m. If position ((Sn,a), (Sp,b),m− i) is not locally safe for Duplicator, thenSpoiler has a winning strategy.

Proof. The proof is by induction on the number of remaining rounds.

Induction base: when i = m, the position is an ending position. Suppose that it isnot locally safe: then there are j, l such that aj − al 6= bj − bl. Without loss ofgenerality, we may assume that 0 ≤ aj−al ≤ em

m = 1/2. So, aj = al and bj 6= bl,hence the final configuration is not a local isomorphism.

Induction step: without loss of generality, suppose that, at position ((Sw,a), (Sw′ ,b),m−i), there are j, l such that 0 ≤ al − aj ≤ em

i−1 = 2emi and al − aj 6= bl − bj . Let

Spoiler pick ak+1 in Sw such that ak+1 − aj ≤ emi and al − ak+1 ≤ em

i . Thereis no bk+1 in Sw′ such that bk+1 − bj = ak+1 − aj and bl − bk+1 = al − ak+1

(otherwise, we would get bj − bl = aj − al, against the hypothesis). So, the newposition is not locally safe and, by the inductive hypothesis, it is winning forSpoiler.

So, positions that are not locally safe for Duplicator are winning for Spoiler. Asthe game goes on and less rounds are left, Spoiler’s ability to force moves exponentiallydecreases.

The bound emi−1 in Lemma 5.7.3 is tight: at round i, Spoiler may not be able to

force Duplicator to play at the same distance when he picks an element whose distancefrom previously chosen elements is greater than em

i−1. The example in Figure 5.1,illustrating a game in three rounds, shows that, in general, Spoiler cannot force pairsoutside entailing regions. This justifies the following definition.

Page 111: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

5.7. Characterization of labeled sets with successor 99

First round

Second round

Third round

S1

S2

1 2 3 4 5 6 7 8 9

2 3 4 5 6 7 81

S1

S2

2 3 4 5 6 7 8 9

2 3 4 5 6 7 81

S1

S2

2 3 4 5 6 7 8 9

2 3 4 5 6 7 81

1

1

Figure 5.1: Spoiler’s moves are circled. Duplicator’s moves are squared. Entailing intervalsafter each round are shown with thick lines. At the second round, Spoiler chooses element 8in S9, which is outside the entailing interval around element 5: Duplicator can safely replywith element 2 in S8.

Definition 5.7.4. Let Sn be an s-structure. Let a ∈ [1, n] and m, i ∈ N, with i ≤ m.The i/m-entailing interval around a is NSn

emi

(a). For a tuple a, NSnem

i(a) is called the

i/m-entailing region around a.

An entailing interval is not exactly an interval according to Definition 2.1.12,because it has some additional structure, but this abuse of terminology will turn outto be useful. An entailing region is a union of entailing intervals.

Remark 5.7.5. Lemma 5.7.3 implies that, if in a given position of a game Spoilerpicks an element outside all entailing intervals, Duplicator must do the same.

We can summarize the content of Lemma 5.7.3 by the following rule of thumb forDuplicator:

In the entailing neighborhood of a previously chosen element pick an ele-ment at the same distance as Spoiler does.

In s-structures (and in labeled s-structures discussed in Section 5.7.2) there is alwaysone single feasible reply to each Spoiler’s move in the entailing region. This is nottrue for arbitrary structures, but the above rule is valid in general.

Page 112: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

100 5. Intervals and games on words

Lemma 5.7.3 describes which moves Spoiler can force in the next round. Byapplying the lemma iteratively, we can say what Spoiler can force from a positionup to the end of a game.

Definition 5.7.6. Let Sn be an s-structure. Let a ∈ [1, n] and m, i ∈ N, with i ≤ m.The i/m-reachable interval around a is NSn

rmi

(a). For a tuple a, NSnrm

i(a) is called the

i/m-reachable region around a.

Lemma 5.7.7. Necessary condition for Duplicator to be able to win a game from posi-tion ((Sn,a), (Sp,b),m−i) is that the i/m-reachable interval around aj is isomorphicto the i/m-reachable interval around bj, for 1 ≤ j ≤ k.

Proof. If N (Sn,a)rm

i(aj) � N

(Sp,b)rm

i(bj), for some j, then every difference between the two

intervals can be found by Spoiler by playing at most m− i entailing moves. Withoutloss of generality, we assume that Spoiler plays his moves in Sn. For, let Spoiler makea sequence ofm−imoves by picking ak+1, . . . , ak+m−i+1 in Sn such that δ(ak+1, aj) ≤emi−1 and δ(al+1, al) ≤ em

i+l−k−1, for k < l ≤ k+m− i. By Equation (5.1), such movesspan a distance of up to rm

i elements from aj (see Figure 5.2). By Lemma 5.7.3, eachone of these moves requires Duplicator to mimic Spoiler to maintain the positionlocally safe, because each move is done in an entailing interval, and she can do soonly if the two intervals are isomorphic.

By Lemma 5.7.7, if Spoiler, at round i, chooses the element a in [1, rmi ] ∪ [n −

rmi , n] in Sn, Duplicator must reply with a in Sp (and viceversa), otherwise the

reachable intervals around a in the two structures will not be isomorphic. Therefore,the “borders” of an s-structure are entailing zones, in the sense that near the beginningand the end of an s-structure Duplicator’s strategy determines, at each round, abijective mapping. Figure 5.3 gives a picture of the situation.

Lemma 5.7.6 suggests the following definition.

Definition 5.7.8. A position ((Sn,a), (Sp,b),m− i) is globally safe if it is locallysafe and the i/m-reachable interval around aj is isomorphic to the i/m-reachable inter-val around bj, for 1 ≤ j ≤ k.

Note that the rmi -neighborhoods around aj and bj may be isomorphic for all j,

even if the position is not locally safe.

a

Reachable interval

Figure 5.2: The reachable region around a when m = 4 and a is picked by Spoiler at thefirst move.

We now give a structural characterization of EF-games on s-structures.

Page 113: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

5.7. Characterization of labeled sets with successor 101

i/m-reachable interval

i/m-entailing interval

a

em

i

rm

i

Figure 5.3: The ith move of Spoiler, picking ai, determines a reachable region ofsize 2m−i+1 − 1 around ai, which Duplicator must match in the other structure when pick-ing bi. Besides, at the (i + 1)th round, Spoiler can force pairs in the entailing region ofsize 2m−i + 1 around ai and bi.

Theorem 5.7.9. Let Sn and Sp be two s-structures, and let m ≥ 2. Then,

D(Sn,Sp,m) ⇐⇒ Sn∼= Sp ∨ n, p ≥ 2m.

Proof. This result can be derived as a corollary of Theorem 5.7.21 (considering |Σ| =1).

When m = 1, Duplicator wins as long as n, p > 0 (or n = p = 0). Note that,unlike the case of linear orderings, here we cannot exploit the congruence of winningstrategies.

Lemma 5.7.10. Given Sn and Sp, the remoteness rem(n, p) of (Sn,Sp) is

rem(n, p) =

{2blog2 min(n, p)c+ 1 if n 6= p,

2n if n = p.

Proof. If n 6= p, by Theorem 5.7.9, Spoiler wins when min(n, p) < 2m. So, he needsno more than m = blog2 min(n, p) + 1c rounds to exploit a difference in a game fromposition (Sn,Sp). The case n = p is straightforward.

Theorem 5.7.11. Let Sn and Sp be two s-structures, and let a and b be twononempty tuples of elements in [1, n] and [1, p], respectively, such that |a| = |b|.Then,

D((Sn,a), (Sp,b),m) ⇐⇒ ((Sn,a), (Sp,b),m) is globally safe.

Proof. (⇒) The proof is by contraposition. If n 6= p and n < 2m or p < 2m thenSpoiler wins by Theorem 5.7.9 (the winning strategy is independent of the initialconfiguration). If ((Sn,a), (Sp,b),m) is not globally safe, then Spoiler wins eitherby Lemma 5.7.3 or by Lemma 5.7.7.

(⇐) We build a sequence of sets of local isomorphisms having the back-and-forthproperty, and apply Fraïssé’s Theorem.

Page 114: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

102 5. Intervals and games on words

5.7.2 Labeled s-structuresDefinition 5.7.12. Let Σ be a finite alphabet, and let w ∈ Σ∗ a word of length |w| =n. The labeled successor structure (or labeled s-structure) for w is the relationalstructure

Sw = ([1, n], s, {Pc}c∈Σ),

where [1, n] ∈ INT (N), s is the successor relation over [1, n] and, for each c ∈ Σ,Pc = { i | i ∈ [1, n] ∧ wi = c }.

A labeled s-structure is a linear graph whose nodes are labeled with letters from Σ.Entailing and reachable intervals for labeled s-structures are as in Definition 5.7.4,

where Sn is replaced by Sw. Note that such intervals correspond in a natural wayto substrings of the word w.

Definition 5.7.13. Given a word w = w1 · · ·wn, i ∈ [1, n] and r ∈ N, the factorof w of radius r centered at position i, written wr(i), is wi−r · · ·wi · · ·wi+r, where weassume, for convenience, that wk = $ for k < 1 or k > n, with $ 6∈ Σ. We denote theset of factors of radius r of a word w with Fr(w).

Then, for i ∈ [1, n], wr(i) coincides with the substructure NSwr (i) of Sw.

Note that, by the above definition, the length of wr(i) is always 2r+1, even if i < ror i > n− r.

If applied to labeled s-structures, Lemma 5.7.7 immediately implies that Dupli-cator can win only if corresponding reachable intervals are isomorphic in the twostructures. From the point of view of words, this implies the following corollaryof Lemma 5.7.7.

Corollary 5.7.14. Duplicator can win an EF-game from ((Sw,a), (Sw′ ,b),m) onlyif w and w′ have the same factors of length rm

0 , and the same prefix and suffix oflength rm

1 .

So, an outline of a winning strategy for Duplicator requires the following:

1. in each round, Duplicator must be able to find a sufficiently long factor thatmatches the reachable interval around Spoiler’s choice;

2. If Spoiler plays outside all entailing intervals, Duplicator must be able to do thesame in the other structure, at the same time respecting (1).

To guarantee (1), it is sufficient to require that w and w′ have the same factors ofsuitable lengths. To guarantee (2), we must ensure that there are enough copies ofsuch factors (or that both words have the same number of them), and that they aredistributed in a similar way in both words. We now formalize these concepts.

Definition 5.7.15. Let w ∈ Σ∗ and v a factor of w. The multiplicity ρw(v) of vin w is the number of occurrences of v in w.

Definition 5.7.16. Let A ⊆ N. An l-partition of A is a partition of A such that forall i, j ∈ A, if i and j are in the same class, then |i− j| ≤ l + 1.

Page 115: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

5.7. Characterization of labeled sets with successor 103

Definition 5.7.17. Let occw(v) be the set of starting positions of the occurrencesof v in w. The offset-multiplicity σw(v) of v in w is the minimum cardinality of a|v|-partition of occw(v).

The offset-multiplicity corresponds to the maximum “scattering” of the occur-rences of a substring v, that is the maximum number of occurrences of v whosepairwise distance is greater than |v|+ 1. See Figure 5.4 for an example.

w = a b a b a b a b b a b a a b a b a

13

510 13

15

Figure 5.4: The occurrences of aba in w. Offset-partitions of occw(abab) are, for instance,({1}, {3}, {5}, {10, 13}, {15}), ({1, 3}, {5}, {10}, {13, 15}), ({1, 3, 5}, {10, 13}, {15}). It is easyto check that the last one is also a minimal offset-partition, so the offset-multiplicity of abain w is 3 (the multiplicity of aba in w is 6).

Definition 5.7.18. Let ∼rmi

be the equivalence relation over Σ∗ defined as follows:given two words w,w′ ∈ Σ∗, w ∼rm

iw′ if and only if

1. Frmi

(w) = Frmi

(w′), and

2. for every v ∈ Frmi

(w), we have σw(v), σw′(v) ≥ i or (σw(v) = σw′(v) andρw(v) = ρw′(v)).

Definition 5.7.19. Given a word w ∈ Σ∗, i, j ∈ [1, |w|] and r ∈ N, we say that wr(i)falls inside wr′(j) if |i− j| ≤ r′.

See Figure 5.5.

r

r′

a

b

Figure 5.5: The occurrence around a of radius r falls inside the occurrence around b ofradius r′.

The following lemma will be used in the proof of Theorem 5.7.21.

Lemma 5.7.20. Let i,m ∈ N with i ≤ m. Given a word w ∈ Σ∗ and a factor v ∈Frm

i+1(w), σw(v) ≤ k if and only if there is a tuple of positions a = a1, . . . , ak ∈ [1, |w|]

such that all occurrences of v fall inside the i/m-entailing region around a.

Page 116: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

104 5. Intervals and games on words

Proof. Suppose that all occurrences of v fall inside the i/m-entailing intervals arounda1, . . . , ak. Define a partition of occw(v) such that all occurrences in the same classfall inside a common entailing interval. Then, the distance between two occurrencesof v in the same class is at most 2em

i = emi−1 = (2rm

i+1 + 1) + 1 = |v| + 1. So, thepartition is a |v|-partition with at most k classes.

For the converse, suppose that σw(v) ≤ k. Let P = {I1, . . . , Ik} be a (not necessar-ily minimal) |v|-partition of occw(v). The distance between any two occurrences in thesame class is at most |v|+ 1 = 2em

i . Then, for every j = 1, . . . , k there is aj ∈ [1, |w|]such that, for all c ∈ Ij , δ(aj , c) ≤ em

i (for instance, take aj = b(max Ij+min Ij)/2c), soall occurrences in Ij fall inside the i/m-entailing interval around aj .

Now we are ready to state our main result.

Theorem 5.7.21. Given two words w,w′ ∈ Σ and m ∈ N,

D(Sw,Sw′ ,m) ⇐⇒ w ∼rmiw′, for 1 ≤ i ≤ m.

Proof. (⇐): The proof uses Theorem 5.2.2. We define a sequence of sets I0, . . . , Imof local isomorphisms such that7 {(aj , bj)}1≤j≤i is in Im−i if and only if, for everyj = 1, . . . , i, wrm

i(aj) = w′rm

i(bj) and, for all 1 ≤ j, l ≤ i, whenever δ(aj , al) ≤

emi or δ(bj , bl) ≤ em

i , then aj − al = bj − bl. By the equivalence of Fraïssé’s andEhrenfeucht’s characterization, we only need to prove that such sequence satisfies theback and forth properties of Definition 5.2.1.

Let us prove the forth property. Let a = ai+1 ∈ [1, |w|]. We distinguish two cases:

1. for some 1 ≤ j ≤ i, a is in the i/m-entailing interval around aj . Then, we maychoose b = bi+1 ∈ [1, |w′|] such that a−aj = b−bj , because in this case wrm

i+1(a)

is a factor of wrmj

(aj), and wrmj

(aj) = w′rmj

(bj) by the inductive hypothesis.

2. Let α = wrmi+1

(a). If a is outside all i/m-entailing intervals, we must choose b out-side the entailing region of Sw′ (see Remark 5.7.5) such that w′rm

i+1(b) = α. For

the sake of contradiction, assume that this is not possible, that is all b ∈ [1, |w′|]satisfying w′rm

i+1(b) = α fall inside the i/m-entailing intervals around b1, . . . , bi.

Then, by Lemma 5.7.20, the offset-multiplicity of α in w′ is at most i. So, thehypothesis of the theorem implies that α must have the same multiplicity bothin w and in w′.

Since every w′rmi+1

(b) such that w′rmi+1

(b) = α falls inside the i/m-entailing intervalaround some bj , and rm

i+1 < emi , every w′rm

i+1(b) is a factor of w′rm

i(bj). By

the inductive hypothesis, w′rmi

(bj) = wrmi

(aj), so all such occurrences exist alsoin w. But, as α is outside the i/m-entailing region of w, it cannot be amongsuch occurrences. Therefore, ρw(α) > ρw′(α), which contradicts the hypothesisof the theorem.

7Note that Im only contains the empty map.

Page 117: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

5.7. Characterization of labeled sets with successor 105

The back property can be proved in a similar way.

(⇒): We describe Spoiler’s winning strategy when w �rmi ,i w

′ for some i. Withoutloss of generality, suppose that, for some 1 ≤ i+ 1 ≤ m, there is v ∈ Frm

i+1(w) having

offset-multiplicity σ1 < i + 1 in w and offset-multiplicity σ2 > σ1 in w′. Then, byLemma 5.7.20, there are positions a = a1, . . . , aσ1 in w such that all occurrencesof v fall inside the i/m-entailing intervals around a. Let Spoiler pick such elements(possibly repeating moves) in the first i rounds.

At round (i + 1), the i/m-entailing region of w covers all occurrences of v, and,since Duplicator must match the reachable intervals, corresponding occurrences are inthe entailing region of w′. Since σw′(v) > σ1, there must be an occurrence of v in w′

outside all entailing intervals. Let Spoiler pick the center of such occurrence. Spoilerwins because Duplicator must reply inside an i/m-entailing interval (see Remark 5.7.5)or choose a non-matching (i+1)/m-reachable interval.

As for other case, suppose that, for some 1 ≤ i + 1 ≤ m, there is v ∈ Frmi+1

(w)such that σw(v) = σw′(v) < i+1, but ρw(v) < ρw′(v). As before, Spoiler will move inorder to make all occurrences of v in w fall inside i/m-entailing intervals after round i,forcing Spoiler to cover the same occurrences and leave out of the i/m-entailing regionin w′ at least one occurrence of v. This must be possible, otherwise v would havethe same multiplicity in w and w′. At round i + 1, Spoiler selects the center of anoccurrence of v outside all entailing intervals. This will force Duplicator to reply inan entailing interval or choose a non-matching (i+1)/m-reachable interval, and lose.

By putting together the previous results, we get the following characterization.

Theorem 5.7.22. Given two words w,w′ ∈ Σ∗, and m ∈ N,

D((Sw,a), (Sw′ ,b),m) ⇐⇒ w ∼rmiw′, for 1 ≤ i ≤ m,

and ((Sw,a), (Sw′ ,b))is globally safe.

Proof. (⇒) By contraposition, using Theorem 5.7.21 and Theorem 5.7.11.(⇐) The proof goes as in Theorem 5.7.21, by considering local isomorphisms

extending ((Sw,a), (Sw′ ,b)).

Page 118: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

106 5. Intervals and games on words

Page 119: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

Conclusions

Let us summarize what we have done in this thesis:

• In Chapter 2, a framework for modeling periods and intervals has been de-voloped, based on what has been done in the literature. The relationship be-tween the notion of a period and the more restrictive notion of a (set-)intervalhas been analyzed to some extent, with special attention to the linear case.A characterization of period structures as interval structures over unboundedlinear orderings has been given.

• In Chapter 3, a class of non-canonical interval models has been proposed, anda propositional interval logic for such structures (split logic) has been defined.Its decidability has been proved by establishing a connection with the monadicsecond-order theories of layered structures for time granularity. Besides, a corre-spondence with the guarded fragment of such theories has been described and anexpressive completeness result with respect to such fragment has been proved.Definability of operators and comparison with the semantics of canonical modelshave been clarified.

• In Chapter 4, we have used intervals as a reasoning tool to develop an algorithmfor solving particular constraint satisfaction problems over finite domains, and toprove its correctness. Such problems arise naturally in the field of computationalbiology, where structured motifs must be located in whole genomes. Constraintscan be represented in the form of a graph, each node of which represents anoccurrence of a simple motif and edges join occurrences that may occur in thesame structured motif. The particular form of the graph induces in an obviousway a notion of interval (of nodes), and there are only two possible relationsbetween such intervals: in terms of Allen’s relations, either one overlaps theother, or one precedes the other. Based on the consequences of such property, alinear-time algorithm for the manipulation of the graph has been designed. As aresult, the potentially exponentially many solutions of the contraint satisfactionproblems can be reprented as a compact data structure.

• In Chapter 5 we have studied Ehrenfeucht-Fraïssé games played over models cor-responding to words over a fixed alphabet, namely labeled linear structures withthe successor relation. The goal was to give a characterization of the winningstrategies for the players based on the structural properties of words. Our char-acterization is based on partitioning “reachable intervals” (which are substringsof exponential length) according to their degree of overlapping, and on countingthe multiplicities of the intervals and the multiplicities of the equivalence classesthey belong to.

Page 120: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

108 Conclusions

Some open problems related to split logics deserve more attention. Split logicsshow that decidability of interval logics can be achieved by considering non-canonicalmodels. It would be interesting to devise a larger class of non-canonical models (e.g.,allowing some form of overlapping) over which decidability is preserved. On the otherhand, an unexplored question is whether there are interesting classes of formulasfor which the validity problem is the same over split frames and canonical intervalstructures. We hinted how split logics might be used in computational linguistics,but a more detailed analysis should be made.

As far as EF-games are concerned, a lot of interesting problems can be formulated:a structural characterization of a winning strategy leads to an algorithmic solution ofthe problem of determining the existence of a winning strategy, but also to efficientalgorithms to play games optimally. To our knowledge, this topic is almost completelyunexplored. As EF-games are used to compare models, it is natural to apply theseprocedures in situations where the approximate comparison of strings is relevant: theforemost example can probably be found in genome analysis. Due to the flexibility oftheir rules, EF-games could be adapted to this application field in several ways. Forexample, to introduce further degrees of freedom in the comparison, players mightbe allowed to cheat, e.g. to change a letter in a word during a play, or to violaterelational constraints in a limited way. Games over other relational structures maybe investigated, too: a natural choice is to replace the successor relation with theless-than relation <. Finally, the same questions may be shifted to different typesof games: the choice is embarrassingly wide, for almost any logical formalism maybe associated to a game-theoretic method: pebble games, second-order games, modalgames and infinite games are some of most interesting examples.

All these word games are more complex to analyse: which kind of plays wouldresult from these variations, how winning strategies could be characterized, how theywould be tied to logic, is not known.

Page 121: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

Bibliography

[1] M. Aiello. A Spatial Similarity Measure based on Games: Theory and Practice.Journal of the IGPL, 10(1):1–22, 2002.

[2] M. Ajtai and R. Fagin. Reachability is harder for directed than undirected finitegraphs. Journal of Symbolic Logic, 55:113–150, 1990.

[3] J. F. Allen. Maintaining Knowledge about Temporal Intervals. Communicationsof the ACM, 26:832–843, 1983.

[4] J. F. Allen and P. J. Hayes. A Common-sense Theory of Time. In Proc. of the 9thInternational Joint Conference on Artificial Intelligence, pages 528–531. MorganKaufmann, 1985.

[5] J. F. Allen and P. J. Hayes. Short Time Periods. In Proc. of the 10th InternationalJoint Conference on Artificial Intelligence, pages 981–983, 1987.

[6] K. R. Apt. Principles of Constraint Programming. Cambridge University Press,2003.

[7] S. Arora and R. Fagin. On winning strategies in Ehrenfeucht-Fraïssé games.Theoretical Computer Science, 174:97–121, 1997.

[8] E. R. Berlekamp, J. H. Conway, and R. K. Guy. Winning Ways for Your Math-ematical Plays, volume 2. A K Peters Ltd, second edition, January 2003.

[9] P. Blackburn, M. de Rijke, and Y. Venema. Modal Logic. Cambridge UniversityPress, 2001.

[10] F. Cattonaro, I. Jurman, and M. Morgante. The Alisei family of Gypsy-likeretrotransposons in Norway spruce (Picea abies L., Karsten) genome. In prepa-ration.

[11] Z. Chaochen and M. R. Hansen. An Adequate First Order Interval Logic. InCOMPOS’97: Revised Lectures from the International Symposium on Composi-tionality: The Significant Difference, pages 584–608. Springer-Verlag, 1998.

[12] M. Crochemore and M.-F. Sagot. Motifs in sequences: localization and extrac-tion. In A. Konopka et al., editors, Handbook of Computational Chemistry.Marcel Dekker Inc., 2002. in press.

[13] R. Dechter, I. Meiri, and J. Pearl. Temporal constraint networks. ArtificialIntelligence, 49:61–95, 1991.

Page 122: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

110 Bibliography

[14] K. M. Devos, K. M. Brown, and J. L. Bennetzen. Genome Size Reductionthrough Illegitimate Recombination Counteracts Genome Expansion in Ara-bidopsis. Genome Res., 12(7):1075–1079, 2002.

[15] S. Dong and D. B. Searls. Gene Structure Prediction by Linguistic Methods.Genomics, 23:540–555, 1994.

[16] H.-D. Ebbinghaus and J. Flum. Finite Model Theory. Springer Verlag, 1995.

[17] A. Ehrenfeucht. An application of games to the completeness problem for for-malized theory. Fundamenta Mathematicae, 49:129–141, 1961.

[18] I. Eidhammer, I. Jonassen, S. H. Grindhaug, D. Gilbert, and M. Ratnayake. AConstraint Based Structure Description Language for Biosequences. Constraints,6(2/3):173–200, 2001.

[19] E. A. Emerson. Temporal and Modal Logic. In J. van Leeuwen, editor, Handbookof Theoretical Computer Science, pages 996–1072. Elsevier, 1990.

[20] U. Endriss and D. Gabbay. Halfway between Points and Intervals: A TemporalLogic Based on Ordered Trees. In V. Goranko and A. Montanari, editors, ESSLLIWorkshop on Interval Temporal Logics and Duration Calculi, pages 100–109,August 2003.

[21] R. Fagin, L. Stockmeyer, and M. Y. Vardi. On monadic NP vs. monadic co-NP.Inform. and Comput., 120(1):78–92, 1995.

[22] R. Fraïssé. Sur quelques classifications des systèmes de relations. PublicationsScientifiques, 1:35–182, 1954.

[23] M. Franceschet. Dividing and Conquering the Layered Land. PhD thesis, Depart-ment of Mathematics and Computer Science, University of Udine, Italy, 2002.PhD Thesis Series CS 2002/2.

[24] K. Fredriksson and G. Navarro. Average-Optimal Multiple Approximate StringMatching. In Proc. of the 14th Annual Symposium on Combinatorial PatternMatching (CPM 2003), volume 2676 of LNCS, pages 109–128, 2003.

[25] H. Gaifman. On local and nonlocal properties. In J. Stern, editor, Proceedings ofthe Herbrand Symposium, Logic Colloquium ’81, pages 105–135. North HollandPub. Co., 1982.

[26] R. Giegerich, S. Kurtz, and J. Stoye. Efficient Implementation of Lazy SuffixTrees. In Proc. of the Third Workshop on Algorithmic Engineering (WAE99),volume 1668 of LNCS, pages 30–42, 1999.

[27] V. Goranko, A. Montanari, and G. Sciavicco. A Road Map on Interval TemporalLogics and Duration Calculi. Journal of Applied Non-Classical Logics, 2004.

Page 123: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

Bibliography 111

[28] G. Grillo, F. Licciulli, S. Liuni, E. Sbisè, and G. Pesole. PatSearch: a program forthe detection of patterns and structural motifs in nucleotide sequences. NucleicAcids Res., 31(13):3608–3612, 2003.

[29] D. Gusfield. Algorithms on Strings, Trees and Sequences: Computer Science andComputational Biology. Cambridge University Press, New York, 1997.

[30] J. Y. Halpern, Z. Manna, and B. Moszkowski. A Hardware Semantics Based onTemporal Intervals. In Proc. of the 10th International Colloquium on Automata,Languages and Programming, volume 154 of LNCS, pages 278–291. Springer,1983.

[31] J. Y. Halpern and Y. Shoham. A Propositional Modal Logic of Time Intervals.Journal of the ACM, 38(4):935–962, 1991.

[32] W. Hanf. Model-Theoretic Methods in the Study of Elementary Logic. In J. W.Addison, L. Henkin, and A. Tarski, editors, The Theory of Models, pages 132–145. North-Holland, Amsterdam, 1965.

[33] V. Kapitonov and J. Jurka. Rolling-circle transposons in eukaryotes. Proc. Natl.Acad. Sci. USA, 98(15):8714–8719, July 2001.

[34] H. J. Keisler and W. B. Lotfallah. Shrinking Games and Local Formulas. Annalsof Pure and Applied Logic, 128:215–225, 2004.

[35] S. R. Klein, R. J.and Eddy. RSEARCH: Finding homologs of single structuredRNA sequences. BMC Bioinformatics, 4(44), 2003.

[36] A. Kumar and J. L. Bennetzen. Plant Retrotransposons. Annu. Rev. Genet.,33:479–532, 1999.

[37] A. Kumar and H. Hirochika. Applications of retrotransposons as genetic toolsin plant biology. Trends in Plant Sciences, 6:127–134, March 2001.

[38] S. Kurtz, E. Ohlebusch, C. Schleiermacher, J. Stoye, and R. Giegerich. Computa-tion and Visualization of Degenerate Repeats in Complete Genomes. In Proc. ofthe International Conference on Intelligent Systems for Molecular Biology, pages228–238, Menlo Park, CA, 2000. AAAI-Press.

[39] P. B. Ladkin. The Logic of Time Representation. PhD thesis, University ofCalifornia, Berkeley, 1987.

[40] S. Lal, M. J. Giroux, V. Brendel, C. E. Vallejos, and L. C. Hannah. The maizegenome contains a helitron insertion. Plant Cell., 15(2):381–391, February 2003.

[41] K. Lodaya. Sharpening the Undecidability of Interval Temporal Logic. In Proc. of6th Asian Computing Science Conference, volume 1961 of LNCS, pages 290–298.Springer, 2000.

Page 124: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

112 Bibliography

[42] E. M. McCarthy and J. F. McDonald. LTR_STRUC: a novel search and identifi-cation program for LTR retrotransposons. Bioinformatics, 19(3):362–367, Febru-ary 2003.

[43] G. Mehldau and E. W. Myers. A System for Pattern Matching Applications onBiosequences. In CABIOS, number 9(3), pages 299–314, 1993.

[44] A. Montanari. Metric and Layered Temporal Logic for Time Granularity. PhDthesis, Institute for Logic, Language, and Computation, University of Amster-dam, 1996.

[45] A. Montanari, A. Peron, and A. Policriti. Decidable theories of ω-layered metrictemporal structures. Logic Journal of the IGPL, 7(1):79–102, 1999.

[46] A. Montanari, G. Sciavicco, and N. Vitacolonna. Decidability of Interval Tempo-ral Logics over Split-Frames via Granularity. In Proc. of the European Conferenceon Logic in Artificial Intelligence 2002, number 2424 in LNAI, pages 259–270.Springer, 2002.

[47] B. Moszkowski. Reasoning about Digital Circuits. PhD thesis, Departmentof Computer Science, Stanford University, Technical Report STAN-CS-83-970,Stanford, CA, 1983.

[48] E. W. Myers. Approximate Matching of Network Expressions with Spacers.Journal of Computational Biology, 1(3):33–51, 1996.

[49] E. W. Myers, P. Oliva, and K. Guimãraes. Reporting exact and approximateregular expression matches. In M. Farach-Colton, editor, Proc. of the 9th AnnualSymposium on Combinatorial Pattern Matching, volume 1448 of LNCS, pages91–103, Piscataway, NJ, 1998. Springer-Verlag, Berlin.

[50] G. Navarro and M. Raffinot. Fast and Simple Character Classes and BoundedGaps Pattern Matching, with Application to Protein Searching. In Proc. 5th An-nual International ACM Conference on Computational Molecular Biology (RE-COMB’01), pages 231–240, 2001.

[51] E. Pezzoli. Computational Complexity of Ehrenfeucht-Fraïssé Games on FiniteStructures. Lecture Notes in Computer Science, 1584:159–170, 1999.

[52] A. Pnueli. The Temporal Logic of programs. In Proc. 18th Ann. IEEE Symp.on Foundations of Computer Science, pages 46–57, 1977.

[53] A. Policriti, N. Vitacolonna, M. Morgante, and A. Zuccolo. Structured motifssearch. In RECOMB, pages 133–139, 2004.

[54] T. Schwentick. On winning Ehrenfeucht games and monadic NP. Annals of Pureand Applied Logic, 79:61–92, 1996.

Page 125: Intervals: logics, algorithms and games · 2015. 7. 22. · intervals be linearly ordered sets of points. Nonetheless, such constraint alone is not sufficient, in general, to obtain

Bibliography 113

[55] G. Sciavicco. Adventures in Propositional Interval Temporal Logics. PhD thesis,Department of Mathematics and Computer Science, University of Udine, Italy,2004. PhD Thesis Series CS 2004/3.

[56] L. Stein. Genome annotation: from sequence to biology. Nature Review Genetics,2(7):493–503, July 2001.

[57] W. Thomas. On the Ehrenfeucht-Fraïssé Game in Theoretical Computer Science.Lecture Notes in Computer Science, 668:559–568, 1993.

[58] J. van Benthem. The Logic of Time. Kluwer Academic Press, second edition,1991.

[59] Y. Venema. A Modal Logic for Chopping Intervals. Journal of Logic and Com-putation, 1(4):453–476, 1991.

[60] A. Zuccolo and M. Morgante. Abundance, distribution and phylogenetic rela-tionships of LTR retrotransposons in the rice genome. Submitted for publication.