On Rational Graphs. Christophe Morvan. IRISA, Campus de Beaulieu, Rennes, France

Similar documents
Coalgebra, Lecture 15: Equations for Deterministic Automata

Speech Recognition Lecture 2: Finite Automata and Finite-State Transducers. Mehryar Mohri Courant Institute and Google Research

Contextual graph grammars characterising Rational Graphs

Speech Recognition Lecture 2: Finite Automata and Finite-State Transducers

Introduction to rational graphs

CONTEXT-SENSITIVE LANGUAGES, RATIONAL GRAPHS AND DETERMINISM

Lecture 08: Feb. 08, 2019

Formal Languages and Automata

More general families of infinite graphs

Closure Properties of Regular Languages

1 Nondeterministic Finite Automata

Formal languages, automata, and theory of computation

First Midterm Examination

Minimal DFA. minimal DFA for L starting from any other

p-adic Egyptian Fractions

Assignment 1 Automata, Languages, and Computability. 1 Finite State Automata and Regular Languages

Designing finite automata II

Lecture 3: Equivalence Relations

The Caucal Hierarchy of Infinite Graphs in Terms of Logic and Higher-order Pushdown Automata

Harvard University Computer Science 121 Midterm October 23, 2012

A negative answer to a question of Wilke on varieties of!-languages

Regular expressions, Finite Automata, transition graphs are all the same!!

CS 310 (sec 20) - Winter Final Exam (solutions) SOLUTIONS

CMPSCI 250: Introduction to Computation. Lecture #31: What DFA s Can and Can t Do David Mix Barrington 9 April 2014

1 From NFA to regular expression

AUTOMATA AND LANGUAGES. Definition 1.5: Finite Automaton

Convert the NFA into DFA

80 CHAPTER 2. DFA S, NFA S, REGULAR LANGUAGES. 2.6 Finite State Automata With Output: Transducers

Parse trees, ambiguity, and Chomsky normal form

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

ɛ-closure, Kleene s Theorem,

Talen en Automaten Test 1, Mon 7 th Dec, h45 17h30

The University of Nottingham SCHOOL OF COMPUTER SCIENCE A LEVEL 2 MODULE, SPRING SEMESTER LANGUAGES AND COMPUTATION ANSWERS

Finite Automata-cont d

CM10196 Topic 4: Functions and Relations

Theory of Computation Regular Languages. (NTU EE) Regular Languages Fall / 38

Lecture 09: Myhill-Nerode Theorem

Theory of Computation Regular Languages

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true.

BACHELOR THESIS Star height

Formal Languages and Automata Theory. D. Goswami and K. V. Krishna

