• Aucun résultat trouvé

Expressiveness of a spatial logic for trees

N/A
N/A
Protected

Academic year: 2021

Partager "Expressiveness of a spatial logic for trees"

Copied!
11
0
0

Texte intégral

(1)

HAL Id: inria-00536696

https://hal.inria.fr/inria-00536696

Submitted on 16 Nov 2010

HAL

is a multi-disciplinary open access archive for the deposit and dissemination of sci- entific research documents, whether they are pub- lished or not. The documents may come from teaching and research institutions in France or

L’archive ouverte pluridisciplinaire

HAL, est

destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d’enseignement et de recherche français ou étrangers, des laboratoires

Expressiveness of a spatial logic for trees

Iovka Boneva, Jean-Marc Talbot, Sophie Tison

To cite this version:

Iovka Boneva, Jean-Marc Talbot, Sophie Tison. Expressiveness of a spatial logic for trees. 20th Annual IEEE Symposium on Logic in Computer Science, 2005, Chicago, United States. pp.280–289.

�inria-00536696�

(2)

Expressiveness of Spatial Logic for Trees

Iovka Boneva, Jean-Marc Talbot and Sophie Tison

LIFL - UMR CNRS 8022 and INRIA Futurs - MOSTRARE project 59655 Villeneuve d’Ascq C´edex, France

{ boneva, talbot, tison } @lifl.fr

Abstract

In this paper we investigate the quantifier-free fragment of the TQL logic proposed by Cardelli and Ghelli. The TQL logic, inspired from the ambient logic, is the core of a query language for semistructured data represented as unranked and unordered trees. The fragment we consider here, named STL, contains as main features spatial com- position and location as well as a fixed point construct.

We prove that satisfiability for STL is undecidable. We show also that STL is strictly more expressive than the Presburger monadic second-order logic (PMSO) of Seidl, Schwentick and Muscholl when interpreted over unranked and unordered edge-labelled trees. We define a class of tree automata whose transitions are conditioned by arithmetical constraints; we show then how to compute from a closed STL formula a tree automaton accepting precisely the mod- els of the formula. Finally, still using our tree automata framework, we exhibit some syntactic restrictions over STL formulae that allow us to capture precisely the logics MSO and PMSO.

1 Introduction

Spatial logics allow one to express properties about structures such as trees [8], graphs [6, 14] and heaps [19].

The main ingredient of spatial logics is an operator called composition (or separation). This operator permits com- positional reasoning over concurrent and mobile processes [10, 4] or over imperative programs with shared mutable data structures [18].

The TQL logic [7, 8] is the core of a query language for semistructured data represented as unranked and unordered trees. The TQL logic is based on the static fragment of the ambient logic: it contains spatial primitives, least fixed point operator and quantification over labels and trees. Spa- tial connectives are locationa[φ], satisfied by trees having a single edge starting from the root that is labelled withaand leads to a subtree satisfying the formulaφand composition

φ|φ satisfied by trees which can be obtained by merging the roots of two trees, one satisfyingφand the other oneφ. The least fixed point operator considers formulae as map- pings over sets of trees.

An important question about logics is the decidability of satisfiability. It has been shown in [11] that satisfiability is undecidable for a fragment of the ambient logic contained in TQL. The use of quantification over names is crucial for this result. However, decidable fragments of the logic TQL could be useful in several domains: for constructing type systems for semistructured data as the one proposed in [5] or for testing query correctness, query containment and defining constraints, as suggested in [8].

The logic TL introduced by Dal Zilioet al.in [12, 13] is also inspired by the ambient logic. This logic is quantifier- free and equipped with a restricted form of recursion but it allows an additional spatial primitive (composition ad- junct). However, this new construct adds no expressiveness to the logic. The logic TL can be encoded into the so called sheaves automata [12], which are automata whose transi- tions are conditioned by Presburger formulae. As emptiness is decidable for sheaves automata, satisfiability is decidable for the logic TL. Sheaves automata are the first proposal of a class of tree automata for ambient-based logics. It is not clear whether the restriction of recursion in TL is neces- sary for decidability. Additionally, it is not known whether sheaves-like automata could be defined for larger fragments of TQL.

Another fundamental question is the expressiveness of a logic. A well-known logic used to express properties about trees is the monadic second-order logic (MSO). It is known that the TQL logic can express some counting properties in trees that can not be defined in MSO; the for- mula µξ.(a[ξ]| b[ξ] |ξ∨0) expresses that any node has as many outgoing edges labelled withaas outgoing edges labelled with b. Recently, Seidl et al. introduced in [20]

the Presburger monadic second order (PMSO) as an exten- sion of MSO with some counting constraints allowing one to express relationship between the number of children of a given node satisfying some property. An example of such

(3)

a constraint is “as many children labelled with aas chil- dren labelled withb”. Seidlet al. also introduced so called Presburger tree automata and showed equivalence between these automata and the logic PMSO. Presburger automata are quite similar to sheaves automata as they both have Presburger arithmetic formulae as conditions for transitions.

This similarity suggests that there is probably a strong rela- tion between fragments of the TQL logic and PMSO logic, but the precise relationship is unknown yet.

In this paper we focus on the quantification-free frag- ment of the TQL logic that we call spatial tree logic (STL for short). We study the satisfiability problem as well as the expressiveness of this logic. In particular, we compare STL with MSO and PMSO logics when interpreted over un- ranked and unordered trees.

