Monadic second-order logic, graph coverings and unfoldings of transition systems

Monadic second-order logic, graph coverings and unfoldings of transition systems

ANNALS OF PURE AND APPLIED LOGIC EISEVIER Annals of Pure and Applied Logic 92 (1998) 35-62 Monadic second-order logic, graph coverings and unfoldin...

2MB Sizes 0 Downloads 47 Views

ANNALS OF PURE AND APPLIED LOGIC EISEVIER

Annals of Pure and Applied Logic 92 (1998)

35-62

Monadic second-order logic, graph coverings and unfoldings of transition systems Bruno Courcelle”, *, Igor Walukiewiczb%’ aLaborutoirr d’ hf&mutiyur bInstitute

of’ Infbrmutics.

Received

(LaBRI), UniorrsitP Bordeaux I, 351, Cows de lu Lib&ration, F-33405 Tulence Cedex, Frunce Wursaw Unicersity, Bunacha 2. 02-097 Wursuw. Polund 18 July 1995; accepted

25 September

1997

Abstract

We prove that every monadic second-order property of the unfolding of a transition system is a monadic second-order property of the system itself. An unfolding is an instance of the general notion of graph covering. We consider two more instances of this notion. A similar result is possible for one of them but not for the other. @ 1998 Published by Elsevier Science B.V. All rights reserved. Kqword~: Second-order Graph covering

logic; Rabin automaton;

Infinite tree; Semantics;

Transition

Systems;

AMS cluss~jicution: Primary: 68455; secondary: 03C80, 03C85

1. Introduction A transition

system is a directed

the graph are called transitions can be seen as an abstract

graph (satisfying

some conditions);

the edges of

and its vertices are called states. A transition

form of a program,

and the infinite

tree obtained

system by un-

folding (or unravelling) of it can be seen as its behaviour. Since transition systems and their behaviours can be represented by logical structures, one can express their properties by logical formulas. We consider here monadic second-order logic (MSOL) as an appropriate logical language because it subsumes many other formalisms, like the kl-calculus in particular

or temporal

logics (see [6, 9]), and it is decidable

on infinite binary trees (by Rabin’s

Theorem,

on many structures

and

see [14]).

* Corresponding author. E-mail: [email protected]; intemet: http:lidept-info.u-bordeaux.fr.1 ‘courcell/ActSci.html. ’ Partially supported by Polish KBN grant No. 2 P301 009 06. Part of this work was done at Basic Research in Computer Science, Centre of the Danish National Research Foundation. 0168-0072/98/$19.00 PII SO 168-0072(

@ 1998 Published 97)000481

by Elsevier Science B.V. All rights reserved

B. Courcelle, I. Wulukiewicz I Annuls of’ Pure and Applied Loyic 92 (1998) 3542

36

We consider transition

the following

conjecture

from Courcelle

[4]. Suppose 9 is a class of

systems defined by a MSOL formula. Define the class 9 of transition

systems

R by 9={R:

Un(R)E2},

where Un(R) denotes the unfolding

of R. The conjecture

is that the class 9 is defin-

able by a MSOL formula and this formula can be defining 9. This conjecture infinitely

was proved in [4] for deterministic

from the one transition

systems (possibly

with

many states) and we prove it here for the class of all systems with at most

countable This new proof is a notion of covering.

of that in [4] and uses a different technique, A covering of a transition

system (or more generally

G is a surjective homomorphism restriction of which to the “neighbourhood” isomorphism. We say that h is a k-covering if h-‘(x) each state or vertex x of G. For a transition

has a

based on

of a graph)


system if we take as the “neighbourhood”

transitions outgoing from it, then there exists a universal covering which is precisely the unfolding. The main lemma (Lemma 14) roughly says that for every MSOL formula 3X. q(X) there is an integer k, s.t., for every transition system R: if Un(R) /= 3X. q(X) then there exists a k-covering R’ of R and a subset S of R’ with Un(R’) k cp(Un(S)). In other words, one can find a sufficiently regular witness S for the existential

quantification.

The notion of “neighbourhood” is a “parameter” of the notion of covering. In the case of graphs, we examine two more possibilities for defining coverings. The first possibility is to take the set of edges incident

to a vertex as its neighbourhood.

Then the results

concerning transition systems extend for this notion of covering but only when we allow quantification over edges: every monadic second-order property of the universal covering of a (finite or infinite) graph (relative to this notion of neighbourhood) can be expressed as a monadic second-order property of the graph provided we can quantify over edges of the graph. A second possibility is to take as neighbourhood of a vertex the subgraph induced by the vertices at a distance at most 1. There exists a corresponding notion of universal covering. However, we exhibit a finite graph G, the universal covering of which is the infinite grid. This shows that the result does not hold here because the monadic theory of the infinite grid is undecidable whereas that of G is decidable (because G is finite). Finally, we relate unfoldings of transition systems with a construction by Shelah [ 121 and Stupp [13], extended by Muchnik (reported in [l l]), about which we raise some questions that indicate possible developments of the present work. This paper is organised as follows. Section 1 deals with transition systems, their coverings and automata, Section 2 deals with monadic second-order logic, Sections 3 and 4 present some technical lemmas, Section 5 gives the main proof, Section 6

discusses

the Shelah-Stupp-Muchnik

graphs, and Section 2. Transition

construction,

Section

7 concerns

coverings

of

8 reviews some open questions.

systems

We consider directed graphs G, defined by means of sets: V, (vertices),

EG (edges)

and the source and target mappings, respectively, srco : EG + V,, tgt, : EG + VG. We will consider only graphs with finite or countable degrees of vertices. Transition systems are special (labelled) graphs as defined below. Let n,m be natural numbers and m > 1. A trunsition

system

of type (n,m)

is a

where G is a directed graph, x is a vertex

tuple R = (G,x, PIR, . . . ,Pn~, QIR, called the root of R from which all other vertices . . , QmR),

are accessible

by a directed

path,

P,,R are sets of vertices and Q~R, . , Qrn~ is a partition of the set of edges. As in the case of graphs we will restrict to transition systems with vertices of at most

PIR,...,

countable degree. We call such transition systems countably branching. A vertex of G is called a state of R and an edge is called a transition. in Q~R is said to be

A transition

oftype i. In order to have uniform notation, we let:

SR be the set of states of R, TR be its set of transitions, YootR be its root, P,R be the ith set of states, Q;R be the set of transitions of type i, srcR = {(t,s): t E TR,S ESR, s is the origin (or source) of t} and tgt, = {(t,s): tE TR,SESR,S is the target of t}. For convenience we shall also write in some cases s = srcR(t) (or s = t&(t)) (t,s)EsrcR (or (t,s)EtgtR, respectively). Let R and R’ be two transition systems of type (n,m). SR

c

SRI,

Tn

C

TRJ,

rootR ER Q;R srcR

= =

m)tRf,

P,R’

=

We write R 2 R’ iff

n sR>

QIR~ =

n

srcR’

TR, f? (TR

X SR).

tgtR = tgt,y f! ( TR X SR). A homomorphism h(&) c

SRI>

h(TR)

TRY,

c

h : R -+ R’ is a mapping

h(srcR(t))

= srcR/(h(t))

for all tE TR,

h(tgtR(t))

= tgt,,(h(t))

for all tE TR,

SR U TR + SRI U TRY such that

h(r#OtR) = ro#tRt, SEP;R iff h(s)EPIRf,

for all SESR and i= l,...,rz,

tEQ,R iff h(t)EQs,

for all tETR and i=l,...,m.

if

38

B. Courcelle,

A homomorphism

I. Wulukiewic;!

h: R + R’ is a covering

of R’) if it is surjective outRt(h(.s)).

Annuls qf’ Pure und Applied Logic 92 (1998)