5. (±±) Λ = fw j w is string of even lengthg [ 00 = f11,00g 7. (11 [ 00)± Λ = fw j w egins with either 11 or 00g 8. (0 [ ffl)1 Λ = 01 Λ [ 1 Λ 9.

Tutorial Automata and formal Languages

Grammar. Languages. Content 5/10/16. Automata and Languages. Regular Languages. Regular Languages

CHAPTER 1 Regular Languages. Contents

Thoery of Automata CS402

1.3 Regular Expressions

Table of contents: Lecture N Summary... 3 What does automata mean?... 3 Introduction to languages... 3 Alphabets... 3 Strings...

3 Regular expressions

CS 301. Lecture 04 Regular Expressions. Stephen Checkoway. January 29, 2018

Chapter 2 Finite Automata

Compiler Design. Fall Lexical Analysis. Sample Exercises and Solutions. Prof. Pedro C. Diniz

Nondeterminism and Nodeterministic Automata

Automata Theory 101. Introduction. Outline. Introduction Finite Automata Regular Expressions ω-automata. Ralf Huuck.

Context-Free Grammars and Languages

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. Comparing DFAs and NFAs (cont.) Finite Automata 2

CSCI 340: Computational Models. Kleene s Theorem. Department of Computer Science

DFA minimisation using the Myhill-Nerode theorem

Homework 3 Solutions

Hierarchy of pushdown graphs

CMSC 330: Organization of Programming Languages

Model Reduction of Finite State Machines by Contraction

First Midterm Examination

Intermediate Math Circles Wednesday, November 14, 2018 Finite Automata II. Nickolas Rollick a b b. a b 4

PART 2. REGULAR LANGUAGES, GRAMMARS AND AUTOMATA

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. NFA for (a b)*abb.

Bases for Vector Spaces

Finite Automata. Informatics 2A: Lecture 3. John Longley. 22 September School of Informatics University of Edinburgh

A tutorial on sequential functions

2.4 Linear Inequalities and Interval Notation

The size of subsequence automaton

CS 275 Automata and Formal Language Theory

Homework Solution - Set 5 Due: Friday 10/03/08

Farey Fractions. Rickard Fernström. U.U.D.M. Project Report 2017:24. Department of Mathematics Uppsala University

CDM Automata on Infinite Words

Revision Sheet. (a) Give a regular expression for each of the following languages:

GNFA GNFA GNFA GNFA GNFA

Chapter Five: Nondeterministic Finite Automata. Formal Language, chapter 5, slide 1

CS375: Logic and Theory of Computing

Name Ima Sample ASU ID

NFAs and Regular Expressions. NFA-ε, continued. Recall. Last class: Today: Fun:

Anatomy of a Deterministic Finite Automaton. Deterministic Finite Automata. A machine so simple that you can understand it in less than one minute

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true.

FABER Formal Languages, Automata and Models of Computation

Technische Universität München Winter term 2009/10 I7 Prof. J. Esparza / J. Křetínský / M. Luttenberger 11. Februar Solution

CS103B Handout 18 Winter 2007 February 28, 2007 Finite Automata

Quadratic Forms. Quadratic Forms

CS 330 Formal Methods and Models Dana Richards, George Mason University, Spring 2016 Quiz Solutions

Normal Forms for Context-free Grammars

1.4 Nonregular Languages

CS 330 Formal Methods and Models

Worked out examples Finite Automata

Domino Recognizability of Triangular Picture Languages

Fundamentals of Computer Science

Non-deterministic Finite Automata

CS 373, Spring Solutions to Mock midterm 1 (Based on first midterm in CS 273, Fall 2008.)

Three termination problems. Patrick Dehornoy. Laboratoire de Mathématiques Nicolas Oresme, Université de Caen

Non-deterministic Finite Automata

12.1 Nondeterminism Nondeterministic Finite Automata. a a b ε. CS125 Lecture 12 Fall 2016

CSE : Exam 3-ANSWERS, Spring 2011 Time: 50 minutes

Transcription:

On Rtionl Grphs Christophe Morvn IRISA, Cmpus de Beulieu, 35042 Rennes, Frnce christophe.morvn@iris.fr Astrct. Using rtionlity, like in lnguge theory, we define fmily of infinite grphs. This fmily is strict extension of the context-free grphs of Muller nd Schupp, the equtionl grphs of Courcelle nd the prefix recognizle grphs of Cucl. We give sic properties, s well s n internl nd n externl chrcteriztion of these grphs. We lso show tht their trces form n AFL of recursive lnguges, contining the context-free lnguges. 1 Introduction When deling with computers, infinite grphs re nturl ojects. They emerge nturlly in recursive progrm schemes or communicting utomt, for exmple. Studying them s fmilies of ojects is comprtively recent: Muller nd Schupp (in [MS 85]) first cptured the structure of the grphs of pushdown utomt, then Courcelle (in [Co 90]) defined the set of regulr (equtionl) grphs. More recently Cucl introduced (in [C 96]) chrcteriztion of grphs in terms of inverse (rtionl) sustitution from the complete inry tree. Step y step, like Chomsky s lnguges fmily, hierrchy of grph fmilies is uilt: the grphs of pushdown utomt, regulr grphs nd prefix-recognizle grphs. To define infinite ojects conveniently, we hve to use finite systems. For infinite grphs, two kinds of finite systems re employed: internl systems or externl systems. Roughly speking n internl chrcteriztion is mchine producing the rcs of the grph. An externl chrcteriztion yields the structure of the grph (usully up to isomorphism ). There is, of course reltionship etween internl nd externl chrcteriztion: for exmple the pushdown utomt re n internl chrcteriztion of the connected regulr grphs of finite degree wheres the deterministic grph grmmrs re n externl system for the fmily of regulr grphs. The purpose of this rticle is to give oth internl nd externl chrcteriztion of wider fmily of grphs. Using words for vertices, rtionlity (like in lnguge theory) will provide n internl chrcteriztion; it will lso give sic results for this fmily: for exmple rtionl grphs will e recognized y trnsducers; rtionl grph is recursive set; determinism for rtionl grphs will e decidle. Then inverse sustitution from the complete inry tree (like in [C 96]) will e n externl chrcteriztion of this fmily. Strngely this extension will prove to e slight extension of the prefix-recognizle grphs: insted J. Tiuryn (Ed.): FOSSACS 2000, LNCS 1784, pp. 252 266, 2000. c Springer-Verlg Berlin Heidelerg 2000

On Rtionl Grphs 253 of tking the inverse imge of the complete inry tree y rtionl sustitution we will consider the inverse imge of the complete inry tree y liner sustitution (i.e., sustitution where the imge of ech letter is liner lnguge). Finlly properties of the trces of these grphs will e investigted: we will show tht the trces of these grphs form n strct fmily of (recursive) lnguges contining the context-free lnguges. 2 Rtionl Grphs In this section we will define new fmily of infinite grphs, nmely the set of rtionl grphs. We will stte some results for this fmily nd give exmples of rtionl grphs. 2.1 Prtil Semigroups This prgrph introduces rtionlity for prtil semigroups nd uses this notion to give nturl introduction for rtionl grphs. We strt y reclling some stndrds nottions: for ny set E, its crdinl is denoted y E ; its powerset is denoted y 2 E. Let the set of nonnegtive integers e denoted y N. A semigroup S is set equipped with n opertion : S S S such tht: for ll u, v in S there exists w in S such tht (u, v) =w denoted y u v = w nd this opertion is ssocitive (i.e., u, v, w S, (u v) w = u (v w). Finlly, monoid M is semigroup with (unique) neutrl element (denoted ε long these lines) i.e., n element ε M such tht for ll element u in M u ε = ε u = u. Now, prtil semigroup is set S equipped with : S S S, prtilopertion, with D S S the domin of ; setd need not e S S. Moreover we impose this opertion to e ssocitive s follows: [(u, v) D ((u v),w) D] [(v, w) D (u, (v w)) D]ndinthtcse,u (v w) =(u v) w. Mening tht if multipliction is defined on the one side, then it is defined on the other side nd oth gree. Notice tht prtil semigroup S such tht D is S S is semigroup. Exmple 2.1. Given two semigroups (S 1, 1) nd(s 2, 2) such tht S 1 S 2 is empty. The union S = S 1 S 2, with the prtil opertion defined s 1 over the elements of S 1 nd 2 over the element of S 2, is prtil semigroup. Tking new element we complete ny prtil semigroup S into semigroup S { }y extending its opertion s follows: = for ll, S { }such tht (, ) D. Also the product S S of two prtil semigroups S nd S is prtil semigroup for opertion defined componentwise: (, ) (, )=(, ) for ll (, ) Dnd (, ) D. In order to define the rtionl susets of prtil semigroup, we hve to extend its opertion to its susets: A B := { A B } for every A, B S

254 Christophe Morvn The powerset 2 S of S, is semigroup for so defined. Now, suset P of prtil semigroup S is prtil susemigroup of S, ifp is prtil semigroup for of S i.e., P P is suset of P. For ny suset P of prtil semigroup S, following suset P + = n 1 P n (with P 1 = P nd P n+1 = P n P for every n 1) is the smllest (for inclusion) prtil susemigroup of S contining P.SetP + is clled the prtil semigroup generted y P. In prticulr (P + ) + = P +.Also,S is finitely generted if S = P + for some finite P. AsetP S is code if there is no two fctoriztion in P + of the sme element: u 1 u m = v 1 v n u 1,...,u m,v 1,...,v n P m = n i [1 n],u i = v i A prtil semigroup S is free if there is code P such tht P + = S. For every W 2 S,wedenotey W = { P W, P }. Opertor+ commutes with opertor, i.e., (W + )=( W ) + for every W 2 S. The (left) residul u 1 P of P S y u S is following suset: u 1 P := {v S u v P } nd stisfies following sic equlity: (u v) 1 P = v 1 (u 1 P ) for ll u, v S nd P S. Definition 2.2. Let (S, ) e prtil semigroup. The fmily Rt(S) ofrtionl susets of S is the lest fmily R of susets of S stisfying the following conditions: (i) R; {m} Rfor ll m in S; (ii) if A, B Rthen A B,A B nd A + R. In order to generlize well known results for monoids in the cse of prtil semigroups, nd s our purpose is to del with grphs, we will set some nottions nd definitions for grphs nd utomt. Let P e suset of S. A (simple oriented lelled) P -grph G over V with rcs lelled in P is suset of V P V.Anelement(s,, t) ing is n rc of source s, golt nd lel (s nd t re vertices of G). We denote y Dom(G), Im(G) ndv G the sets respectively of sources, gols nd vertices of G. Ech (s,, t) ofg is identified with lelled trnsition s t or simply s t if G is G understood. A grph G is deterministic if distinct rcs with sme source hve distinct lel: r s r t s = t. A grph is (source) complete if, for every lel, every vertex is source of n rc lelled : P, s V G, t s t. + V P V Set 2 of P + -grphs with vertices in V is semigroup for composition reltion: G H := {r t s, r s s t} for ny G, H V P + V. G H Reltion u denoted y = u or simply = u if G is understood, is the existence G + G of pth in G lelled u in P +. For ny L in S, wedenoteys= L t tht there exists u in L such tht s u = t.

On Rtionl Grphs 255 The trce (or set of pth lels) L(G, E, F )ofg from set E to set F is the following suset of P + : L(G, E, F ) := {u S s E, t F, s u = G t } Given P S, P -utomton A is P -grph G whose vertices re clled sttes, with n initil stte i nd suset F of finl sttes; the utomton recognizes suset L(A) ofp + : L(A) := L(G, {i},f). An utomton is finite (resp. deterministic, complete) if its grph is finite (resp. deterministic, complete). This llows to stte stndrd result for rtionl susets. Proposition 2.3. Given suset P of prtil semigroup S, Rt(P + ) is (i) the smllest suset of 2 S contining nd {} for ech P,ndclosed for,, + (ii) the set of susets recognized y finite P -utomt, (iii) the set of susets recognized y finite nd deterministic P -utomt. We simply trnslted the stndrds definitions of rtionl susets of monoids given for exmple in [Be 79]. An interesting exmple of prtil semigroup is the suject of these lines: the set of rcs (lelled with n element of finite set) etween elements of free monoid is prtil semigroup; its rtionl susets re the rtionl grphs. 2.2 Prtil Semigroups nd Grphs In this section, we will consider n importnt exmple of prtil semigroup: the set of rtionl grphs. So consider n ritrry finite set X nd denote X its ssocited free monoid. We will consider grphs s susets of X A X (the set of grphs over X with rcs lelled in A). For convenience, set 2 X A X is denoted G A (X ). Now, with (u, i,v) i (u, i,v )=(u u, i,v v ), set X { i } X ( i in A) is monoid. As stted in Exmple 2.1 the union of these monoids (nmely X A X ) is prtil semigroup. We denote y the opertion in X A X (which is i for ech X { i } X ). Remrk: this opertion for grphs is indeed, similr to the synchroniztion product for trnsition systems defined y Nivt nd Arnold in [AN 88]. We re now le to define the set of rtionl grphs. Definition 2.4. The set of rtionl grphs, denoted Rt(X A X )isthe fmily of rtionl susets of X A X. Let us now recll tht trnsducer is finite utomton over pirs (see for exmple [Au 88] [Be 79]). A rtionl reltion (i.e., rtionl suset of X X ) is recognized y rtionl trnsducer. There is strong reltionship etween rtionl grphs nd rtionl reltions nd to chrcterize the fmily of rtionl grphs in more prcticl wy we will use lelled trnsducers.

256 Christophe Morvn Definition 2.5. A lelled trnsducer T = Q, I, F, E, L over X, iscomposed of finite set of sttes Q, set of initil sttes I Q, setoffinlsttesf Q, finite set of trnsitions (or edges) E Q X X Q nd n ppliction L from F into 2 A. Like for P -grphs, trnsition (p, u, v, q) of trnsducer T will e denoted y p u/v q T or simply p u/v q if T is understood. Now similrly n element (u, d, v) X A X u 1/v 1 is recognized y trnsducer T if there is pth p 0 T u n/v n p 1 p n 1 T p n nd p 0 I, p n F, u = u 1 u n, v = v 1 v n nd d L(p n ). Remrk: n illustrtion of trnsducer execution will e given in Exmple 2.7. Proposition 2.6. A grph G in G A (X ) is rtionl if nd only if it stisfies one of the following equivlent properties: (i) G elongs to the smllest suset of G A (X ) contining:,{ε d ε},{x d ε} nd {ε d x}, for ll x X, lld A,ndclosed under, nd +; (ii) G is finite union of rtionl reltions over ech letter: G = d A R d,forr d Rt(X {d} X ); (iii) G is recognized y lelled rtionl trnsducer. This Proposition sttes tht for ny grph G in Rt(X A X ), the reltion: d := {(u, v) u d v} is rtionl for ech d in A. Therefore we lso introduce G G := d G d A, which is lso rtionl reltion. Nturlly we denote y G d (u) (resp. (u)) the imge of word u y reltion (resp. )(nd G G G similrly for susets of X). Also for rtionl grph G there re possily mny trnsducers generting it, thus we will denote y Θ(G) the set of trnsducers generting G. We will now give some exmples of rtionl grphs. Exmple 2.7. This grph : ε A A 2 d G B AB A 2 B B 2 AB 2 A 2 B 2 is rtionl grph generted y this trnsducer : A/A ε/a A/A q 1 p ε/b q 2 B/B

On Rtionl Grphs 257 Notice tht its second order mondic theory is undecidle nd therefore rtionl grphs hve n undecidle second order mondic theory. Why does the rc (AB,,AB 2 ) elong to the grph? Simply ecuse the following pth is in the trnsducer: p A/A p ε/b q 2 B/B q 2 nd tht is ssocited to the finl stte q 2. Exmple 2.8. This grph : ε 0 000 00 001 c 1 01 c 11 011 c 111 is rtionl, generted y this trnsducer : 0/0 ε/0 0/0 r 1 1/1 p 0/0 q 1 0/1 0/1 r 2 1/ε 1/ q 2 1/1 r 3 c 1/1 We finish with lst exmple showing tht the trnsition grphs of Petri nets re rtionl grphs. Exmple 2.9. For more detil on Petri nets the reder my refer to [Re 85]. A Petri net cn e seen s finite set of trnsitions of this form: A n1 d 1 An2 2 Anm m A l1 1 Al2 2 Alm m,withax i representing there re x coins in plce A i (d represents the lel (if ny) of the trnsition). Following trnsducer genertes the trnsition grph ssocited to the ove trnsition: A 1 /A 1 A 2 /A 2 A n 1 p 1 /Al 1 1 1 p 2 A n 2 2 /Al 2 A nm 2 m /Alm m q d Ech vertex of the generted grph correspond to mrking of the Petri net. Ech rc of the grph represents tht trnsition hs een fired.

258 Christophe Morvn 2.3 Some Results for Rtionl Grphs This section will introduce results for this fmily of grphs. Some of these results re just reformultion of known results over rtionl reltions. Others re simple fcts on these grphs nd their oundry. The first fct is tht this fmily is n extension of previous fmilies. Simply recll tht every prefix-recognizle grph (defined in [C 96]) is finite union of grphs of the following form : ( U V ) W := { uw vw u U v V w W } with U, V, W rtionl sets. This chrcteriztion ensures tht prefix-recognizle grphs re rtionl grphs. As the regulr grphs (defined in [Co 90]) re prefix-recognizle grphs, theyre rtionl too. Furthermore, the grphs in Exmples 2.7 nd 2.8 re not prefixrecognizle grphs thus the inclusion is strict. Let us now trnslte some wellknown results for rtionl reltions, to rtionl grphs (the proofs will e omitted they re mostly direct consequences of results found in [Au 88] nd [Be 79]). Proposition 2.10. A rtionl grph G is of finite out-degree if nd only if there exists trnsducer T Θ(G) such tht there exists no cycle in T lelled on the left with the empty word which is not lelled on the right with the empty word. In other words the only cycles lelled on the left ε, re lelled on the right ε. Remrk: nturlly this proposition cn e trnslted to chrcterize the grphs of finite in-degree, y simply replcing right y left nd vice-vers. Proposition 2.11. Every rtionl grph is recursive: it is decidle whether n rc (u, d, v) elongs to rtionl grph. Theorem 2.12. It is decidle whether rtionl grph is deterministic (from its trnsducer). Proposition 2.13. The inclusion nd equlity of deterministic rtionl grphs is decidle. Remrk: unfortuntely this result ceses to e true for generl rtionl grphs ([Be 79] Theorem 8.4, pge 90). We hve lredy seen tht the second order mondic theory of these grphs is undecidle in generl. We will now see tht it is lso the cse for the first order theory. Proposition 2.14. The first order theory of rtionl grphs is undecidle. Proof. We will prove this proposition y reducing Post s correspondence prolem (P.C.P.) to this prolem. Let us recll the P.C.P.: given n lphet X nd (u 0,v 0 ), (u 1,v 1 ),..., (u n,v n )elementsofx X. Does there exist sequence 0 6 i 1,i 2,...,i m 6 n, such tht u 0 u i1 u im = v 0 v i1 v im? To n instnce of P.C.P. (i.e. fmily (u i,v i )) we ssocite following trnsducer:

On Rtionl Grphs 259 u i /v i (for i [1 n]) p u 0 /v 0 q The resolution of P.C.P. ecomes finding vertex s such tht s s is n rc of the grph generted y the trnsducer. It is first order instnce, therefore,s P.C.P. is undecidle, the first order theory of rtionl grphs is not decidle in generl. Before giving nother negtive decision result, let us denote y ũ the mirror of word u (defined y induction on the length of u: ε = ε nd ãu =ũ (for ny u with u 0). Proposition 2.15. Accessiility is not decidle for rtionl grphs in generl. Proof. Once gin, we use P.C.P. Using the sme nottions s erlier define (word) rewriting system G, using two new symols # nd $, in the following wy: $ u i $ṽ i i {0,,n} G $ # A#A # A X Now P.C.P. hs solution is equivlent to the existence of derivtion from u 0 $ṽ 0 to #. But, considering the following trnsducer: A/A(for A X) A/A(for A X) $/# p $/u i $ṽ i (for i {0,,n}) A#A/#(for A X) q the question ecomes: is there pth leding from u 0 $ṽ 0 to the vertex #? Answering the lst question would llow P.C.P. to e solved in the generl cse which is contrdiction. Therefore ccessiility is undecidle for the rtionl grphs in generl. Remrk: the trnsitive closure of rtionl grph is, t lest, uneffective. If this construction were effective nd rtionl, then ccessiility for rtionl grph would e decidle. Now we will see cse where ccessiility is decidle for rtionl grphs. A trnsducer T is incresing if every pir (u, v) recognized y T is such tht the length of v (denoted y v ) is greter or equl to the length of u : v u. Proposition 2.16. The ccessiility is decidle for ny rtionl grph with n incresing trnsducer. Proof. Let us denote y T 6n (u) following set: T 6n (u) := n i=0 T i (u). For ll n N this set is rtionl. Now, let G e rtionl grph generted y n incresing trnsducer T nd let u nd v e two vertices of G. Let us put n 0 = {w X u 6 w 6 v } = X u + + X v.vertexv is ccessile from u if nd only if v elongs to T 6n0 (u). Thus ccessiility is decidle for rtionl grphs with n incresing trnsducer.

260 Christophe Morvn We now give technicl Lemm tht llows the construction of grph tht is not structurlly rtionl. Lemm 2.17. Let G e rtionl grph of finite out-degree. There exists two integers p nd q such tht for every (s,, t) G we hve t 6 p. s + q Exmple 2.18. Consider n infinite tree in X A X such tht every vertex of depth n hs 2 22n sons. This tree is not strucurlly rtionl, in other words whtever nme re given to its vertices this grph is never rtionl grph. This is direct consequence of previous lemm: sy n is the length of the root, there re t most X (npl +p l 1 q+ +q) vertices of depth l. Despite these results the trnsducers re not le to cpture the structure of rtionl grphs. For exmple, this trnsducer: A/A B/B p ε/ab q genertes this grph: ε A AB A 2 B 2 A 3 B 3 A 2 B A 3 B 2 A 4 B 3 B AB 2 A 2 B 3 A 3 B 4 The connected component of the empty word, ε, is stright-line. It is up to isomorphism oviously rtionl, ut s su-grph of this grph, it is not rtionl (its vertices form context-free lnguge). Therefore we need n externl ( up to isomorphism ) chrcteriztion of these grphs. This is the suject of the next section. 3 An Externl Chrcteriztion In this section, we will chrcterize rtionl grphs using inverse liner sustitutions. Lelled trnsducers re n internl representtion of rtionl grphs, it clerly depends on the nme of the vertices. But often in grph theory, the nme of the vertices is not relevnt, it crries no informtion. An externl chrcteriztion, like the grph grmmrs for equtionl grphs, produces grphs without giving nmes for vertices. It only gives the structure of the grph. Inverse liner sustitution is n externl chrcteriztion of rtionl grphs. 3.1 Grph Isomorphism An externl chrcteriztion of rtionl grphs is given up to isomorphism. Two grphs G 1 nd G 2 in G A (X ) re isomorphic, if there is ijection ψ : d V (G 1 ) V (G 2 ) such tht: s 1 s 2 (i.e., (s 1,d,s 2 ) G 1 ) if nd only if d ψ(s 1 ) ψ(s 2 ). G2 G1

On Rtionl Grphs 261 Two isomorphic grphs hve the sme structure: they re the sme up to renming of the vertices. Now let us consider the equivlence ( ) generted y grph isomorphism: we sy tht G 1 is equivlent to G 2 (denoted G 1 G 2 )ifg 1 nd G 2 re isomorphic. This equivlence reltion provides us with prtition of G A (X ) denoted Grph A := G A (X )/. This llows the introduction of the set of structurl rtionl grphs: GRt A := {[G] Grph A G Rt(X A X )} This set is the set of grphs tht re isomorphic to some rtionl grph. Set Grph A (nd GRt A ) does not depend on the choice of set X, thereforewe cn choose X to e ny two letters lphet with no loss of generlity. Lemm 3.1. For ll suset X (with t lest two elements) of X nd ll clss [G] of Grph A (= G A (X )/ ) thereexistsg 0 in G A (X ) such tht G 0 [G]. We now hve to chrcterize the structure of GRt A. This is the gol of the next section. 3.2 Sustitution Recll the definition of the prefix-recognizle grphs (fmily REC Rt ). This fmily hs een defined s the set of grphs otined from the complete inry tree y inverse rtionl sustitution, followed y rtionl restriction. We will use the sme process (ctully liner context-free sustitution) to otin the fmily of rtionl grphs. A sustitution over free monoid X is morphism ϕ : A 2 X,which ssocites to ech letter in A lnguge in X. Our purpose is to study grphs, strting from the complete inry tree (Λ) lelled X = {A, B}. Tomovey inverse rcs, we use new lphet : X = {A, B} nd we sy tht x A y if y A x. Given lnguge L nd two vertices x nd y, recll tht x = L y u Λ L, x = u y. Now, given sustitution ϕ : A 2 (X X), we cn define the grph Λ ϕ 1 (Λ) in the following wy: ϕ 1 (Λ) ={x d y d A x = ϕ(d) y} Λ Given lnguge L, we define now L Λ = {s r = L s}. It llows us to consider Λ the grph ϕ 1 (Λ) LΛ : it is the imge of the complete inry tree y n inverse sustitution followed y restriction; if L is rtionl, we sy rtionl restriction. Exmple 3.2. Exmple 2.7 sttes tht the grid is rtionl grph. Following sustitution: h() ={B m AB m m 0}, h() ={B} over the complete inry tree on {A, B}, followed with the restriction to L = A B produces grph isomorphic to the grid:

262 Christophe Morvn A B Now, it is well know tht there is close reltionship etween liner lnguges nd rtionl reltions ( liner lnguge is context-free lnguge generted y grmmr with only, t most, one non-terminl on the right hnd side of ech rule). And indeed, if we denote the set of liner lnguges over the lphet X X y Lin(X X), we hve the following proposition. Proposition 3.3. The set GRt A is suset of the fmily of the grphs otined from the complete inry tree (Λ) y n inverse liner sustitution, followed y rtionl restriction: GRt A {[ϕ 1 (Λ) LΛ ] d A,ϕ(d) Lin(X X) L Rt(X)} Proof (Sketch). We first trnsform the trnsducer generting the grph (G) so tht ech vertex egins with the sme prefix. Then we produce liner lnguges (L d ) such tht (u, d, v) X A X is n rc of G if nd only if ũv L d.we then define ϕ(d) toel d. It only remins to define L (the rtionl restriction) to e L := Dom(G) Im(G) The converse of this result would help us to gr the structure of rtionl grphs. Unfortuntely it is not ovious. Actully the following exmple illustrte the difficulty of the nive converse of Proposition 3.3. Exmple 3.4. Consider ϕ() ={BBA n B n n N}, it is liner sustitution. Consider L = BA B nd the grph G = ϕ 1 (Λ) LΛ. Structurlly, grph G is rtionl (it is the str). But the grph nturlly ssocited to G (ccording to ϕ() ndl) isg = {(B,,BA n B n ) n N}, which is not rtionl. So there is deep isomorphism prolem to get the converse. Actully, we will try to inject rtionlity in the liner lnguge to chieve complete chrcteriztion of rtionl grphs. A nturl wy to introduce rtionlity into Lin(X X) would e to impose the projections over rred nd non-rred letters to e rtionl. The next exmple shows tht gin, things re not so nice. Exmple 3.5. Consider ϕ() ={A BBA n B m n m} {BBA n B m m>n} ϕ is liner sustitution. Moreover it hs rtionl projections over rred nd non-rred letters. Consider L = BA B nd the grph G = ϕ 1 (Λ) LΛ.

On Rtionl Grphs 263 Structurlly, grph G is rtionl (it is two strs). But the grph nturlly ssocited to G (ccording to ϕ() ndl) isg = {(BA,,BA n B m ) n m} {(B,,BA n B m ) m>n}, which is not rtionl (its intersection with the recognizle set {BA} {} BA B is {(BA,,BA n B m ) n m} which is not rtionl). Now consider the set Rtlin(X X) of liner lnguges (clled rtionlliner) over (X X) such tht the production of their grmmrs re of following form: p uqv (with u X nd v X )orp ε. Theorem 3.6. Set GRt A is precisely the set of grphs otined from the complete inry tree (Λ) y rtionl-liner sustitution, followed y rtionl restriction : GRt A = {[ϕ 1 (Λ) LΛ ] d A,ϕ(d) Rtlin(X X) L Rt(X)} Proof (Sketch). The first inclusion is treted in Proposition 3.3. For the reverse inclusion we first tke grph G imge of rtionl-liner sustitution, followed y rtionl restriction then we need to check tht it is possile to produce trnsducer from the grmmrs of ϕ(d) forechd. Then we show tht this grph contins G, finlly, using rtionl intersection we otin precisely G. Now tht n externl chrcteriztion of the rtionl grphs hs een given, the next section will consider the properties of the trces of rtionl grphs. 4 The Trces of Rtionl Grphs We hve lredy seen tht there is strong connection etween lnguge theory nd rtionl grphs. In this section we will see nother connection etween grphs nd lnguges, in terms of trces. We first recll tht the trce of grph G leding from vertex set I (of initil sttes) to vertex set F (of finl sttes) is the set of ll the pth lels in the grph, leding from vertex in the set of initil sttes to vertex in the set of finl sttes: L(G, I, F ):={u s I t F, s u = G t} In other words the trce of grph is the lnguge of its lels. For exmple the trces of the finite grphs re ll rtionl lnguges nd the trces of prefixrecognizle grphs re ll context-free lnguges. Notice y the wy tht the trces of rtionl grphs contin therefore every context free lnguge. Proposition 4.1. The trces of rtionl grph leding from rtionl vertex set to context free vertex set (or vice-vers) is recursive

264 Christophe Morvn Proof. In order to check whether word u is in the trce of grph G (from set I tosetf ), it is just to check if the set S = u( u ) ( u( u 1) ( u(1) (I) )) G G G intersects set F.IfsetI is rtionl (resp. context-free) its imge y rtionl trnsduction is rtionl (resp. context-free), hence y simple induction, set S is rtionl (resp. context-free). Therefore it is decidle whether S F is empty. Let us denote y TR the fmily of the trces of rtionl grphs leding from rtionl vertex set to rtionl vertex set: TR = {L(G, I, F ) G Rt(X A X ) I,F Rt(X )} (notice tht we could s well restrict ourselves to unique initil stte nd unique finl stte). Now we will show tht set TR form n Astrct Fmily of Lnguges (AFL), tht is, it stisfies following properties: closure for intersection with rtionl (regulr) lnguge, closure under non-ersing (monoid)morphism, nd inverse morphism, for ech L, L TR we hve L L,L L,L +,L TR. Proposition 4.2. The intersection of two elements of TR is n element of TR. Proof. Consider two elements L nd L of TR. SyL = L(G, I, F )ndl = L(G,I,F). The lnguge L L is ctully the trce of G ({$} A {$}) G (with $ new symol) etween I G {$} I G nd F G {$} F G. Hence L L in n element of TR. As rtionl lnguges re trces of rtionl grphs (finite grphs re rtionl grphs), fmily TR is closed under intersection with rtionl lnguges. Now let us recll tht finite (resp. rtionl) sustitution σ : A 2 A is morphism such tht for ech letter d in A σ(d) is finite (resp. rtionl) suset of A. A sustitution is non-ersing if ε σ(d) for ll d A. Proposition 4.3. Fmily TR is closed under non-ersing finite sustitution. Proof (Sketch). Consider σ non-ersing finite sustitution, nd L lnguge in TR. We tke grph G such tht L = L(G, I, F ), nd T trnsducer generting G. We, then, construct new trnsducer such tht ech production d in T is replced y pth u (in the corresponding grph), for ech u σ(d). The trce of the grph generted y this trnsducer is σ(l) Following corollry is direct consequence of this proposition. Corollry 4.4. Fmily TR is closed under non-ersing morphism. Notice tht the condition non-ersing is essentil for our proof. A interesting question is whether this condition is necessry. Proposition 4.5. Assume tht L is n element of TR nd tht σ is finite sustitution over A then σ 1 (L) is lnguge of TR.

On Rtionl Grphs 265 Proof (Sketch). This proposition is consequence of Elgot nd Mezei s theorem, which sttes tht the composition of two rtionl reltions is rtionl reltion (see for exmple [Be 79], Theorem 4.4 p 68). Using this we cn produce rtionl grph in which finite numer of finite pth re replced y rcs. Which proves the Proposition. Remrk: Note tht it is not s strightforwrd for inverse rtionl sustitution. Actully it seems tht it is not true for inverse rtionl sustitution: consider ny rtionl grph with one lel () nd the inverse rtionl sustitution σ() =. The grph imge with the sme pproch would e the trnsitive closure of the originl grph, which is not effectively rtionl (nd might not even e structurlly rtionl) s stted in the remrk fter Proposition 2.15. Following corollry is n ovious consequence of proposition 4.5. Corollry 4.6. Fmily TR is closed under inverse morphism. Proposition 4.7. Fmily TR is closed under conctention, Kleene plus nd str. Proof (Sketch). The rgument is more or less the sme s for finite utomt. We use opertion over rtionl reltions to get the results. As stted erlier, we only hve now to summry these results. Theorem 4.8. The trces of rtionl grphs, leding from rtionl vertex set to rtionl vertex set, form n AFL ( Astrct Fmily of Lnguges). Proof. This result is simply rief summry of corollries 4.4, 4.6 nd propositions 4.2 nd 4.7. Now we hve n strct fmily of lnguges tht contins the context free lnguges. This AFL is suset of the recursive lnguges. It seems tht this fmily is composed of the context sensitive lnguges. Conjecture 4.9. The trces of the rtionl grphs re precisely the context sensitives lnguges. Notice lso tht recently grphs of liner ounded mchines (which chrcterize context sensitive lnguges) hve een studied in [KP 99]. 5 Conclusion In this pper, generl fmily of grphs hs een introduced. Rtionl grphs re strict extension of previously studied fmilies. It is well grounded fmily, relted to well known structures of lnguge theory. We hve given oth n internl nd n externl chrcteriztion, s well s some sic properties. Unfortuntely, or fortuntely depending on the point of view, it is very expressive fmily. Therefore mny decision results re lost. An interesting question

266 Christophe Morvn is to study restrictions of this fmily tht will retin decision results from former fmilies. Trces of rtionl grphs re nother spect of this fmily. We hve shown tht it forms n strct fmily of recursive lnguges. An interesting question is to know if these trces re precisely the context sensitive lnguges. Rtionl trees lso seem to e n interesting field of reserch, ut this hs not een done yet. Acknowledgements The uthor would like to express his grtitude to Didier Cucl for his help long the preprtion of this pper. References [AN 88] A. Arnold nd M. Nivt, Comportements de processus, Colloque AFCET les mthémtiques de l informtique, pp. 35 68, 1982. [Au 88] J.-M. Auteert nd L. Bosson, Trnsductions rtionelles, Ed.Msson, pp. 1 133, 1988. [Be 79] J. Berstel Trnsductions nd context-free lnguges, Ed. Teuner, pp. 1 278, 1979. [C 96] D. Cucl On trnsition grphs hving decidle mondic theory, LNCS 1099, pp. 194 205, 1996, [Co 90] B. Courcelle Grph rewriting: n lgeric nd logic pproch, Hndook of TCS, Vol. B, Elsevier, pp. 193 242, 1990. [GG 66] S. Ginsurg nd S. A. Greich Mppings which preserve context sensitive lnguges, Informtion nd Control 9, pp. 563 582, 1966. [HU 79] J. E. Hopcroft nd J. D. Ullmn Introduction to utomt theory, lngges nd computtion, Ed. Addison-Wesley pp. 1 284, 1979. [KP 99] T. Knpik nd E. Pyet Synchroniztion product of Liner Bounded Mchines, LNCS 1684, pp. 362 373, 1999. [MS 85] D. Muller nd P. Schupp The theory of ends, pushdown utomt, nd second-order logic, TCS 37, pp. 51 75, 1985. [Ni 68] M. Nivt Trnsduction des lngges de Chomsky, Ann. de l Inst. Fourier 18, pp. 339-456, 1968. [Re 85] W. Reisig Petri nets. EATCS Monogrphs on Theoreticl Computer Science, Vol. 4, Springer Verlg, 1985. [Sc 76] M.P. Schützenerger Sur les reltions rtionnelles entre monoïdes lires, TCS 3, pp. 243 259, 1976.