We show that satisfiability is undecidable for STL and that STL is strictly more expressive than the logic PMSO when interpreted over unranked and unordered trees. We also identify two syntactic fragments of STL, denoted gSTL and pgSTL, that correspond precisely to PMSO and to MSO logics respectively. The equivalence is shown using a new tree automata framework for STL: we define a general class of tree automata in the spirit of Presburger and sheaves au- tomata that use some arithmetical constraints as conditions for the transition relation. By restricting these arithmetical constraints, we obtain subclasses of automata equivalent to the logics gSTL and pgSTL respectively.

The paper is organised as follows: Section 2 contains definitions for the tree model we consider and for the logics STL, MSO and PMSO; in Section 3 we introduce so called automata with arithmetical constraints and we define two subclasses of these automata that are equivalent to the logics MSO and PMSO respectively. We prove in Section 4 unde- cidability of satisfiability for STL; Section 5 describes the construction of an automaton equivalent to some STL for- mula. Finally, in Section 6 we define the fragments gSTL and pgSTL of STL and we use automata with arithmeti- cal constraints to show equivalence between these two frag- ments and the logics MSO and PMSO respectively.

2 Tree model and logics : definitions

LetΛ be a finite set of labels. All through this paper, by tree we mean a finite, unranked and unordered tree with edges labelled fromΛ.

We consider two different representations of trees namely as nested multisets and as logical structures.

Nested multisets This representation, introduced in [7], is quite natural for unranked and unordered trees.

Let us denote{||}the empty multiset andthe multiset union. The setTree is the least set containing the empty multiset {||}and such that ift, t belong toTree andais a label fromΛ, thent tand{|a[t]|}belong toTreeas well. Elements of multisets, also calledtree elements, are always of the form a[t]for some label aand some treet. The set of all tree elements is denotedETree.

We write {|e1, . . . , en|} for the multiset containing the tree elements e1, . . . , en. Ift is a multiset, then t(e) de- notes the multiplicity (iethe number of occurrences) of the elementeint. For any naturalnand any tree elemente, we denote byn·ethe tree{|e, . . . , e

ntimes

|}.

Below are depicted graphical representations of the trees (in this order)t={|a[{||}], b[{||}]|},t={|a[{|a[{||}], b[{||}]|}]|}

andt ={|a[{|a[{||}], b[{||}]|}], a[{||}], b[{||}]|}. Note thatt = {|a[t]|}andt=tt.

b

a a b

a a a b

b a

Logical structure Let σ be the signature {laba | a Λ} ∪ {<}, where the laba are unary predicates and <is a binary predicate. A tree τ induces a finite σ-structure Eτ,{labτa | a Λ}, <τwhere Eτ is the finite set of edges ofτ,labτa(fora∈Λ) is the labelling relation, that is labτa(u)holds if the edgeuinτis labelled withaand<τ is the predecessor relation,ieu <τ u holds for the edges u, uinτ if the destination of the edgeuand the source of the edgeucoincide.

There is a natural correspondence between trees as nested multisets and (isomorphism-closed classes of) trees as logical structures.

We consider here the spatial tree logic, denoted STL, which is the quantifier-free fragment of the TQL logic [7].

Syntax Assume a countable set of recursion variables ranged over byξ, ξ. STL formulae are defined by the fol- lowing grammar (forα⊆Λ):

φ::=0 | α[φ] | φ|φ | | ¬φ | φ∨φ | ξ | µξ.φ To guarantee the existence of least fixed points (µoperator) we impose a syntactic restriction for formulaeµξ.φ: occur- rences of the recursion variableξmust occur under an even number of negations (¬) inφ.

Some derived operators0,α[φ],φ φ,φ∧φ,νξ.φcan be defined using negation as:0def=¬0,α[φ]def= (Λα)[φ],

(4)

φ φ def= ¬(¬φ| ¬φ),φ∧φ def=¬(¬φ∨ ¬φ)andνξ.φdef=

¬(µξ.¬φξ ← ¬ξ), whereφξ ← ¬ξis the formulaφ in which occurrences of the recursion variableξhave been replaced with¬ξ.

The notions of free variables and closed formulae are de- fined as usual. In the sequel of this paper, we assume that in STL formulae, distinct occurrences of the bindersµand ν bind distinct variables. We useκto denote either of the symbolsµorν. For some labelaand some formulaφ,a[φ]

stands for the formula{a}[φ].

Semantics The semantics of STL is given by an interpre- tation associating a set of trees with any formula. Letδbe a valuation associating a set of trees with any free recur- sion variable. The interpretation of the formulaφunder the mappingδ, denotedφδ, is recursively defined by:

0δ ={{||}}

α[φ]δ ={{|a[t]|} |a∈α, t∈φδ} φ|φδ ={tt|t∈φδ, tφδ}

δ =Tree

¬φδ =Treeφδ

φ∨φδδφδ

ξδ =δ(ξ)

µξ.φδ =

{S Tree|S⊇φδ[ξ→S]}

where δ[ξ →S] stands for the valuation δ identical to δ except for the variableξwhich is mapped to the setS.

The syntax of STL can be enriched with the star operator:

ifφis a STL formula, then so isφ∗. The interpretation of φ∗isφ∗δ =

n∈N{t1. . .tn| ∀i∈1..n. tiφδ}.