(we shall also say that R is u covering

and for every state SESR, h is a bijection

(We denote by outR(s) the set of transitions

We say that h is a k-covering if for every

3542

of outR(s)

onto

t of R such that srcR(t)=s.)

SESR/ the set h-‘(s)

has at most k

elements. A path in R is a finite

or infinite

sequence

of transitions

(tl, t2,. . .) such that

root,? = srcR(tl ) and for each i, tgtR(ti) = srcR(tj+l ). If this sequence is finite, the target of the last transition is called the end of the path. Fact 1. If h is u homomorphism R--f R’ then the image of every path of R is a path of R’. If furthermore, h is a covering, then every puth in R’ is the imuge by h of a unique path in R. We now define the unfolding Un(R) of a transition shall consider it as the hehaviour of R.

system R; this is a tree, and we

We let NR be the set of finite paths in R. We have, in particular, linking the root to itself. NR is the set of nodes of Un(R).

the empty path

If p and p’ ENR, we define an edge p -+ p’ (equivalently a transition) of type i iff p’ extends p by exactly one transition of R of type i. We let Q[* denote the set of such transitions. We let hR : NR - SR associate with every finite path its end. We let also e* denote the set defining:

hi’(&).

&n(R)

= NR,

TUn(R)

=

romh(R) PiUn(R)

obtain

a

transition

system

Un(R)

of

type

(n,m)

by

Qf U ... UQ;, =

=

We

&

e*,

QiUn(R)= Qt. Fact 2. The map hR extends

in u unique wuy to u homomorphism

Un(R) + R which

is a covering. Fact 3. If m: R+R’ is u covering, then there Un(R) + Un(R’) such that hR
exists

LI unique

isomorphism

rii :

Because of these properties, Un(R) will be called the universal covering of R. The terminology is borrowed from algebraic topology where the notion of universal covering of a topological space is a basic notion. A transition system of type (n,m) is deterministic if no two transitions with the same source belong to the same set Ql. It is complete deterministic if, in addition, each state has exactly m outgoing transitions.

Fact 4. Let R und R’ be complete

deterministic

There is ut most one homomorphism

transition

It exists ~jf there exists u muppiny ji)r every transition x +x’ oJ’ R there is in R’ II trunsition type, (c) ji)r every XESR and every i, ,z’r have xE&

2.1. Purity uutomuta

and trunsition

In this section we introduce

systems

of the sume type.

is u covering. R + R’ und such u homomorphism h : S, ----tSR, such thut: (a) h(rootR) = rootRl. (b) h(x) 4 h(x’) oj the sume

if/”h(x)E&.

systems

parity automata

and prove a lemma about the runs of

such automata. This lemma will be used to prove the regularisation lemma (Lemma 14). We denote by .Y the infinite complete binary tree. Its nodes are (as usual) identified with words from { 1,2}*. It is a complete deterministic

transition

system of type (0,2).

We denote by ,YR the set of tuples of the form (3, Pi,. . . , P,), where PI,. . . , P, are sets of nodes of .8. These tuples can be considered as infinite complete binary trees the nodes of which are labelled by subsets of { 1,. . , n}; they are complete deterministic transition systems of type (n, 2 ). A purity-uutomuton is a tuple SJ = (S, C, I, 6, Q), where 0 S is a finite nonempty set of stutes; l C is a finite set called the ulphubet; we will assume that it is the set of subsets of l l l

{ 1,. . , n} for some natural number I C S is the set of initiul stutes;

n;

d C S x C x S x S is the trunsition relution; .Q : S + .,I is a function defining the acceptance the set of natural numbers.) A run of .d on a tree &E .Yn is a function

for every node x of .f

condition.

(We use

1 to denote

r : .F + S, such that, r(roo1.H) E I and

(i.e. x~{1,2}*):

(r(x),{i: Pig(x)},r(xl),r(x2))Eb;, here xl and x2 denote nodes obtained

from x by appending

the end of x, i.e., are the left and right successors

1 and 2, respectively,

at

of the node x.

To define when a run is ucceptiny let us introduce a notation. For an infinite sequence of natural numbers ml, ml,. . let Inf(m 1,m2,. . .) be the set of numbers appearing infinitely often in the sequence. We say that a run r is uccepting if for every sequence of nodes no,nl,. . forming a path in J, the smallest number in Inf(Q(r(no)), Q(r(nl )), . . .) is even. We say that .d uccepts a tree .D if there is an accepting run of .d on ~8’. The language recognized by .d is the set of trees accepted by .cr’. We are interested in parity automata because they capture the power of monadic second-order logic on binary trees while having a useful “regularity” property (see Lemma 6). (Monadic second-order logic is formally introduced in the next section.) Theorem 5 (Mostowski [7]). A subset uj’ .Ffl is the lunguuye recognised by u Rubin automaton $f it is the lunguugr recoynised b-v u purity uutomuton. Hence for every

jbrmt.410 a(X) , . . .,X0)

ofmonadic

second-order logic there is a parity automaton ~2

such thut for every D f &

Parity automata

are easier to work with than Muller

or Rabin tree automata

[lo]

because they admit regular runs, a notion we will define now. For a tree .%c~Y~ and a node XCB let B/X denote a subtree issued from 9. We will say that r is a regular run on 93 if for every two nodes x, y of B: if r(x) = r(y) and B/x is isomorphic node u of g/x,

to a/y

where h is the isomorphism:

then r(h(u)) = r(u) for every B/x -+ 2$/y,

Intuitively, a run is regular if it behaves identically on isomo~hi~ the states assigned to the roots of these trees are the same.

subtrees

provided

Lemma 6. For every parity automaton .d and every tree 28’: if .d accepts $9 then there is a regular accepting run

of.d on ;‘A.

Proof. The lemma follows from the results about games with parity conditions sidered in [8, 61. It was shown there that such games have memoryless

strategies.

conWe

will briefly recall this result here and show how it applies in our case. AparitygameisabipartitegraphG=(V=I$U~i, ECF’xY, CJ:Y--+(l,...,n}) with vertices labelled by numbers from ( 1,. . . , n}. A play>from some vertex c’i E I$ is played as follows: first player I chooses a vertex v2 E I$i with E(vi,v2), then player II chooses a vertex 223E 9 with E(v2, v3), and so on ad infinitum unless one of the players cannot make a move. If a player cannot make a move he looses. The result of an infinite play is an infinite path vI, 23, v3,. . . . This path is ~~~~nn~ng for player I if in the sequence appearing

in~nitely

Q(vr ), Q(Q), s;)(t’s), . . . the smallest

often is even. The play from a vertex of fi;r is defined

number similarly

but this time player II starts. A strategy CJ for player I is a function ending

in a vertex

from

assigning

to every sequence

of vertices

Vi a vertex O(U)E I/;,, such that, E(v, C(U)). A strategy

u is

memoryless iff G(U) = o(w) whenever u and w end in the same vertex. A strategy is ~~~~z~ing iff it guarantees a win for player I whenever he follows the strategy. Similarly, we define a strategy for player II. and Jutla [6] and Mostowski [8]). In every parity game une of the players has a winning strategy. If a player has a winning strategy then he has a mem~ry~ess strateg>l.

Theorem 7 (Emerson

Now, we will show how to use this theorem in our case. We first construct a game that is a “product” of the automaton .clz and the graph obtained from ~2 by identifying isomorphic subtrees. Define the relation M on nodes of B by: m z n if the

B. CourceIIe. I. Wulukienicz I Anna1.s of Pure and Applied Logic 92 (1998)

subtrees

issued from m and n are isomorphic.

by quotienting

:B by the M relation.

of a state of the automaton consisting

of a transition

Let V? be a transition

3562

41

system obtained

Let 4 = SC/ x &, i.e., the set of pairs consisting

and a node of %. Let Pii = 6?, x &, i.e., the set of pairs

of the automaton

is an edge from a vertex (.r,[n])~e

(an element of S _,) and a node of $5. There

to a vertex ((s,a,sl,s2),[n])~

(we use [n] to denote the equivalence

I$ if a= {i: P,d(n)}

class of n with respect to the z relation).

There

are edges from a vertex ((s,a,sl,sz),[n])~ I+, to vertices (si,[nl]) and (.s?,[n2]); as before nl denotes the node obtained by concatenating 1 at the end of n. Observe that from vertices in 6 there may be many edges or there may be no edges at all. On the other hand, every vertex in &i has exactly two edges going from it. Finally, we define the function

Q by letting s2((s, [n])) = a(s),

i.e., we use the function

s2 of the

automaton .d. Theorem 7 applies to the game just defined. From the assumption that there is an accepting run of .d on 9? it follows that there is a winning strategy for player I from the vertex (so, [no]), i.e., the pair consisting of the initial state of .d and the equivalence class of the root of .W. This strategy is to take a transition suggested by the run. Hence, by Theorem 7 there exists a memoryless strategy in the game. This memoryless strategy induces a regular run of .c/ on ,4. C

3. Monadic second-order logic Let U be a finite set of relational U. Any two isomorphic

structures

symbols. We denote by STR( U) structures of type are considered

as equal. Typically,

U will contain

a unary symbol rt and binary symbols src, tgt, Qi,. , Qm. We let .Y’2(n,m) be the set of MS formulas written with the relation

symbols

rt, src, tgt, Qi, . . , Qm (and of course & and E ) and with free variables in {Xi,. ,X,,}. In order to express properties of transition systems by monadic second-order (MS in short) formulas,

we represent

a transition

system R of type (n,m)

by the relational

structure: IRI2

=

(SR

U

TR,

fl~,SrCR~tgtR,plR,.

.

,P~R,QIR~.

. , Qrn~),

where rtR = {rootR}. We say that such a transition system has the type (n, m). We define ]Rlz + 2, where r E Yl(n, m). by taking PER, , Pn~ as respective values of X, , . . ,X,,. It will be convenient to restrict to the fragment of the logic without firstorder variables. First-order variables can be represented by set variables together with a formula restricting them to range over singletons. For this to work we extend the meanings of the relations rt, src, tgt, Qi, . . , Qn to hold for appropriate singleton sets. We omit the standard details (see [5]). The properties of the behaviour Un(R) of a system R as above can be expressed in a similar way by formulas of Yl(n, m) (since Un(R) is a transition system of type (n,m)). However, we shall use the following simpler representation: For a transition