The star operator does not add expressive power to the logic as, for any valuationδ,φ∗δ =µξ.(φ|ξ∨0)δ.

A set of treesTis said to be STLdefinableif there exists some closed STL formulaφsuch thatT =φ.

System of fixed point equations We present here an al- ternative representation of the semantics of a closed STL formula as the solution of a system of fixed point equations.

Following [1], a system of fixed point equations Σ over the variables ξ1, . . . , ξn is a sequence ξ1 =κ f11, . . . , ξn), . . . , ξn =κ fn1, . . . , ξn)where thefi de- note functionals that are intended to be interpreted as mono- tonic mappings over some domain. The sequence of vari- ablesξ1, . . . , ξnis denotedVars(Σ)andξn, the last variable inVars(Σ), is denotedlast(Σ).

We interpret here equations over the complete lattice structure induced by set inclusion (℘(Tree),∨,∧), where

℘(Tree)is the power set ofTree,is set union andis set intersection. We consider the following monotonic opera- tions over℘(Tree): the constant0is interpreted as{{||}},0 as Tree{{||}}andis the greatest element of℘(Tree), ie Tree; forT, T ℘(Tree)andα Λ, the unary oper- ator α[T] is interpreted as the set{a[t] | a α, t T}

andα[T]as the set{a[t] | a∈ α, t∈ T}. Finally, the bi- nary operatorT|T is interpreted as the set{t| ∃t, t.t∈ T andt Tandt = t t} andT T as the set {t| ∀t, t. t=ttort∈T ort ∈T}.

The solution of Σ over the lattice(℘(Tree),∧,∨)is a mapping from{Vars(Σ)}into℘(Tree), denotedSΣ.

A closed STL formulaφis said to be innegation normal form if it is a negation-free formula built over initial and derived operators. Any closed STL formula can be put in negation normal form by pushing negation deeper inside the formula using derived operators and the fact that¬α[φ]is equivalent to0|00∨α[]∨α[¬φ].

Letφbe a closed STL formula in negation normal form.

Assume wlog thatφ=µξ.φfor some formulaφ. The sys- tem of equationsEq(φ)is defined inductively on the struc- ture ofφas:Eq(ψ) =









Eq(ψ), ξ =κ tr(ψ) ifψ=κξ

Eq(ψ),Eq(ψ) ifψ=ψ◦ψfor◦ ∈ {∨,∧,|, } Eq(ψ) ifψ=α[ψ]orψ=α[ψ]

otherwise

where,composes sequentially two systems of equations, is the neutral element of this composition andtr(ψ)is the formula obtained from ψby replacing inψany recursion sub-formulaκξ by the variableξ. Note that, by con- struction ofEq(φ),last(Eq(φ)) =ξ.

The semantics of STL formulae defined by systems of equations is correct in the sense that

Proposition 1 For any closed STL formulaφin negation normal form,SEq(φ)(last(Eq(φ))) =φ.

Example 1 Letφ=µξ222=α[¬µξ11]20and φ1=ξ1|¬ξ2∨0. The formulaφis equivalent to the formula φ in negation normal form defined asφ =µξ22, where φ2 =α[νξ11]20andφ1 =ξ1 ξ20. Therefore, the system of equationsEq(φ)is

ξ1=ν ξ1 ξ20, ξ2=µ α[ξ1]20

Conversely, with any system of fixed point equationsΣ built over Boolean operations∧,∨and the operators0,0, ,α[ ],α[ ],|and , one can associate a closed STL formula denotedform(Σ)such thatSΣ(last(Σ)) =form(Σ). The formula form(Σ) can be effectively constructed: assume Vars(Σ) = ξ1, . . . , ξn and let for any i 1..n,ξi κ=i φi

be theithequation ofΣ. Iteratively, for anyifrom1ton, and for anyj < i, we replace occurrences of the recursion variableξjin the formulaφiby the formulaκjξjj. Then form(Σ)is equal toκnξnn.

We recall the definition of monadic second-order logic (MSO) for trees and we introduce, following [20], an ex-

(5)

tension of MSO called Presburger MSO (PMSO).

MSO Considering the signatureσ, MSO formulae are de- fined by the following syntax:

ψ::= (laba(u))a∈Λ|u < u |u∈U | ¬ψ|ψ∧ψ

| ∃u.ψ| ∃U.ψ

whereuandU stand for first order and second order vari- ables respectively.

Semantics of MSO is given by means of a satisfiabil- ity relation. Letτ be a tree given as the finiteσ-structure Eτ,{labτa |a∈Λ}, <τ, andρbe a valuation associating elements ofEτwith first order variables and subsets ofEτ with second order variables. Then satisfaction relation for a treeτ under valuationρand a MSO formulaψ, denoted τ, ρ|=ψ, is recursively defined on the structure ofψas:

τ, ρ|=laba(u) if labτa(ρ(u))holds inτ τ, ρ|=u < u if ρ(u)<τρ(u)holds inτ τ, ρ|=u∈U if ρ(u)belongs toρ(U) τ, ρ|=¬ψ if τ, ρ|=ψ

τ, ρ|=ψ∧ψ if τ, ρ|=ψandτ, ρ|=ψ

τ, ρ|=∃u.ψ if τ, ρ[u→e]|=ψfor somee∈Eτ τ, ρ|=∃U.ψ if τ, ρ[u→E]|=ψfor someE⊆Eτ

PMSO The logic PMSO has been introduced in [20]. The interpretation we give to this logic slightly differs from the original one: Seidl et al. consider in [20] a vertex-based MSO whereas we consider here an edge-based MSO.

Presburger arithmetic is the first order theory over the structure N,+,= of natural numbers with addition and equality. Letxbe a numerical variable andnbe a natural number. Presburger formulaepare defined as:

p::=v=v| ¬p|p∧p| ∃x.p withv::=v+v|x|n Letηbe an assignment for the free variables occurring in a Presburger formulap, extended canonically over numeri- cal termsv. Satisfaction relation for a Presburger formulap and an assignmentηis inductively defined as:

η|=v=v ifη(v) =η(v) η|=¬p ifη|=p

η|=p∧p ifη|=pandη|=p

η|=∃x.p ifη[x→n]|=pfor some naturaln PMSO is defined by extending MSO with a new kind of atomic formulae u/p where p is a Presburger formula constructed over the set of variables {#U | U is a second order variable}. Satisfaction relation is ex- tended to these atomic formulae: for some treeτwith do- mainEτand some valuationρ, letηbe the valuation asso- ciating the cardinality of the setρ(U)∩ {e| ρ(u) <τ e})

with each variable#Uoccurring in the Presburger formula p. Thenτ|=ρu/pifη|=p.

A set of treesT is called MSOdefinable(resp. PMSO definable) if there exists some MSO (resp. PMSO) sentence ψsuch thatτ|=ψiffτ∈T.

3 Automata with arithmetical constraints

We present a class of automata, very close to Presburger tree automata [20], but adapted to edge-labelled trees and for which Presburger formulae are replaced by more gen- eral arithmetical constraints. Our automata are also close to sheaves automata [13, 12] and multitree automata [16]. We also relate these automata to the logics PMSO and MSO.

In the following, for any setsS, T we denoteTS the set of mappings fromS intoT. Moreover, we freely identify elements fromNSwith multisets over the setS.

Definition of automata Anautomaton with arithmetical constraints(called simply automaton in the sequel) is a tu- ple (Λ, Q,∆, F)where Λ is a finite set of symbols, Qis a finite set of states,∆is a mapping associating with each stateqinQa pair from(℘(NQ), ℘(Λ))and finally,F NQ is the acceptance condition.

LetA= (Λ, Q,∆, F)be an automaton. For any stateq inQand for any set of mappingsN NQ, we define the setsL(q)⊆ETreeandL(N)Tree.L(q)is the set of tree elements accepted in the stateqof the automaton andL(N) is the set of trees accepted by the arithmetical conditionN. These two sets are recursively defined as follows:

• L(q)is the set of tree elementsαq[L(Nq)], whereαq

is the set of labels andNqis the set of mappings from NQsuch that∆(q) = (Nq, αq);

• L(N)is the set of treest = {|e1, . . . , ek|}for which there exists a multiset of states{|q1, . . . , qk|}inNsuch thatei∈ L(qi)for alli∈1..k.

Then the language accepted by the automaton A, written L(A), is the set of treesL(F).

Subclasses of automata We define first star-free and semilinear sets of mappings by analogy with star-free and semilinear sets of vectors.

Forn,n NQ andλ N, we define the mappings n+nandλnas:(n+n)(q) =n(q)+n(q)and(λn)(q) = λn(q)for allq∈Q. Letp1, . . . ,prandbbe mappings in NQ. We denoteLin(b,p1, . . . ,pr)the set of mappings

Lin(b,p1, . . . ,pr) =b+

i∈1..r,λi∈N

λipi

A set of mappings of the formLin(b,p1, . . . ,pr)is called alinear set; the mappingbis its basis andp1, . . . ,prare its periods.

(6)

A set of mappings N NQ is star-freeif it can rep- resented as a finite union of linear setsLin(b,p1, . . . ,pr) for which all the periods pi are unit mappings, ie ∃q Q,pi(q) = 1and∀q=q,pi(q) = 0.

A set of mappingsN NQ issemilinearif it can be represented as a finite union of linear sets.

Astar-free(resp. semilinear)constrained automatonis an automaton for which all arithmetical conditions are star- free (resp. semilinear) sets of mappings.

A semilinear (or a star-free) subset ofNQ is effectively given when it is given as a finite union of linear sets, each of which is represented by a basis and a finite number of periods. A star-free (resp. semilinear) constrained automa- ton is effectively given if all arithmetical constraints in the automaton are effectively given star-free (resp. semilinear) sets of mappings.

Determinisation and closure under Boolean operations An automaton isdeterministicif for any statesq, q, the set L(q)∩ L(q)is empty. For any effectively given star-free (resp. semilinear) constrained automaton, one can construct a deterministic star-free (resp. semilinear) constrained au- tomaton recognising the same language. These two classes of automata are also closed under Boolean operations.

Deciding emptiness For an automatonA=(Λ, Q,∆, F), deciding emptiness of the set of treesL(A)can be done un- der certain conditions. A state of the automatonq Qis reachableifL(q)is not empty; in the same way, a setN of mappings fromNQ isreachableif L(N)is not empty.

Hence, N is reachable iff it contains a mapping n such that for all q Q, n(q) = 0implies thatqis reachable.

Note that ifN contains the null mapping0Q,ie the map- ping associating 0 with anyq Q, then it is reachable, as in that case {||} belongs to L(N). On the other hand, a state q is reachable if, forα Λ and N NQ such that∆(q) = (N, α), the setαis not empty andNis reach- able. According to these remarks, Proposition 2 below gives sufficient conditions to make emptiness decidable for au- tomata.

Proposition 2 Let A = (Λ, Q,∆, F) be an automaton.

Emptiness is decidable if for any stateqinQwith∆(q) = (N, α), and for any subset of statesQ⊆Q, one can decide whether the set of mappingsN contains somensuch that for any stateqinQ,n(q)= 0impliesq∈Q.

Conditions from Proposition 2 are fulfilled by effectively given star-free (resp. semilinear) constrained automata. So, Corollary 3 Emptiness is decidable for effectively given star-free and semilinear constrained automata.

Connection with the logics MSO and PMSO

Proposition 4 A set of trees is accepted by some semilinear constrained automaton iff it is PMSO definable.

Proof Using the relationship between semilinear sets and solutions of Presburger formulae, the result easily follows from the equivalence of expressiveness of Presburger au- tomata and PMSO logic sentences as established in [20].2 Proposition 5 ([3]) A set of trees is accepted by some star- free constrained automaton iff it is MSO definable.

4 Satisfiability of STL

The satisfiability problem is, given a closed STL formula φ, decide whether φ is empty. We show here that this problem is undecidable for STL and that STL is more ex- pressive than the logic PMSO.

Theorem 6 Satisfiability is undecidable for STL.

Sketch of proof The proof is done using a reduction of emptiness of two-counter machines inspired from the proof of undecidability of emptiness for alternating two- way AC-tree automata [15]. A two-counter machine [17]

M = Q, qi, qf,∆is a finite labelled transition system where Q is the set of states, qi is the initial state, qf is the final state and ∆ is a set of transitions of the form (q, r, q), whereq, q ∈Qandrbelongs to the setTrans=

j∈0,1{⊕j,j,0j}. Aconfigurationof the machineMis a triple (q, n0, n1), where qis a state of the machine and n0, n1 are naturals called values of the counters. The set of transitions∆defines thestep relationMover config- urations as follows: (q, n0, n1) M (q, n0, n1)if one of the three statements is true forj, k∈ {0,1}andj =k: (i) nj =nj+1,nk =nkand(q,j, q)∆; (ii)nj=nj−1, nk =nkand(q,j, q)∆(iii)nj =nj = 0,nk =nk and(q,0j, q)∆. As usualMdenotes the transitive re- flexive closure ofM. Thelanguageaccepted by the two- counter machineM, denotedL(M), is the set of naturals nsuch that(qi, n,0) M (qf, m0, m1)for some naturals m0, m1. Emptiness ofL(M)is undecidable for an arbi- trary two-counter machine [17], as any recursively enumer- able set of naturals can be represented as the language of some two-counter machine.

Consider an arbitrary two-counter machine M = Q, qi, qf,∆. A tuple(n0, x0, n1, x1)ofN4 is said to be correctifn0≥x0andn1≥x1. The set of correct tuples of N4is denotedN4c. For anyrinTrans, we define the binary relationRr,∆over the setN4c as (Rr,∆is used in infix notation): (q,(n0, x0, n1, x1)) Rr,∆ (q,(n0, x0, n1, x1)) if (q, r, q) ∆ and forj, k ∈ {0,1}, j = k, one has nk = nk, xk = xk and one of the following holds: (i)

(7)

r=j,nj =nj,xj =xj1,(ii)r=j,nj =nj1, xj=xj or(iii)r= 0j,nj=nj=xj=xj.

Intuitively, the value of the first counter ofMis obtained asn0−x0and the second one asn1−x1. The binary relation Ris the union of the relationsRr,∆for allrinTransand Rdenotes its transitive and reflexive closure.

It holds that for any statesq, q of the machine and for any naturals n0, n1, n0, n1, (q, n0, n1) M (q, n0, n1) iff there exist naturals x0, x1, x0, x1 such that (q,(n0 + x0, x0, n1+x1, x1))R(q,(n0+x0, x0, n1+x1, x1)).

Therefore,L(M)is not empty iff there exist some naturals x, y, m0, m0, m1, m1such that(qi,(n0+x, x, y, y))R (qf,(m0, m0, m1, m1)).

Leta0[{||}],b0[{||}],a1[{||}],b1[{||}]be tree elements with a0, b0, a1, b1four distinct labels. For any tuple of naturals (n0, x0, n1, x1)we denote (n0, x0, n1, x1)the tree n0· a0[{||}] x0·b0[{||}] n1·a1[{||}] x1·b1[{||}]. For any N N4,Ndenotes the set of trees{n|n∈N}.

For any stateq∈Q, we defineAcc(q)as {s∈N4c | ∃sNc4,(q, s)R(qf, s)}

We define a system of fixed point equationsΣover the set of variables ok0, ξok1, ξok, ξzero0, ξzero1, ξ}∪{ξq | q Q}such thatlast(Σ) =ξ. This system will satisfy that for anyq∈Q,SΣq) =Acc(q). The first five equations of Σare:

ξokj =µ aj[0]|bj[0]okj(aj[0]) forjin{0,1}

ξok=µ ξok0ok1

ξzeroj =µ aj[0]|bj[0]zeroj∨ξokk forj, kin{0,1}, k=j These equations ensure thatSΣok) ={s|s∈N4c}and thatSΣzeroj)is the set of trees(n0+x0, n0, n1+x1, n1) withn0, n1, x0, x1Nandxj= 0.

For any stateq∈Q,q=qf, the equation forqinΣis ξq=µ

(q,r,q)∈∆

Pred(ξq, r)

where for anyrinTrans,Pred(ξ, r)is given by Pred(ξ,⊕j) = (ξ|bj[0])∧ξok

Pred(ξ,j) = (ξ|aj[0])∧ξok

Pred(ξ,0j) =ξ∧ξzeroj The equation forξqf inΣisξqf

=µ ξokand the last equation ofΣisξ=µ ξqi∧ξzero1.

Intuitively, for a set N N4c of correct tuples and a valuation associatingNwithξ,Pred(ξ, r)represents the set of treessforsinN4such that there exist a tuples N and statesq, q∈Qfor which(q, s)Rr,∆(q, s)

Thus,L(M)is empty iffSΣ(ξ) =∅.

Corollary 7 For any recursively enumerable set of naturals E, there exists a formulaφEsuch thatn∈Eiff there exist two naturalsx, ysuch that the tree(n+x)·a0[{||}] b0[{||}] y ·a1[{||}] y ·b1[{||}] belongs toφE, where a0, b0, a1, b1are pairwise distinct labels.