42

B. Courcrlle.

I. Walukiewicrl

system R of type (n,m) IRII

=

(SR,

Annals of Pure und Applied Logic 92 (1998) 35-62

we let

flR,SUCIR,.

.

,sucmR,f?R>.

. .>&R),

where (x, y)E suc,R iff there is in e;R a transition

from x to y.

We let Pi (n, m) denote the set of MS formulas written with the symbols t-t, suci, . . . , sue, (in addition

to 5 and E ) and having their free variables

in {Xi,.

. ,X,}.

Again,

we define IR/l k u for !xE _Yi (n, m) by taking PER,. . . , P,,R as values of Xi,. . . ,X,, respectively. By the results of Courcelle [3], the same properties of trees can be represented by formulas Our objective

of ~;VZand Yp1.

is to prove the following

Theorem 8. Let n, m EM, a formula

theorem.

m 2 1. For every jbrmula

cp~ S?l(n,m)

one can construct

$E .4”2(n,m) such that, jtir every countahly branching transition system R

of type (n,m):

1% I= $@ IWWI~ I= cp. We shall need the notion

of an MS-definable

that we now recall from [2]. This is nothing

transduction

pretation, modified so as to work for MS-logic. Let U and U’ be two finite ranked sets of relation of set variables,

called here the set of parameters.

assume that all parameters formulas of the form

where k>O,

are set variables.)

[k] denotes the set {l,...,k},

the arity of q}; ~EMS(U,?V’);

of relational

structures

more than the notion of first-order symbols.

inter-

Let YY be a finite set