Proposition 8 There exists a STL formulaφsuch thatφ is not PMSO definable.

Sketch of proof By Proposition 4, it is enough to show that there exists a STL formulaφsuch thatφcan not be represented as the language of some semilinear constraint automaton. LetΛ be the set of labels{a0, b0, a1, b1}. By Corollary 7, letφE be the formula associated with a recur- sively enumerable set of naturalsE,ies.t.n∈Eiff the tree (n+x)·a0[{||}]x·b0[{||}]y·a1[{||}]y·b1[{||}]belongs toφEfor some naturalsx, y. Consider now the automaton A= (Λ, Q,∆, F)withQ=

c∈Λ{qc}and for anyc∈Λ,

∆(qc) = (0Q,{c}). One can prove thatφEis equal to the language of some semilinear constrained automaton iff φEis equal toL(A)for some semilinear set of mappings F. Assume that such a setF exists, then by definition of φE, there existx, y∈Nsuch thatFis the set of mappings {(qa0 →n+x, qb0 →x, qa1 →y, qb1 →y) | n E}. Now, as semilinear sets are closed by projection and by linear combinations of components, the set of mappings {(qa0 →n) | n E} fromN{qa0} must be semilinear, implying that any recursively enumerable set of naturals is semilinear.

Theorem 9 STL is strictly more expressive than the logic PMSO.

Proof Follows from Proposition 8 and Proposition 25 from Section 6 stating that semilinear constrained automata are equally expressive to a fragment of STL. 2

5 Tree automata for STL

All through this section we consider a closed STL for- mula φ. We will define an automaton Aφ such that L(Aφ) =φ.

A system of equations is innormal formif the right-hand side of each equation has one of the following forms:

0 0 ξ∨ξ ξ∧ξ α[ξ] α[ξ] ξ|ξ ξ ξ Equations of the formξ =κ α[ξ]or ξ =κ α[ξ]are called elementary equationsandEVars(Σ)is the set of variables of Σoccurring as left-hand side of some elementary equation.

(8)

Any systemΣwith variables1, . . . , ξn}can be trans- formed into a systemΣ in normal form with some fresh extra variables1, . . . , ξm }; this transformation preserves the solution in the sense that for all11..n, the solutions of the systemsΣandΣfor the variableξicoincide.

A system of equationsΣisstrongly normalisedif it is normalised and for any equationξ=κ ξorξ =κ ξ ξ inΣ,{||}does not belong neither toSΣ)nor toSΣ).

For any closed STL formulaφ, the system of equations Eq(φ)can be transformed into a strongly normalised system of equations denotedEq(φ): we first put˜ Eq(φ)in normal form, thus obtaining a system of equationsΣ. Letξ=κ ξ| ξbe an equation inΣand let{||}belong toSΣ)but not toSΣ). Then one can introduce a new variable toΣ, say ξn, with corresponding equationξn =κ ξ0and replace inΣ the equation forξ by ξ =κ ξ n ∨ξ. The newly obtained system of equationsΣis equivalent toEq(φ)over the original variables.Σcan then be put in normal form to obtainEq(φ). This can effectively be done as:˜

Lemma 10 For any system of equationsΣand for any vari- ableξ inVars(Σ), one can decide whether{||}belongs to SΣ(ξ).

Example 2 A system of equationsΣin normal form for the formulaφgiven in Example 1 is

ξ1=ν ξ1 ξ2, ξ2=ν 0, ξ1=ν ξ1 ∧ξ2,

ξ3=µ α[ξ1], ξ4=µ ξ32, ξ5 =µ 0, ξ2=µ ξ4 ∨ξ5 It holds for Σthat{||}belongs to SΣ2)and SΣ5)and does not belong toSΣ(ξ)for any variableξinVars(Σ)dif- ferent fromξ2andξ5. The system of equationsΣis:

ξ1 =ν ξ1 ξ2∨ξ1, ξ2 =ν 0, ξ1=ν ξ1 ∧ξ2, ξ3 =µ α[ξ1], ξ4 =µ ξ32∨ξ3, ξ5 =µ 00, ξ5 =µ 0, ξ2=µ ξ20, ξ2=µ ξ4∨ξ5

Aφ

States of the automaton For anyξ∈EVars( ˜Eq(φ)), we define the STL formulaePos(ξ),Neg(ξ)andCompl(ξ)de- pending on the equation for the variableξinEq(φ)˜

ifξ=κ α[ξ]



Pos(ξ) =α[ξ] Neg(ξ) =α[¬ξ] Compl(ξ) =α[]

ifξ=κ α[ξ]



Pos(ξ) =α[ξ] Neg(ξ) =α[¬ξ] Compl(ξ) =α[]

We denotesplit(ξ)the set{Pos(ξ),Neg(ξ),Compl(ξ)}.

The set of statesQφ of the automatonAφ is defined as Qφ =

ξ∈EVars( ˜Eq(φ))split(ξ)where

denotes the Carte- sian product. For anyξ∈EVars( ˜Eq(φ)), and for any state

q Qφ, we denote withq(ξ)the component ofq corre- sponding toξ.

Transitions and acceptance condition of the automaton We transform the system of equationsEq˜(φ)into the sys- tem of equationsEqn(φ)over the same set of variables ob- tained fromEq˜(φ)by replacing each elementary equation ξ=κ α[ξ]orξ=κ α[ξ]byξ =κ prjξ(theprjξs are constants whose value will be given shortly.)

For two sets of mappingsI, INQ(for some finite set Q), the sets of mappingsI+IandI++Iare defined by:

I+I ={d| ∃d,d.d=d+dandd∈Iandd ∈I} I++I={d| ∀d,d.d=d+dord∈Iord ∈I} We interpret Eqn(φ) on the complete lattice (℘(NQφ),∨,∧): Boolean operators∨,∧are interpreted as union and intersection;0is the singleton set{0Qφ},0is the set of mappingsNQφ{0Qφ}andisNQφ; for any sets of mappingsI, INQ, the symbols|, are interpreted as the operators+and++respectively. Finally, for any variableξ inEVars(Eqn(φ)),prjξis interpreted as the set of mappings {n| n(q) = 1ifq(ξ) =Pos(ξ)andn(q) = 0otherwise}.

The solution ofEqn(φ)over the lattice(℘(NQφ),∨,∧)for the variableξis denotedREqn(φ)(ξ).

For anyξinEVars( ˜Eq(φ)), the set of labelslab(ξ)and the variablevar(ξ)are given by: lab(ξ) =αandvar(ξ) = ξifξ=κ α[ξ]is an equation inEq(φ)˜ andlab(ξ) = Λα andvar(ξ) =ξifξ=κ α[ξ]is an equation inEq(φ).˜

Now, for any state q Qφ, let αq be the set of labels andNq the set of mappings from NQφ defined as (where PosV(q)Vars(Eqn(φ))is the set of variablesξfor which q(ξ) = Pos(ξ)and the setsNegV(q)andComplV(q)are defined accordingly):

αq =

ξ∈PosV(q)∪NegV(q)

lab(ξ)

ξ∈ComplV(q)

Λlab(ξ)

NqPos=

ξ∈PosV(q)

REqn(φ)(var(ξ))

NqNeg =

ξ∈NegV(q)

NQφREqn(φ)(var(ξ))

Nq =NqPos∪NqNeg

Then for anyq∈Qφ,∆φ(q)is defined as(Nq, αq).

Finally,Fφ, the acceptance condition ofAφ, is the set of mappingsREqn(φ)(last(Eqn(φ))).

Note that the automatonAφis deterministic by construc- tion.

We show in this section that the construction of the au- tomaton we gave is correct, that is,φ=L(Aφ). We start

(9)

by defining the notion of basis and give some of their prop- erties needed for our proof.

5.3.1 Bases and their properties

Definition 11 (Bases) LetQbe a finite set. AbasisΘover Qis a mapping in℘(ETree)Qverifying thatΘ(q)∩Θ(q) =

for anyq, q∈Q, q=qand

q∈QΘ(q) =ETree.

Definition 12 (Bases product) LetQ1, . . . , Qnbe some fi- nite sets. FornbasesΘ1, . . . ,ΘnoverQ1, . . . , Qnrespec- tively, their product, denoted

i∈1..nΘi, is the mapping in NQ1×···×Qn defined by (

i∈1..nΘi)((q1, . . . , qn)) =

i∈1..nΘi(qi)for all(q1, . . . , qn)∈Q1×. . .×Qn. Lemma 13 Let Q1, . . . , Qn be some finite sets. If Θ1, . . . ,Θn are bases overQ1, . . . , Qn respectively, then the product

i∈1..nΘiis a basis overQ1× · · · ×Qn. Definition 14 (Decomposition) LetQbe a finite set andΘ be a basis overQ.

For any tree t = {|e1, . . . , en|}, the decomposition of t on Θ, written dcmp(t,Θ), is the mapping inNQ asso- ciating with each q Q the cardinality of the multiset Θ(q)∩ {|e1, . . . , en|}.

•For any set of treesT, thedecompositionofTonΘ, writ- tendcmp(T,Θ), is the set of mappings{dcmp(t,Θ) | t T}.