(It is not a loss of generality

to

A (U, U’)-definition scheme is a tuple of

(U’)*k={(q,j)l

qEU’,

for i= l,...,k;

&EMS(U,?YU{X~})

jE[k]P(q),p(q)

is

&EMS(U,$VU

{XI,. . . ,x,,(~)}) for w = (q,j) E (U’)*k. These formulas are intended to define a structure R’ in STR(U’) from a structure R in STR(U) and will be used in the following way. The formula cp defines the domain of the corresponding transduction; namely, R’ is defined only if cp is true in R. Assuming this condition fulfilled, the formulas define the domain of R’ as the disjoint union of the sets DI,. . . , Dk, where set of elements in the domain of R that satisfy &. Finally, the relation qR’ by the formulas 0, for w = (qJ) E( U’)*k. Here are the formal definitions. Let RESTR( U), let p be a ?V’-assignment in R. If (R, p) k cp then A (R,p) a U’-structure R’ as follows: (i) SR~={(~,~)I~ESR, (ii) for each q in U’ qR’={((dl,il),...,(dt,it))ES~,

wherej=(ii,...,i,)

iE[kl,

(R,I*,~)~&}LSR

/(S,~,dl,...,d,)~e,q,i,},

and t=p(q).

x

&I,

$1,. . , & Di is the is defined dejnes

in

(By (RK~I,..., d,) k O(q,j), we mean (F&/J’) /= O(,i,, where /I’ is the assignment tending

ill, such that $(xi) =d,

(Rlu,d)!=&.) Since R’ is associated whenever

for all i = 1,. . , t; a similar

convention

in a unique way with R,p and d whenever

(R, p) + cp, we can use the functional

notation

The trunsduc.tiun defined by A is the relation

exis used for

&f’(R,

it is defined, i.e.,

p) for R’.

&A : = { (R,R’) 1R’ = dc&(R,p)

for

some # ‘-assignment ,U in R} C STR( U) x STR( U’). A transduction _f 5: STR( U) x ~TR(~~) is ~S-~~~n~~l~~ if it is equal to d& for some (U, ~‘}-de~nition scheme

A. In the case when $V‘= v), we say that

,f

is MS-&fiiutahle

without purameters (note

that it is functional). We shall refer to the integer k by saying that &$A is k-copying; if k = 1 we say that it is non-copying and we can write more simply A as (47, $, ( fjq)qE (,I ). In this case:

and for each q in U’ qR’={(dl,....At)ED~,: We give an example automaton

(R,p,dt ,..., d,)bGH,}, concerning

,d by a ,fixed finite-state

automata automaton

where t=p(q).

on words: the product 3.

A finite-state

of a finite-state

automaton

is defined

as a 5-tuple .d = (S, X,1,6, F) where: S is a finite set of states; C is a finite input alphabet (here we shall take C = {CZ,6)); I & S is a set of initial states; 6 is a transition relation which is here a subset of S x C x S (we consider nondete~inistic automata without e-transitions); F C S is the set of of final states. The language recognized by .r/ is denoted by L(.d). The automaton .d is represented by the relational structure: I.dl = (S, I, F, tram,, tvansh) where trans, and transh are binary relations

and:

trans,( p,q) holds if and only if (p, a,q)E ci. @ai& p. q) holds if and only if (p. b, q) E rj. Let .F = (9, Z, I’, 8, F’) be a similar automaton, and .d x .F = {S x S’, C, I x I’, fs”, F x F’) be the product automaton intended to recognise the language QB’) n L(F). We assume that S’ is {l,..., k} (let us recall that .P is fixed). We let d be the k-copying I.F}

definition

scheme

(cp, tji . . . . , I/Q,( t)bv),vE(I!’ j*/; ), where

and: rp is the constant true (because every st~cture

u’ = {~?YzY~.s~,, transh,

in .WR( U’) represents an automaton

which may have inaccessible states and useless transitions); $i, . . . , I),,. are the constant true; (j~,ra,~s,,.,,,)(~I,~2)is the formula trans,(xl,xz) if (i,a,j) is a transition

of 3,

is the constant fh1.w otherwise; 4 t?YMunsr. i. , ) is defined similarly; O~c.,j(~ij is the formula 1(x, ) if i is an initial state of 9,

otherwise;

and is j&e

and

O(F.i)(xl ) is defined similarly. It is not hard to check that 1.d x .Fl =dt?fA(Ic~I). Note that the language recognised by an automaton is nonempty if and only if there is a path in its graph from some

44

B. CowwIle,

initial

I. Wulukieuiczl

Annals of’ Purr and Applied Logic 92 (1998) 3542

state to some final state. This later property

order logic. Hence, language

it follows

from Proposition

K, the set of structures

nonempty

is definable.

representing

This construction

Let d be a definition

transduction

for the values

{R: R+3X

,,...,

of parameters

X,.cp}.

in monadic

second-

that, for a fixed rational .d

such that L(.&)n in Courcelle

K is

[4].

is MS-definable.

scheme as in the general definition

We recall that Yk- is the set of parameters. defined

10 below automata

is used systematically

Fact 9. The domain of an MS-dejmable Proof.

is expressible

with w=

{Xl,. . . ,X,}.

The image of a structure R under def,

that satisfy

cp. Hence,

the domain

is

of defd is

0

The following proposition says that if R’ = def,(R,p), i.e., if R’ is defined in (R,p) by A, then the monadic second-order properties of R’ can be expressed as monadic second-order

properties of (R, p). The usefulness

of MS-definable

transductions

is based

on this proposition. (&,),,,,~,.k) be a (U, U’)-definition scheme, written with a set Let A = (cp, $1, . . . , 1c/k, of parameters %p. Let V“ be a set of set variables disjoint from YK For every variable X in V’, for every i = 1,. . , k, we let X; be a new variable. We let V’ := {Xl: X E V”, i=l

,...,k}.

For every mapping

~:V“‘-+Y’(SR),

we let nTk:Y”-+B(SR

x [k]) be

defined by (q T k)(X) = n(X) ) x {l} U . U q(&) x {k}. Note that, even if R’ is well defined, the mapping q T k is not necessarily a V.-assignment in R’, because (9 r k)(X) is not necessarily a subset of the domain of R’ which is a possibly SR x [k]. With these notations we can state:

proper subset of

Proposition 10 (Courcelle [2]). Let A be a (U, U’)-dehnition scheme with the set of parameters %“. For every formula b in MS(U’,V) one can construct a jormula y in MS(iJ,Y”

U W‘)

such that, for every R in STR(U),

and for every assignment

for every assignment

p: $4” + R

n : 3 “ + R, we have:

deji(R, p) is defined (if it is, we denote it by R’), n T k is a V-assignment and (R’, n T k) k j3 if and only tf (R, n U p) b y. From this proposition, Proposition

in R’,

we get easily [2]:

11. (1) The inverse image of an MS-deJinable

an MS-de$nable transduction is MS-definable. (2) The composition of two MS-dejinable transductions

class of structures is MS-dejinable.

Definition 12. Let x‘ and X’ be two classes of structures 3”’ C STR(U’), and let f be a transduction from X to X’.

with X C STR(U) and We say that f is MS-

compatible if there exists an algorithm that associates with every MS-formula U’ an MS-formula $ over U such that, for every structure R E .X” R b G iff R’ b cp for some R’ E f (R).

under

cp over

B. C’ourwlle. 1. Walukiewirz I Annals of‘ Pure and Applied Logic 92 (1998) 3542

It follows from Proposition

10 that every MS-definable

transduction

45

is MS-compa-

tible. Our main compatible

result

(Theorem

for R ranging

We will use MS-definable following

proposition

8) says that the transduction

over countably

branching

transductions

lR[l H IlJn(R)II

transition

for constructing

is MS-

systems of type (n,m).

k-coverings

of graphs. The

will be used in Section 5 in the proof of Theorem

8.

Proposition 13. Let k, m 3 1, let n 3 0. There exists an MS-definable transduction associating with every transition system R of type (n, m) the set of its k-coverings (Itlhere a system

R is represented

by a structure

IR/z).

system of type (n, m) and h : R’ + R be a k-covering.

Proof. Let R be a transition

By choosing an arbitrary linear ordering of each set h-‘(x), x E S,, we can assume that SR/ C S, x [k] and h(x, i) = x for every i such that (x, i) E SR/. We can assume that rootp = (rootR, 1). For each iE[k], we let Y={xESR:

(x,i)eSR’}.

For i,jE[k],

we let

Z,., = {t E TR: h(t’) = t for some t’ E TRY with source (srcR(t),i) and target (t&(t),

j)}

Since h is a bijection of outRl(x) onto outR(h(x)) for every x E SR/ it follows that for every t E Zi.j, there is a unique t’ E TRY, with source (srcR(t),i) and target (tgtR(t),j) such that h(t’) = t. We shall identify t’ with the triple (t, i,j). Hence.

U{K

SR’ =

TRY= U{Zi,j

x {i}: x

1
{(i, j)}:

This gives a description

(1)

i, j E [k]}.

(2)

of (R’Iz as the output of a definable

input (R/Z and the parameters Specifically, we have:

state in rtk,

srcRl={((t,i,j),(x,i)):

i,jE[k],

t&r

i,j E [kl, t E Zi.1,

eR’={(X,j):

&

XE&n

={(t,j,

taking as

Yi,. . . , Yk,Zi.i,. . .,Zk,k.

TtR’= {(x, l)} where x is the unique

= {((t, i,j), (x, j)):

transduction

5,

tEZ;.,,

jE[k]},

j’): tEeiRnZj,j~,j,j’E[k]},

(3)

(t,x)EsrCR},

(4)

(4X)

(5)

i=l,...,

E tgtR}>

n, i= I,..., M.

(6) (7)

In this construction, we have assumed that the parameters Yi, . . , Yk,Z,,, , . . ,Zk,k are defined from a k-covering R’ of R. In order to ensure that the constructed transduction only dclfines k-coverings of the input transduction systems we must find a formula q(Yi ,..., Yk,ZI,I ,..., Zk,k) which verifies that the structure defined by ( l)-(7) is actually

of the form IR’lz for some k-covering

R’ of R.

46

B. Courcelle, I. Walukiewiczl Annals of’ Pure and Applied Logic 92 (1998)

We consider

the following

&=U{Yi:

3542

conditions:

ldi
TR = IJ{Zi,j:

(8)

i>j E [k]}.

(9)

For every i E [k], every x E Y, every transition

t E outk(x)

(10)

there is one and only one j E [k] such that t E Zi,j, Every state of R’ is accessible

by a path from rootRl.

(11)

Conditions (8)-( 11) can be written as an MS-formula cp in parameters Yi, . . , Yk, Z,,, , . . ) Zk,k to be evaluated in IR12. Let us review them: (8)-(9) state that the mapping h : SRI U TRJ + S, U TR defined by if (X, i) E Sk’

h((x,i))=x and

h((t, (i,j))> = t if (6 (iA> E TRY is surjective. From its definition it is a homomorphism. Condition 11 states that it is a covering. Condition 11 states that R’ is indeed a transition system. Hence, cp(Y,, . proof. 0

, Yk,Z1,1,.

4. A regularisation

lemma

If R is a transition

,Zk,k)

is the

desired

formula

which

completes

the

system of type (n, m) and Y 2 Sk, we denote by R * Y the system

of type (n + 1, m) consisting of R augmented with Y as the (n + 1)th set of states. The following lemma is a crucial step for the main theorem. Lemma 14. Let n 30 and CIE _%‘I(, + 1,2). One can find an integer k such that, for every (possibly

injnite)

complete

deterministic

]Un(R)]i /= Ur,+i . a, then there exists such that IlJn(R’* Y)I, + LX.

transition

a k-covering

system

R of type (n,2),

R’ of R and a subset

if

Y of SRI

Proof. The idea of the proof is the following. If T = ]Un(R)]i /= Ur,+i . CYthen an appropriate meaning of Xn+i can be represented as a run of an automaton on T. Then one can also find a suitable meaning for X,,+I that can be represented as a regular run on T. For every subtree, a regular run on this subtree is determined by the state assigned to the root of the subtree and the isomorphism class of the subtree. As there are finitely many, say k, states, the corresponding regular run can be defined in the unfolding of a k-covering R’ of R. Hence, the set X,+1 C Un(R) satisfying CI can be replaced by the set resulting from the unfolding of a subset of R’.

B. CourceNe. I. Walukiewicl Annals qf‘ Pure and Applied Logic 92 (1998)

Let R E Yn be as in the assumption canonical

homomorphism

By Theorem

sending

of the lemma.

Denote by hi : Un(R) + R the

a path to its endpoint.

5 there exists a parity

.d = (S,.Y({ 1,. . ,n + l}),l, S,Q)

automaton

the set of trees: L(&) = {u E .Ffi+l : 1Ull

recognising

.d’ = (9, .Y({ 1,.

, n}),I’,

47

3562

/= cc}. Define the automaton

8, Q’), where:

s’={(a):

SES, i=O,l},

r’={(~,i):

sE1,

i=O,l},

((s, O), 0, (~1, ii 1,(s2,

i2 ))

if (s,a,si,sz)

E 6’

if (s,aU {n+ ((~~11, a 61, ill, 02, i2 1) E 6’ Q’(s, i) = Q(s) for i E (0, l}.

E 6 and iI,& E (0, l}, I},s~,s~)E~

and il,i2E{O,l},

It is easy to see that L(.c9’) = {U E *Z: lU/i k ELX,+i ct}. Hence, Un(R) EL(.~‘). So, by Lemma 6, &’ has a regular run r : Un(R) + S’ on R. We are going to define the system R’ required in the lemma. a folding

of Un(R)

respecting

the run Y, i.e., if two nodes

different states then they are not identified l

Intuitively,

of Un(R)

R’ is

are assigned

in the folding.

Let R’ = (SR/, T,/, fiRI, SrcR’, tgt,!, PIR~, . , P,,R~,@Rt, &RI), where SR, is the set of elements (n,(s,i)) E SR x S’ such that there exists x E Un(R) with hR(x) = n and Y(X) = (s, i).

l

We have a transition from (n,(s,i)) to (n’,(s’,i’)) if there exists x E Un(R) such that hR(x) = n, r(x) = (s, i), and, in Un(R), there is a transition from x to some x’ with hR(x’) = n’ and I = (s’, i’). The type of the transition the transition from x to x’.

is the same as the type of

0 TtR’ is (TtR,!(ttR)). 0 P;Rf(n,(s,i)) iff

PjR(fi)

Claim 15. R’ is u complete Proof.

deterministic

transition

system

It is easy to see that all states of R’ are accessible.

from every state there is exactly one transition of SR’ there is x E Un(R)

We are left to show that

of each type.

Let (n, (s, i)) E SR,. We will show that it has exactly definition

qf‘ type (n,2).

one transition

of type 1. By

such that /?R(x) = II and Y(X) = (s, i). Because

R

is complete deterministic there exists exactly one node x’ E Un(R) to which there is a type 1 transition from x. We have that (hR(x’), I) E sR( and there is a transition of type 1 from (n, (s, i)) to (AR(x), r(d)). To see that there is only one transition

of type I from (n,(s,i))

consider

some node

y E Un(R) such that /@(_y) =/Q(X) =n. In particular, subtrees Un(R)/x and Un(R)/y are isomorphic. Let y’ be the target of the type 1 transition from y. We have hR(y’) = hR(x’). By the definition

of the regular run we have Y(y’) = Y(x’).

Claim 16. R’ is a k-covering ton .d’.

of R, where k is the number

0

qf stutes of the automa-

48

B. Courcelle, I. Walukiewiczl Annals of’ Pure and Applied Logic 92 (1998) 3542

Proof. Define the mapping extends to a homomorphism

h’ : RI-+ R by h’(n,(s,i)) of transition

=n.

It is easy to check that it

systems. By Fact 4 it is a covering.

By the

of h’, the inverse image of a state of R can have at most k elements.

definition

To finish the proof of Lemma

0

14 we must find a set Y such that JUn(R’* Y)li + ~1.

E &t: i = 1). We define a run Y’ of d on Un(R’* Y) by: r’(u) = s if u is a path ending in a node (n, (s, i)) E SR~, for some n and i. It is easy to check that this is an accepting run. Hence, Un(R’ * Y)EL(&) and we get IlJn(R’ * Y)li Define Y = {(n,(s,i))

baa.

0

We consider Lemma 14 as a regularisation contains a set Z satisfying do then it contains form, defined from the unfolding

lemma because it says that if IUn(R)Ii another one having a special “regular”

of a k-covering

of R.

5. Edge contractions and the proof of the main result Our next aim is to extend Lemma

14 to transition

systems that are not deterministic.

We first consider systems of type (n, 1). If R is a transition system of type (n, 1 ), then each node of the tree Un(R) has some unordered set of successors. In case R is countably branching, Un(R) can be represented in the binary tree in way that we now describe. We define a transformation

that makes a tree T E yn+l (which is a system of type

(n + 1,2)) into a tree c(T) of type (n, 1). Let TE.%+i be defined by an (n + 1)-tuple

of subsets

of { 1,2}*,

namely

by

We let c(T) be the tree such that:

,,+lT).

(pIT,...,p

. &(T)=({1,2)* \pIT)u {E}; x + y in c(T) iff there is in T a path of the form x -+ zi --+z2 ---f . . + zp + y with

l

p 20

and zi,z2,.

. ,zp E PI T (x + y is a shorthand

for “there is a transition

from x

to y”); l

Pi_lc(~)=Pi~flSc(~) for i=2,...,n+ 1. Our next aim is to define a similar operation Un(c(R))

on transition

systems so that

= c(Un(R)).

A special transition system is a system R of type (n + 1,2), for some n, such that (1) R is complete deterministic; (2)

rOOtR $ PIR;

(3)

PIRn(P2RU”‘UP,+lR)=0.

We now define a transformation c that transforms any special transition type (n + 1,2) into one of type (n, 1). We let c(R) be such that l

SC(R) =sR

l

Pit(R)

\ PIR;

l

root,(R) = rootR;

= Pi+lR

n &(R)for i = 2,. . . , n;

system R of

B. Courcelle, I. Walukiewicrl

l

x + y is a transition .x+zr+z:!+

Annals of’ Pure and Applied Logic 92 (1998) 3542

of c(R) iff x, y E Seer) and we have a path in R of the form

... +zp+y

withx,y$P,R,

zI,z2 ,..., z,EP,~,

Lemma 17. If R is speciul then we have c(Un(R)) Proof. Easy verification.

cun construct u special c(Bin(R)) = R.

p>O.

= Un(c(R)).

0

Lemma 18. For every countably

Proof.

49

branching

transition

We let R’ be the transition

(1) we add a new “sink” state I

transition

system,

Bin(R)

system of type

R of type (n, 1) one (n + 1,2)

such

that

system of type (n + 1,2) defined as follows: and two transitions

I + I:

one of type 1 and one

of type 2, (2) for each state s E SR we do the following: (a) if outR(s)=@,

we add two transitions s + I of types 1 and 2; (b) if outR(s) = {t}, we add a transition s --+ I of type 2 (note that the transition t is necessarily of type 1); (c) if outR(s) consists of two transitions,

we make one of them a type 2 transition,

the other transition continues to be of type 1. (d) if outr((s) consists of at least three transitions tl, 2.42,.. , , u&l.

. , tk then we add new states

For i = 2,. . , k - 1 we change the source of ti to Ui. We also

change the source of tk to Q-2. We add new transitions s + ~2, u, -+ U,+I for i = 2 , . . . , k - 1. All added transitions as well as the transition tk become transitions

tl ,...,tk_l

of type 2. Transitions

(e) if outR(s) is infinite but countable

continue

then we enumerate

to be of type 1; the transitions

tl, t2,. . .

and proceed similarly to the previous case. consist of all “new states” (the state I and the states intro(3) We let PIBin duced in the steps 2c and 2d above) and we let PI+[~;O(R)= PR for every i = 11..., n. 0 Lemma 19. [f’R is a special transition K is also special and c(K)

system

is LI k-covering

Proof. We let h: K + Bin(R)

and K is a k-covering

of Bin(R)

then

of R.

be a k-covering.

We first check that K is a special

system. Condition 1 of the definition of a special system (saying that K is complete deterministic) holds because every covering of a complete deterministic system is complete deterministic. Conditions 2 and 3 hold easily. It remains to prove that c(K) is a k-covering of R. Let us consider h : SccK)-+ SR. It is the desired covering. This follows from the observations establishing that K is a special system. 0 Proposition 20. Let n 2 0 and CIE Y, (n+ l,l). One can find an integer k, such thut for every countably brunching transition system R of type (n, 1) if IUn(R)Ir /= ?I&+, .a

B. Courcelle, I. Walukiewic I Annals of’ Pure and Applied Logic 92 (I 998) 3542

50

then there exists a k-covering R’ of R and a subset Y of SRI such that IUn(R’ * Y)li \ fX Proof. We first construct a formula p E yi((n+2,2)

such that for every tree T in &+2

we have ITI, kp

iff PI~~(P~TU...UP,+IT)=~

and lc(T>li +a.

This is possible because the mapping from lrli of structures. We let k be the integer associated

to Ic(T)Ii is a definable with /? by Lemma 14.

Let R be a transition system of type (n, 1) such that (Un(R)Ii set Z &&n(R) we have thus lUn(R) * 41

+ Ur,+l .a. For some

I= a.

Bin(R) is a special transition

Because

transduction

Un(R) = c(Un(Bin(R))).

It also follows

system,

from Lemmas

17 and 18 we have:

that Z C SUn(Bin(R)) and Z n RiUn(Bin(R))= 8.

Hence, IUn(Bin(R)) By Lemma

* ZII + P.

14 we have some k-covering

K of Bin(R) and some Y C Sk such that

IWK * UI I= P. It holds in particular

that P~Kn Y = 8. By Lemma

19, c(K) is a k-covering

of R and

Y c SC(K). Hence, c(K) is the desired system R’ since Ic(Un(K *

U)II k u

and c(Un(K

* Y)) = Un(c(K * Y)) = Un(c(K)

Proof of Theorem 8. Let us first consider

* Y).

0

the case of the systems

of type (n, 1).

We want to show that for every formula cpE 21 (n, l), one can construct @ E _f?z(n, 1) such that, for every transition system R of type (n, 1):

a formula

1% I= ? ifi lWWI1 I= cp. The proof proceeds by induction

on the structure of cp. We assume that cp is a closed

formula. This is not a restriction as two formulas are equivalent iff the closed formulas obtained by substituting unary relational symbols for free variables are equivalent. If cp is a closed atomic formula then + = cp. The cases for conjunction and negation are obvious. Assume cp= 3x .a(X). By Proposition 20 there is an integer k such that for every transition system of type (n, 1): (Un(R)Ii k 3X. cc(X) iff there exists a k-covering R’ of R and a subset Y of &I, such that, IUn(R’ * Y)li k a[P,+,/X].

B. Courcelle, I. Walukiewicz I Annals oj’ Purr and Applied Logic 92 (1998)

By induction

assumption

we have a formula z[P,+i /Xl, such that, for every transition

I,1 ):

system K of type (n +

It remains

51

3542

to show that the property: R’ of R such that R’ + X

there exist a k-covering

.$X)

is MS-definable. By Proposition 13 we know that the transduction associating with R the set of its k coverings is MS-definable. (This transduction has parameters Y, , . . . , Yk, Zl,l, . . . , Zk,k; each admissible choice of parameters gives us a k-covering). Proposition 10 gives us the desired formula

@.

We now prove the theorem for systems of the general type (n,m) with m 3 1. We define a transformation z making a transition system R of type (n,m) into a transition

x(R) of type (n + m, 1) such that the transduction

system

is MS-definable, to transition MS-definable

and a transformation

systems and

/I from transition

of type (n,m)

systems

such that the transduction

[RI2 H

lR[l H

system R of type (n,m).

general case of Theorem proved. Definition

of LX.Let R be a transition , (x,m)

is

Clearly,

such transformations

reduce the

8 to the case of systems of type (n, 1) which we have just

system of type (n,m)

of cc(R) is to replace

The idea of the construction (x, l),

ip(R

(12)

WR) = B(W4R))) for every transition

lcc(R)l2

of type (n + m, 1)

in R’ and to replace

a transition

with m 22.

a state x of R by m states

y +x

of type i by m transitions

from ( y, 1 ), . , (y, m) to (x, i) all of type 1. (If there is no transition to x then we need not put in cc(R) the state (x,i).) Here is the formal definition

of type i from y

of a(R). Suppose

R= (SR, TR,SrCR,tgtR,rOOtR,P~R,. .,Pn~,Q~~,...,Qrn~). Recall that [m] denotes the set { 1,. . ,m}. First we define the system R’ which is the 5-tuple (&‘, TRf.SrCRJ,tgt,,, rOOfRl,PiR’, .

,P,,R’,&,

where SRI =sR x

[m],

TRY= TR x [m], (s,i) = srcR’(t,j)

iff s = srcR(t) and i = j,

(s, i) = tgt,,(t, j)

iff s = tgt,(t)

and t E Q;R,

. . ,P&),

52

B. Courcelle. I. Walukiewicz I Annals of Pure and Applied Logic 92 (1998)

3542

t-o&,(, = (rootR, l), &‘(.&j)@~E&

and

R&s)

for i= I,...,

P~p(S,j)HSSESR

and

i=j

for i= l,...,n.

Then R’ is “almost”

a transition

?Z,

system of type (n + m, 1): “almost”

because

some

states may be unreachable. One obtains a(R) by restricting R’ to the reachable states and transitions. It is clear from this definition that lcc(R)/2 is definable from [RI1 by a definable

transduction.

We omit the details.

Definition of j?. Let R’ be a transition (SR’,TR’,SrCRf,tgtRf,YOOtR’,PIRf

system of the form

,...,

PnRt,P; R,,...,

phR,),

where Pip, . . , P,,p, Pi,,, . . . , PhRI are properties of states. Then we define a transition system b(R) iff (P,‘,,, . . . , Pk,, ) forms a partition of SR~. If this is the case we let P(R’ ) = R where SR = SR,, TR = Tp, srcR = SrcRl, tgt, = tgt,, , rOOtR= rootp, 8~ = pip for i = 1,...,n and Q~R={~ET~ It!&(t)EP&} for i= l,...,n. is definable from lRl{ by a definable transduction. It is also clear from the construction that b(Un(a(R))) transition system of type (n,m) and that

This completes

the proof of Theorem

6. The Shelah-StuppMuchnik

8.

It is clear that l/?(R)11

is well defined

for every

0

construction

We recall a construction and a result from Shelah and Stupp [12, 141 extended by Muchnik. The result by Muchnik is stated without a proof in Semenov [l l] and a new proof is sketched in [15]. We establish that it yields an improvement

of our main

result. We let U be a finite set of relational symbols where each symbol r has a finite arity p(r). We recall that we denote by STR(U) the class of all U-structures, i.e., of tuples of the form M = (DM, (Y,+,),.~u) where D M is a nonempty set (the domain of M) and r-~ Z D$’ for every r E U. We let son and cl be two relation symbols, binary and unary, respectively, which are not in U. We let U+ = U U {son, cl}. We let D& and (0~ )+ stand for the set of finite sequences over DM and the set of finite nonempty sequences, respectively. With M E STR( U) we associate the U+-structure:

B. Courdr,

I. Wulukiewicrl

Annuls

of’ Pure und Applied Logic 92 (1998) 3542

53

where ?-MM-

={(wd,,...,wd

p(r)):M'ED,~,(dl,...,d,,,r))ErM},

={(w,wd):

.Pon,,,-

dM * ={wdd:

wED;,dED,$,},

WEDL,dEDM}.

Intuitively, M+ is a “tree built over M”; solz is the corresponding successor relation and cl is the set of clones, i.e., of elements of ML that are “like their fathers” (if son(x,y)

we also say that x is the father of y; it is unique).

Theorem 21 (Muchnik computible.

[l l] and Walukiewicz

In words, for every formula

$ in MS(U),

[ 151). The mapping

cp in MS(U’)

M wM+

one can construct

is MSu formuh

such that, jtir every M E STR( U):

It is stated (without

a proof)

in Shelah [12] and Thomas

[14] that, if a structure

M has a decidable monadic theory then so has the structure M+ with respect to the language MS( U+ - {cl}). This statement weakens Theorem 21 in two respects: the “clone” relation is omitted and the statement only concerns decidability of theories and not translations of Theorem

of formulas.

From Theorem

2 1, one gets the following

improvement

8:

Theorem 22. For every n, m E ,,I/‘ with m 2 1, the transduction: IRII H IWR)II is MS-compatible,

where R ranges over simple trunsition

A transition system is simple if no two distinct target and type. Since some properties

systems

transitions

of simple graphs are MS-expressible

of type (n, m).

have the same source, with edge set quantifica-

tions but not without them, the result of Theorem 22 is an improvement

of Theorem

8.

(The property that a simple directed graph has a directed spanning

tree of out-degree

no bigger than some constant

the existence

Hamiltonian

is an example

circuit is another example;

of such a property;

of a

see [3, p. 1251.)

Theorem 22 follows from Theorem 21 because the unfolding of R is MS-definable in IRI: (see Proposition 24). Before showing this we will introduce a useful definition. If Q is a binary relation on DM, then we let Q” and Q’“’ (respectively, and the rotation of Q) be defined as follows: Q”={(wd,wd’): Qrot={(wd,wdd’):

wED;,(d,d’)EQ}, wED;,(d,d’)EQ}.

(Note that Q” is defined from Q like YM is from T,M.)

the trunslution

54

B. Courcelle,

I. Wulukiewiczi

Claim 23. If Q is MS-definable

Annals qt’ Pure und Applied Logic 92 (1998)

3542

in A4 then so are Q” and Q’“’ in A4+.

Proof. To prove this for Q” it is enough to observe that:

iff Wom-(z,~)

Qtrky>

A son,ttlby)

where (p’(z,x, y) is the relativization of the formula Qrof(x, y)

cp(x,y) defining iff

0

22 is an immediate

Proposition

24. For

to the set of sons of z (sons in the sense of M+)

Q in M. For Q’O’, we have

Zlz(sonM+(x,z) A sonM+(x, y) A cl~+(z) A Qtr(z, y))

which proves the claim. Theorem

A cp’kx,~)),

every

consequence

n,m E _M,

where R is a simple transition

system

m 3 1, the

transduction

([RI>)+ H IUn(R)II,

of type (n, m), is MS-dejinable.

PrOOf. Assume M = [RI, = (SR,YOO~,J+ SUCIR,. relation w on (sR)+ as follows:

w= w, u...u w,,

of

. . ,SUC,R,P~R,.

. . ,

P,,R). We define a binary

where for each i, Wi = (SUCiR)rot.

We let N C (SR)+ be defined as follows: y E N iff there exists x E (sR)+ such that rootM-(x) A(x,y)

A (Vz ~son~+(z,x))

E w*.

Note that the first two conjuncts of the above condition define x uniquely since r##tR consists of a unique state (x is r where r##tR = {r}). We use W* to denote the transitive closure of W. Hence, N is the set of elements this x by a directed path with edges in W.

of Si that are accessible

Claim 25. IUn(R)Ii = (N, P’,‘,. . ., Wi,P[ ,..., P,‘), where

H$‘=I4$n(N

P,RnN

for every i= l,...,

m and j=

Proof. We define a bijection be a path in Paths(R), say (SR)+ where SO is the initial t, and s; is the target of ti. Since R is simple, h is ~((SO~~~~~Si)~(SO~~~ .3Si+l))

l,...,

xN)

from

and $=

n.

h of Paths(R) (the set of nodes of Un(R)) onto N. Let p p = (t,, . . ., tk), tl,. . . , tk E TR. We let h(p) =(sg,. . .,sk) E state of R and for each i = 1,. . ,k, S/_-l is the source of one-to-one. If Si +s;+i is a transition holds. Hence, h maps Paths(R) onto N.

of type j then

It is then easy to verify that every y E N is the image by h of some path p (the proof is by induction on the least integer k such that (x, y) E Wk where x is the element of (SK)+ used in the definition of N). Finally, h is an isomorphism. We omit the details. 0

B. Courcrllr,

I. Wulukielvic

I Annals of’ Puw und Applird

It is clear from the definition formula IUn(R)I,

that N is a definable

on IV+) and that the relations can be obtained

3542

55

subset of (SR)+ (by an MS-

W,‘,. . . , WA,e’, . . . ,p,’ are MS-definable.

from (IRli )+ by a definable

The proof of this proposition

Logic 92 (1998)

transduction.

Hence

0

is due to W. Thomas (private communication).

Example. Let U = 0, M = ({ 0, 1)) . Consider Mf = ({ 0, 1}+, SUPZ~., cl~ L) One can define the complete binary tree B = (N, suci, sucz) in Mf as follows: one lets x be an arbitrary element of M+ having no father; one lets N be the set of elements (0, l}’ such that (x, y) E (son,+ )*, one lets then suc,(u,c)

w

son~~(U,v)ACl,~~-(v),

suc*(u,c)

‘3

son~+(u,v)

v of

A ~(.l(.(V).

There are only two choices for x and the corresponding

structures are both isomorphic

to B. It follows that the monadic theory of B reduces to that of M+. The later is decidable since the monadic theory of M is decidable (as A4 is finite).

7. Graph coverings We have seen that the mapping MS-compatible question

for graphs. We consider

the answers are completely

7.1. Bidirectional We consider

from a transition

(where a system R is represented actually

system to its universal

covering

is

by lR[z or IRll). We ask the same

two different notions

of covering

for which

different.

coverings

directed graphs G, defined by means of sets: V, (vertices),

EG (edges)

and the source and target mappings respectively srco : EG -+ VG, tgt, : EG -+ VG. For convenience we restrict here to connected graphs. The extension of the results to disconnected graphs is easy. For x E V, we denote by inc(x)

the set of edges of G with target x; we denote by

outc;(x) the set of edges with source x. Definition 26 (Bidirectional covering). Let G, G’ be connected graphs. A homomorphism h : G’ + G is a bidirectional covering iff it is surjective and for every x E V&, h is a bijection of inct(x) onto inc(h(x)) and of outot(x) onto outo(h(x)). For short, we shall write h-covering b-coverings

treat incoming

for bidirectional

edges exactly as outgoing

covering.

edges.

Unlike

coverings,

B. Courcelle, I. Walukiewiczl Annals of’ Pure and Applied Logic 92 (1998)

56

Definition

27 (Signed

and n E {+, -}.

edges, walks).

3542

A signed edge of G is a pair (e, q), where e E Eo

We define srco and tgto for signed edges as follows:

srco(e, +) = srco(e),

srco(e, -) = tgt,(e), tgto(e, -) = srco(e).

tgto(e, +) = t&(e),

We let suco be the binary relation suco((e, q), (e’, n’))

iff

on signed edges:

tgto(e, r) = srco(e’, n’) A (e = e’ * r = II’).

A walk in G is a finite sequence of signed edges w = ((ei, ni ), . . . , (ek, Q )) such that suc((e;,qi),(e,+i, yIi+i)) holds for all i = 1,. . . , k - 1. We say that w is a walk from srcG(el,

VI)

to

Y]k>.

t@G(%

Intuitively, a walk is a path in G traversing edges in either direction. A signed edge (ei, Q) represents a traversal of ei in the standard direction if Q = + and in the reverse direction

if q; = -.

A walk is not allowed to take the same edge twice consecutively

in opposite directions. Fact 28. If’ h: G’--+ G is a homomorphism from

x to y in G’ then the image

(h(e,+),nk))

is a walk in G from

and w =((el,n~),...,(ek,nk))

of w defined

as the sequence

is a walk ..,

((h(el),nl),.

h(x) to h(y).

Fact 29. Zf h : G’ + G is a b-covering, x’ E Vo,, h(x’) =x and w is a walk from x to y in G, then there is a unique walk w’ in G’ from x’ to some y’ such that h(w’) = w. Vertex

y’ satisjes

h(y’) = y.

We now construct a b-covering of a graph G in terms of walks. Let G be connected, let s E Vo. Denote by W(s) the set of all the walks from s to arbitrary vertices. We put in W(s) the empty walk E and assume that it goes from s to s. We let H be the graph such that VH= W(s), If

W.(e,l])EEH

En = a disjoint for some

copy of W(s) - {E}.

eEEa

and

yE{+,-},

we let

tgtH(w.(e,V]))=W.(e,q) if q=+ and srcH(w.(e,~))=w.(e,vl) otherwise. We now let h : H + G be the homomorphism such that h(E) = s, h(w) =x

such that w goes from s to x, w E Vn - {E},

h(w) = e

where w E En is of the form w’ . (e, II).

Fact 30. h : H --f G is a b-covering.

srcH(W.(e,q>)=W

and

and tgtH(W.(eY~))=w

B. C’ourcelle, I. Walukiewiczl Annals qf’ Pure and Applied Logic, 92 (1998)

35.-62

51

Proposition 31. For every h-covering k : K t G there is a surjective homomorphism m : H + K such that k am = h which is u h-covering. For every two such homomorphisms m, m’ : H + K, there is an automorphism Proof.

Easy consequence

of Facts 28 and 29.

We shall call H the universal b-covering Theorem 32. The trunsduction

mupping

i of H, such thut, m’ = m Q i. 0

of G and denote it by UBC(G). ICI2 to 1UBC(G)II

,for connected

graphs G

is MS-computihle. Proof. We first recall that the structure

G is ( VGU EG, r-srclG12, r-tgtlciz)

jG12 defining

where: r-srclq, = {(e,srcc(e)):

e E EG},

r-tgtlG12= {(e,tgb(e)):

e E EG}.

(In order to avoid confusions

between functions

the binary relation

with the unary function

associated

and relations we use r-srclG12 to denote srcG : EC + VG, and similarly

r-tgtjol:.) In order to handle signed edges by logical formulas, 1613 =

(VC UEG

we shall consider

for

the structure

x {+, -), r-src~~l,,r-tqGli, dir~l,,dir~l,),

where

dir&,,= {(e, +): e E EG}, r-srclGl, = {(f, srcc(f)): r-tgti,l,=

{(f,tsb(f

It is easy to construct

f E EC

is MS-definable

= {(e, -):

e E EG},

x {+, -}},

)): .f EEG x 1-t. -11. an MS-transduction

Next, we show that UBC(G) by a MS-transduction.

dirkl,

transforming

is MS-definable

in [Cl:,

1612 into IGls. hence is definable

First, observe that suco is MS-definable

from IG(T

in IGls, hence (suco)‘Ot

in ICI: by Claim 23.

The elements of the domain of IGIl are nonempty sequences of elements of IGi3. We shall select a subset N of them corresponding to the walks from some vertex s to all the vertices of G. Such a set can be characterised by the following conditions: (1) N is closed under (suc~)~‘~ (i.e., if x E N a n d (suc~)~‘~(x, y) holds then y EN); holds; (2) if x E N and y EL+-,; and sonlcl;(y, x ) holds then y E N and (suco)‘“‘(y,x) (3) there is a unique element s,y E Dlcl:, such that, r-srclGIT (X,SN) holds for every x EN for which there is no y with sonIcI; (y,x). A set N U {SN} will be the set of nodes of UBC(G) we are constructing. Different choices of N correspond to different choices of the root vertex SN in the condition (3) and will yield the same covering

up to isomorphism.

58

B. Courcellr,

I. Wulukietviczl Annals oj Pure and Applied Logic 92 (1998)

We define the edge relation (1) if x,y~N

3542

Q C N x N as follows:

and son,,,+(x,y),

we put an edge (x,y)~Q

if dir&(y)

and put an

edge (YP) E Q if dirt,;; (2)

if y EN and son,o,,(x,

y) for no x EN, then we put an edge (SN, y) E Q if dir&(y)

and an edge (y,sn) E Q if dir+(y). It is easy to check that (N, Q) is isomorphic

We obtain thus that the transduction it can be written as the following PI2

+-+ PI3

+-+PI:

to UK(G).

IGlz H 1UK(G)1

1 is MS-compatible

because

composition:

++I UBC(G)II,

where the first and the third transformations are MS-definable, MS-compatible by Theorem 21. This completes the proof. 0

whereas the second is

Open problem: Can one change 1612 to IGI 1 in the statement of Theorem 32 for simple graphs G? (It is false for nonsimple

graphs as multiple

edges are identified

in ICI 1.)

7.2. Distance-l-coverings For every graph G and every x E V,, we denote by BG(x) by {x} U V, where V is the set of vertices adjacent to x. A distance-l-covering (a dl-covering for every y E Vp, h is an isomorphism: Example.

G’ is dl-covering

the subgraph of G induced

for short) is a b-covering Bp(y) -+ BG(h(y)).

of G where G and G’ are presented

h : G’ --+ G such that

in Fig. 1 and h maps

x’ and x” to x for x E {a,b,c,d}. The graph GJ is a b-covering of the graph Gi presented in Fig. 1. But G2 is not a dl-covering. Clearly, G1 is isomorphic to all its dl-coverings since Gi = BG, (x) for some x.

G

G

4 -==--=-...

Fig. I. Example

G2

of dl-covering

...

and b-covering

B. Courcelle.

I.

Wdukiewicl

We shall now construct universal

b-covering

Annals

a universal

of Pure and Applied

dl-covering

We let H = UBC(G)

h(u)=h(

3542

59

of a graph G as a quotient

(see Fact 30 above) and h : H + G be the canonical

of its

b-covering.

relation defined as

v ) an d u, 11belong to a connected

h-‘(BG(x))

component

of

for some x}.

We let H’ be the quotient homomorphism

92 (1998)

CJBC( G).

We let E C ( V, x VH) U (EH x EH ) be the equivalence {(a,~):

Logic

graph H/E, we let k : H + H’ be the canonical

surjective

such that h = h’o k. It is not hard to see that h’ is a dl-covering

of G and that every dl -covering m : G’ + G factors into h’ o ml, where m’ : G’ + H’ is a surjective homomorphism and furthermore a dl-covering. We shall call H’ the universul-dl-covering

of G and denote it by UDC(G).

Proposition 33. The muppiny ICI* H 1UDC( G)I 1 is not MS-compatible restricted to finite connected graphs of’decqree ut most 6.

even if G is

Proof. We construct a finite connected graph G of degree 6, such that, UDC(G) is the infinite grid (augmented with diagonals on each square). Since the monadic theory of UDC(G)

is undecidable

(even if MS-formulas

do not use quantification

over sets

of edges), and since the monadic theory of ICI2 is decidable (since G is finite) it follows that MS-formulas expressing properties of UDC(H) cannot be translated into equivalent MS-formulas on IHI* in a uniform way, for all finite connected graphs H, even of bounded degree at most 6. The infinite grid with diagonals is the graph H such that V,, = Int x Int, EH

= {((x>_Y),(x',y')):

x, y,x’,

y’ E

Znt, x
+

l.~‘dy’
+ 1,

(X,,V)#(X’,.Y’~). tnt denotes the set of integers.

Fig. 2 shows a portion of H.

For x,x’ E Int we let x - x’ iff x - x’ is a multiple of 4. For (x, y), (x’, y’) E VH we let (x,y) N (x’, y’) iff x-x’ and y-y’. For e,e’ E EH linking, respectively, zt to z2 I and z{ to zi, we let e - e ’ iffzl -vz{ andz2 N z1. We let G be the quotient graph HI N. Then G is the graph partially shown on Fig. 3. We let h be the canonical surjective homomorphism h : H + G. Furthermore, h is a dl-covering of G. In order to prove that H = UDC(G) it is enough to prove that if So let k : K + H be x, J) E V, such that x # are at minimal distance, (e,,q,)). nj=((el,‘lt),..., from z = k(x) to itself.

k : K 4 H is a dl-covering then k is an isomorphism. a dl -covering of H. If k is not an isomorphism, there exist y and k(x) = k(y). Let us select such a pair where x and y say n. Hence, in K there exists a walk from x to y of the form Its image under k is a walk k(wJ)=((k(el),gl),...,(k(e,,),q,))

60

B. Courcelle. I.

Wulukiewicl Annuls

of’ Pure und Applied Logic 92 (1998)

35-62

Fig. 2. A portion of H

Fig. 3. Graph G.

The intermediate cause otherwise,

n

vertices

on this walk are pairwise

distinct

and distinct

with z be-

would not be the distance between x and y or one could find a pair

x’, y’ E VK such that k(x’) = k(y’), x’ # y’ and the distance

between

x’ and y’ is less

than n. Consider now k(w). It defines a cycle on the planar graph H (where edges can be traversed in either direction). This cycle is simple (it does not cross itself) and has a certain area namely, the number of triangles forming its interior part. We shall prove that we can replace w by a walk w’ from x to y of the same length and such that the area of k(w’) is strictly smaller than that of k(w). This will give us a contradiction and prove that k is an isomorphism. Let u be the unique vertex of k(w) having a maximal first component among those that have a maximal second component. We first assume that u #k(x) =k(y). Let u = (us, ui ). Let u and u’ be the two neighbours of u on the circular walk k(w). Up

B. Courcelle, I. Walukiewicz I Annals of’ Pure and Applied Logic 92 (1998) 3542

to exchanges conditions

of u and v’ we have the following

possible

61

cases (by the maximality

on uo and ~1):

Cusr 1: C’(2.Q - l,U,), Case 2: v=(zlg,zli Case 3: u=(ug However,

u’=(uo

- l,U, - 1).

- l), u’=(ua

- 1,Ui - 1).

- l,U,),

case 1 cannot

u’=(u(),u, happen

- 1). because

w is minimal.

Let us check this. Let U

be the vertex of w with k(ii)=u. Since k is an isomorphism between By and BH(u) since u,u’EBH(u) and are adjacent, so are r?=k-‘(u) and i?=k-‘(u’) in By. It follows that w can be replaced by a shorter walk, which connects directly

6 and t;’ and skips ii. This contradicts

the hypothesis

that w has a minimal

length. Case 2 cannot happen for a similar reason. In case 3 we cannot connect

directly

V and ~7’but we can link them via the unique

vertex E’(uo - I,ui - 1) in By (note that u,v’ and (UO - l,ut - 1) belong all to BH(u)). The resulting walk w’ is such that k(w’) has a smaller area than k(w) (smaller by 2). If u =k(x) =k(y) we use a similar argument by replacing u by the unique vertex of k(w) having a minimal first component among those that have a minimal second 0 component. The argument goes through with +1 instead of - 1 everywhere.

8. Conclusions We have shown the main conjecture of [4] (see Theorem 8) saying that the unfolding operation is MS-compatible provided graphs (or transition systems) are represented in a way making

it possible

to quantify

in particular

that the unfolding

MS-theory,

still has a decidable

over sets of edges (or of transitions).

of a graph or a transition

system having

It follows a decidable

MS-theory.

A stronger form of this result follows from Theorem 21. We have also considered “bidirectional unfolding” of graphs. Although it is very close to unfolding, we could extend the main theorem only for the logic with the power to quantify over edges of a graph. Whether one can strengthen the theorem and get the result for the logic with quantification limited to vertices is an open question. These unfoldings have been defined as instances of the very general topological notion of covering (for appropriate notions of neighbourhood). The two notions correspond to neighbourhoods of increasing strengths. For the next step (distance l-coverings), we loose the MS-compatibility we have for the unfolding. In particular, the transformation of a graph into its universal-dl-covering does not preserve decidability

of the MS-theory.

B. Courcelle. I. Walukiewic I Annals of Pure and Applied Logic 92 (I 998) 3542

62

Acknowledgements The authors would like to thank Wolfgang significant

comments

yielding

simplifications

Thomas and Suzanne

Zeitman

for many

in the proofs.

References [1] B. Bollobas, Extremal Graph Theory, Academic Press, New York, 1978. [2] B. Courcelle, Monadic second-order graph transductions: a survey, Theoret. Comput. Sci. 126 (1994) 53-75. [3] B. Courcelle, The monadic second-order logic on graphs VI: on several representations of graphs by relational structures, Disc. Appl. Math. 54 (1994) 117-149. (Erratum in Disc. App. Math. 63 (1995) 1999200). [4] B. Courcelle, The monadic second-order logic on graphs IX: machines and behaviours, Theoret. Comput. Sci. 151 (1995) 125-162. [5] B. Courcelle, The expression of graph properties and graph transformations in monadic secondorder logic, in: G. Rozenberg (Ed.), Hand-book of Graph Transformations: Foundations, vol. 1, World Scientific, Singapore, 1997, pp. 313-400. [6] E.A. Emerson, C.S. Jutla, Tree automata, mu-calculus and determinacy, Proc. FOCS 91, 1991, pp. 368-377. [7] A.W. Mostowski, Regular expressions for infinite trees and a standard form of automata, in: A. Skowron (Ed.), 5th Symp on Computation Theory, Lecture Notes in Computer Science, vol. 208, 1984, pp. 157-168. [8] A.W. Mostowski, Games with forbidden positions, Technical Report 78, University of Gdansk, 1991. [9] D. Niwinski, Fixed points vs. infinite generation, in LICS ‘88, 1988, pp. 402-409. [IO] M. Rabin, Decidability of second-order theories and automata on infinite trees, Trans. Amer. Math. Sot. 141 (1969) l-35. [I l] A. Semenov, Decidability of monadic theories, in MFCS ‘84, Lecture Notes in Computer Science, vol. 176, Springer, Berlin, 1984, pp. 162-175. [12] S. Shelah, The monadic second-order theory of order, Ann. Math. 102 (1975) 379-419. [13] J. Stupp, The lattice-model is recursive in the original model, Institute of Mathematics, The Hebrew University, Jerusalem, January 1975. [14] W. Thomas, Language, automata and logic, in: Handbook of Formal Language Theory, Vol. 3, Springer, Berlin, Heidelberg, 1997, pp. 389455. [15] I. Walukiewicz, Monadic second order logic on tree-like structures, STACS ‘96, Lecture Notes in Computer Science, vol. 1046, 1996, pp. 401-414.