In other words, dcmp(t,Θ)(q) is the number of tree ele- ments amonge1, . . . , enthat belong to the setΘ(q). Definition 15 (Interpretation) LetQbe a finite set andΘ be a basis over Q. For any mappingd NQ, theinter- pretation of d on Θ, written d,Θ, is the set of trees t such that for allq Q,(dcmp(t,Θ))(q) = d(q)when- everΘ(q)=∅. Interpretation is extended to subsets ofNQ as follows: for anyD⊆NQ,D,Θ=

d∈Dd,Θ.

Note that the decomposition of a treeton a basisΘover Qis unique, whereas there may be several mappingsd NQ such thatd,Θ = t. More precisely, for anyqsuch that Θ(q) = ∅, the value ofd(q)does not contribute for d,Θand thus may be arbitrary.

Definition 16 (Discrimination) A basis Θisdiscriminat- ingfor a set of treesT ifdcmp(T,Θ),Θ=T.

Informally, discrimination expresses that for any mappingd inDeither all trees whose decomposition onΘisdbelong toTor no such tree belongs toT.

We terminate with some properties of bases and discrim- ination.

Proposition 17 LetQbe a finite set andΘa basis overQ.

1. Θ is discriminating for the set of trees T iff it is discriminating for TreeT. Moreover in this case NQdcmp(T,Θ),Θ=TreeT.

2. Tree=NQ,Θand{{||}}=0Q,Θ.

3. For any sets of treesT, Ts.t.Θis discriminating forT andT,Θis discriminating for the sets of treesT∪T, T∩T,T|TandT T. Moreover, ifT =D,Θand T=D,Θ, thenT∨T=D∨D,Θ,T ∧T=

D∧D,Θ,T |T = D+D,Θand T T =

D++D,Θ.

5.3.2 Proof of correctness

Now, with anyξinEVars( ˜Eq(φ))we associate the mapping basis(ξ)in℘(ETree)split(ξ)defined as:

basis(ξ)(Pos(ξ)) =lab(ξ)[SEq˜(φ)(var(ξ))]

basis(ξ)(Neg(ξ)) =lab(ξ)[TreeSEq˜(φ)(var(ξ))]

basis(ξ)(Compl(ξ)) = (Λ{lab(ξ)})[Tree]

It is easy to see thatbasis(ξ)is a basis oversplit(ξ).

Consider now the basis Θφ defined as the product of the bases basis(ξ) for any ξ EVars( ˜Eq(φ)), that is, Θφ =

ξ∈EVars( ˜Eq(φ))basis(ξ). Remind now that the set Qφ is defined as

ξ∈EVars( ˜Eq(φ))split(ξ); so, by defini- tion of basis(ξ)and bases product, we conclude that Θφ

is a basis over Qφ. We will show that for any q Qφ, L(q) = Θφ(q). This proof requires auxiliary results we give first.

Proposition 18 For anyξvariable inEq˜(φ),Θφis discrim- inating forSEq˜(φ)(ξ).

Sketch of proof Towards contradiction: letdbe a minimal (for a well-founded partial ordering over mappings) map- ping andξbe a variable inVars( ˜Eq(φ))such that there ex- ist treest, t for whichdcmp(t,Θφ) = dcmp(t,Θφ) = d and t ∈ SEq˜(φ)(ξ) and t ∈ SEq˜(φ)(ξ) (that is, Θφ is not discriminating forSEq˜(φ)(ξ)). One can show that the right-hand side of this equation is of the form ξ or ξ ξ. AsEq(φ)˜ is strongly normalised system of equa- tions and so {||} does not belong to SEq˜(φ)) neither to SEq˜(φ)), there exists a mapping d strictly smaller than d, a variableξ1 Vars( ˜Eq(φ))and treest1, t2 such that dcmp(t1,Θφ) = dcmp(t2,Θφ) = d andt1 ∈ SEq˜(φ)1) and t2 ∈ SEq˜(φ)1). This contradicts the minimality of d and allows to conclude that Θφ is discriminating for SEq˜(φ)(ξ)for any variableξinVars( ˜Eq(φ)).

Proposition 19 For anyξvariable inEq(φ),˜ SEq˜(φ)(ξ) = REqn(φ)(ξ),Θφ.

Références

Documents relatifs

A model of computation on multi-dimensional words, based on the overlapping op- eration, induces a categorical structure, to which a new type of logic corresponds, whose

We define a partition of the set of integers k in the range [1, m−1] prime to m into two or three subsets, where one subset consists of those integers k which are &lt; m/2,

(15) (*) A topological space is quasi-compact if one can extract from any open covering a finite open covering.. Show that a Noetherian topological space

We prove that a uniform, rooted unordered binary tree with n vertices has the Brownian continuum random tree as its scaling limit for the Gromov-Hausdorff topol- ogy.. The limit

Show that a (connected) topological group is generated (as a group) by any neighborhood of its

Delano¨e [4] proved that the second boundary value problem for the Monge-Amp`ere equation has a unique smooth solution, provided that both domains are uniformly convex.. This result

First introduced by Faddeev and Kashaev [7, 9], the quantum dilogarithm G b (x) and its variants S b (x) and g b (x) play a crucial role in the study of positive representations

A second scheme is associated with a decentered shock-capturing–type space discretization: the II scheme for the viscous linearized Euler–Poisson (LVEP) system (see section 3.3)..