P UBLICATIONS DU D ÉPARTEMENT DE MATHÉMATIQUES DE L YON
B. C OURCELLE
Algebraic and Regular Trees
Publications du Département de Mathématiques de Lyon, 1985, fascicule 2B
« Compte rendu des journées infinitistes », , p. 91-95
< http://www.numdam.org/item?id=PDML_1985___2B_91_0 >
© Université de Lyon, 1985, tous droits réservés.
L’accès aux archives de la série « Publications du Département de mathématiques de Lyon » im- plique l’accord avec les conditions générales d’utilisation ( http://www.numdam.org/conditions ).
Toute utilisation commerciale ou impression systématique est constitutive d’une infraction pé- nale. Toute copie ou impression de ce fichier doit contenir la présente mention de copyright.
Article numérisé dans le cadre du programme
Numérisation de documents anciens mathématiques
A L G E B R A I C AND REGULAR TREES by B. COURCELLE
T/ie luctu/ie. iA)CL6 bat>dd on thz hoULowinQ two pubtuhad papz^u ofa which I tiojptioduLCZ beJtow the Znfrio duetto nA and &j>ts ofa tiQLhoAancLQA.
T h e o r e t i c a l C o m p u t e r S c i e n c e 2 5 ( 1 9 8 3 ) 9 5 - 1 6 9 N o r t h - H o l l a n d P u b l i s h i n g C o m p a n y
F U N D A M E N T A L P R O P E R T I E S O F I N F I N I T E T R E E S
B r u n o C O U R C E L L E
VER de Mathématiques et Informatique, Université Bordeaux-Ï, 33405 Talence. France
Introduction
Infinite trees naturally arise in mathematical investigations on the semantics of p r o g r a m m i n g languages. T h e y arise in essentially two ways: when o n e unloops or unfolds a p r o g r a m undefinitely. O n e obtains then either a tree of execution paths (infinite in genera!) in the case of a p r o g r a m written in an imperative language like F O R T R A N or an expression tree in the case of a p r o g r a m written in an applicative language like LISP. In the latter case, the expression tree is usually infinite although its value can be finitely c o m p u t e d in each case; this is possible by the use of if-then-else as a base function (like the addition of integers) and not as a piece of control s t r u c t u r e . O n c e again, the infiniteness of the tree c o r r e s p o n d s to the infiniteness of the set of possible c o m p u t a t i o n s .
In both cases, the semantics of the program is completely defined by the associated tree. H e n c e two p r o g r a m s are equivalent if the associated trees are the same (the converse being not true). Roughly speaking, this allows to distinguish between the equivalence of p r o g r a m s which is only due to the control structure (loops, recursive calls, etc. . . .) from the equivalence which also d e p e n d s on the p r o p e r t i e s of the d o m a i n s of c o m p u t a t i o n and the given base' functions on these d o m a i n s .
It should be n o t e d that these infinite tiees are finitely defined. H e n c e we are lead to try to decide w h e t h e r two infinite trees defined in some finitary way are equal.
91
T w o types of infinite trees will be considered: the regular trees which are defined by unlooping F O R T R A N - l i k e p r o g r a m or flowcharts and the algebraic trees which are defined by unfolding recursive program schemes m o r e or less derived from LISP p r o g r a m s .
W e shall introduce o p e r a t i o n s on trees: the first-order substitution which corre- sponds (roughly) t o the sequential composition of flowcharts (by the o p e r a t o r ; of A L G O L ) or to functional application (in the case of an applicative language). We shall also introduce t h e second-order substitution which c o r r e s p o n d s to the replace- ment of a function symbol in an expression tree by some expression tree intended to d e n o t e the c o r r e s p o n d i n g function.
H e r e is a brief survey of the content of the p a p e r which is i n t e n d e d to be a synthesis of several aspects of infinite trees usually defined and studied separately for different p u r p o s e s :
(1) Topological (i.e. metric) and order-theoretical properties of infinite trees are investigated in parallel in o r d e r to enlighten similarities and differences.
(2) First- and second-order substitutions are investigated in the two above frameworks.
(3) Regular trees, rational expressions defining them are studied. T h e concept of an iterative theory, d u e to C . C . Elgot, is one of the possible algebraic frameworks where to study infinite t r e e s : the set of regular trees forms the free iterative theory.
Regular trees also arise as most general first-order unifiers in a generalized sense.
(4) Algebraic trees play a similar role with respect to s e c o n d - o r d e r substitutions as regular trees with respect to first-order ones. Their combinatorial p r o p e r t i e s are sufficiently complicated to yield an open problem equivalent to the D P D A equivalence p r o b l e m .
References
[ 1 ] A . A r n o l d a n d M . D a u c h e t , T h é o r i e d e s m a g m o ï d e s , RAIRO Inform. Théor. 12 ( 1 9 7 8 ) 2 3 5 - 2 5 7 . [ 2 ] A . A r n o l d a n d M . N i v a t , M e t r i c i n t e r p r e t a t i o n s of infinite t r e e s a n d s e m a n t i c s of n o n d e t e r m i n i s t i c
r e c u r s i v e p r o g r a m s , Theoret. Comput, Sci. 11 ( 1 9 8 0 ) 1 8 1 - 2 0 5 .
[ 3 ] A . A r n o l d a n d M . N i v a t , T h e m e t r i c s p a c e of infinite t r e e s . A l g e b r a i c a n d t o p o l o g i c a l p r o p e r t i e s , Fund. Inform. III.4 ( 1 9 8 0 ) 4 4 5 - 4 7 6 .
[ 4 ] H . B e k i c , D e f i n a b l e o p e r a t i o n s in g e n e r a l a l g e b r a s , a n d t h e t h e o r y of a u t o m a t a a n d f l o w c h a r t s , U n p u b l i s h e d w o r k , I B M L a b o r a t o r y , V i e n n a ( 1 9 6 9 ) .
[ 5 ] S. B l o o m , All s o l u t i o n s of a s y s t e m of r e c u r s i o n e q u a t i o n s in infinite t r e e s a n d o t h e r c o n t r a c t i o n t h e o r i e s , J. Comput. System Sci., t o a p p e a r .
[ 6 ] S. B l o o m a n d C . E l g o t , T h e e x i s t e n c e a n d c o n s t r u c t i o n of free i t e r a t i v e t h e o r i e s , J. Comput. System Sci. 1 2 ( 1 9 7 6 ) 3 0 5 - 3 1 8 .
[ 7 ] S. B l o o m , C . E l g o t a n d J. W r i g h t , S o l u t i o n s of t h e i t e r a t i o n e q u a t i o n a n d e x t e n s i o n s of t h e s c a l a r i t e r a t i o n o p e r a t i o n , SIAM J. Comput. 9 ( 1 9 8 0 ) 2 5 - 4 5 .
[ 8 ] S. B l o o m , S. G i n a l i a n d J. R u t l e d g e , S c a l a r a n d v e c t o r i t e r a t i o n , J. Comput. System Sci. 1 4 ( 1 9 7 7 ) 2 5 1 - 2 5 6 .
[ 9 ] S. B l o o m a n d D . P a t t e r s o n , E a s y s o l u t i o n s a r e h a r d t o find, Proc. 6th Colloquium on Trees in Algebra and P r o g r a m m i n g , L e c t u r e N o t e s in C o m p u t e r S c i e n c e 1 1 2 ( S p r i n g e r , B e r l i n , 1 9 8 1 ) 1 3 5 - 1 4 6 .
[ 1 0 ] S. B l o o m a n d R . T i n d e l l , C o m p a t i b l e o r d e r i n g s o n t h e m e t r i c t h e o r y of t r e e s , SIAM J. Comput.
9 ( 1 9 8 0 ) 6 8 3 - 6 9 1 .
[ 1 1 ] S. B l o o m a n d R . T i n d e l l , V a r i e t i e s of i f - t h e n - e l s e , S u b m i t t e d for p u b l i c a t i o n ( 1 9 8 1 ) .
[ 1 2 ] R . B o o k , T h e u n d e c i d a b i l i t y of a w o r d p r o b l e m : o n a c o n j e c t u r e of S t r o n g , M a g g i o l o - S c h e t t i n i a n d R o s e n , Inform. Process Lett. 1 2 ( 1 9 8 1 ) 1 2 1 - 1 2 2 .
[ 1 3 ] P. C a s t e r a n , S t r u c t u r e s d e c o n t r ô l e : définitions o p é r a t i o n n e l l e s et a l g é b r i q u e s , T h è s e d e 3 è m e cycle, U n i v e r s i t y P a r i s - 7 ( 1 9 7 9 ) .
[ 1 4 ] B . C o u r c e l l e , O n j u m p - d e t e r m i n i s t i c p u s h d o w n a u t o m a t a , Math. Systems Theory 11 ( 1 9 7 7 ) 8 7 - 1 0 9 . [ 1 5 ] B . C o u r c e l l e , A r e p r e s e n t a t i o n of t r e e s by l a n g u a g e s , Theoret. Comput. Sci. 6 ( 1 9 7 8 ) 2 5 5 - 2 7 9 a n d
7 ( 1 9 7 8 ) 2 5 - 5 5 .
[ 1 6 ] B . C o u r c e l l e , F r o n t i e r s of infinite t r e e s , RAIRO Inform. Théor. 1 2 ( 1 9 7 8 ) 3 1 9 - 3 3 7 . [ 1 7 ] B . C o u r c e l l e , A r b r e s infinis et s y s t è m e s d ' é q u a t i o n s , RAIRO Inform. Théor. 1 3 ( 1 9 7 9 ) 3 1 - 4 8 . [ 1 8 ] B . C o u r c e l l e , Infinite t r e e s in n o r m a l f o r m a n d r e c u r s i v e e q u a t i o n s h a v i n g a u n i q u e s o l u t i o n , Math.
Systems Theory 1 3 ( 1 9 7 9 ) 1 3 1 - 1 8 0 .
[ 1 9 ] B . C o u r c e l l e , A n a x i o m a t i c a p p r o a c h t o t h e K o r e n j a k - H o p c r o f t a l g o r i t h m s , Math. Systems Theory, t o a p p e a r .
[ 2 0 ] B . C o u r c e l l e , W o r k in p r e p a r a t i o n .
[ 2 1 ] B . C o u r c e l l e a n d P . F r a n c h i - Z a n n e t t a c c i , O n t h e e q u i v a l e n c e p r o b l e m for a t t r i b u t e s y s t e m s , Information and Control, t o a p p e a r .
[ 2 2 ] B . C o u r c e l l e a n d I. G u e s s a r i a n , O n s o m e classes of i n t e r p r e t a t i o n s , J. Comput. System Sci. 1 7 ( 1 9 7 8 ) 3 8 8 - 4 1 3 .
[ 2 3 ] B . C o u r c e l l e , G . K a h n a n d J. V u i l l e m i n , A l g o r i t h m e s d ' é q u i v a l e n c e et d e r é d u c t i o n à d e s e x p r e s s i o n s m i n i m a l e s , d a n s u n e classe d ' é q u a t i o n s r é c u r s i v e s s i m p l e s , Prac. 2nd International Colloquium on Automata, Languages and Programming, L e c t u r e N o t e s in C o m p u t e r S c i e n c e 1 4 ( S p r i n g e r , B e r l i n , 1 9 7 4 ) 2 0 0 - 2 1 3 .
[ 2 4 ] B . C o u r c e l l e a n d M . N i v a t , A l g e b r a i c families of i n t e r p r e t a t i o n s , Proc. Annual Symposium on Foundations of Computer Science, H o u s t o n , T X ( 1 9 7 6 ) 1 3 7 - 1 4 6 .
[ 2 5 ] B . C o u r c e l l e a n d M . N i v a t , T h e a l g e b r a i c s e m a n t i c s of r e c u r s i v e p r o g r a m s c h e m e s , in : Mathematical Foundations of Computer Science 78, L e c t u r e N o t e s in C o m p u t e r S c i e n c e 6 4 ( S p r i n g e r , B e r l i n 1 9 7 8 ) 1 6 - 3 0 .
[ 2 6 ] B . C o u r c e l l e a n d J . C . R a o u l t , C o m p l e t i o n s of o r d e r e d m a g m a s , Fund. Inform. III.1 ( 1 9 8 0 ) 1 0 5 - 1 1 6 . [ 2 7 ] B . C o u r c e l l e a n d J. V u i l l e m i n , C o m p l e t e n e s s results for t h e e q u i v a l e n c e of r e c u r s i v e s c h e m e s , J.
Comput. System Sci. 1 2 ( 1 9 7 6 ) 1 7 9 - 1 9 7 .
[ 2 8 ] G . C o u s i n e a u , L a p r o g r a m m a t i o n en E X E L , Rev. Tech. Thomson-CSF 10 ( 1 9 7 8 ) 2 0 9 - 2 3 4 a n d 11 ( 1 9 7 9 ) 1 3 - 3 5 .
[ 2 9 ] G . C o u s i n e a u , A n a l g e b r a i c definition for c o n t r o l s t r u c t u r e s , Theoret. Comput. Sci. 1 2 ( 1 9 8 0 , 1 7 5 - 1 9 2 .
[ 3 0 ] W . D a m m , T h e I O - a n d O I - h i c r a r c h i e s , Theoret. Comput. Sci. 2 0 ( 1 9 8 2 ) 9 5 - 2 0 7 .
[ 3 1 ] W . D a m m , E . F e h r a n d K. I n d e r m a r k , H i g h e r t y p e r e c u r s i o n a n d s e l f - a p p l i c a t i o n as c o n t r o l s t r u c t u r e s , in : E . N e u h o l d , E d . , Formal Descriptions of Programming Concepts ( N o r t h - H o l l a n d , A m s t e r d a m , 1 9 7 8 ) 4 6 1 - 4 8 7 .
[ 3 2 ] C . E l g o t , M o n a d i c c o m p u t a t i o n a n d i t e r a t i v e a l g e b r a i c t h e o r i e s , in : H . E . R o s e , E d . , Logic Col- loquium 7 3 ( N o r t h - H o l l a n d , A m s t e r d a m , 1975) 1 7 5 - 2 3 0 .
[ 3 3 ] C . E l g o t , S t r u c t u r e d p r o g r a m m i n g with a n d w i t h o u t G O T O s t a t e m e n t s , IEEE Trans. Software Engrg. 2 ( 1 9 7 6 ) 4 1 - 5 4 .
[ 3 4 ] C . E l g o t , S. B l o o m a n d R. T i n d e l l , T h e a l g e b r a i c s t r u c t u r e of r o o t e d t r e e s , J. Comput. System Sci.
1 6 ( 1 9 7 8 ) 3 6 2 - 3 9 9 .
[ 3 5 ] J. E n g e l f r i e t a n d E . S c h m i d t , I O a n d O I , J. Comput. System Sci. 15 ( 1 9 7 7 ) 3 2 8 - 3 6 1 a n d 1 6 ( 1 9 7 8 ) 6 7 - 9 9 .
[ 3 6 ] P. E n j a l b e r t , S y s t è m e s d e d é d u c t i o n s p o u r les a r b r e s et les s c h é m a s d e p r o g r a m m e s , RAIRO Inform. Théor. 1 4 ( 1 9 8 0 ) 2 4 7 - 2 7 8 a n d 15 ( 1 9 8 1 ) 3 - 2 1 .
[ 3 7 ] J. G a l l i e r , D P D A ' s in a t o m i c n o r m a l form a n d a p p l i c a t i o n s t o t h e e q u i v a l e n c e p r o b l e m s , Theoret.
Comput. Sci. 1 4 ( 1 9 8 1 ) 1 5 5 - 1 8 6 .
[ 3 8 ] J. G a l l i e r , R e c u r s i o n c l o s e d a l g e b r a i c t h e o r i e s , J. Comput. System Sci., t o a p p e a r .
[ 3 9 ] J. G a l l i e r , N-rational a l g e b r a s , I : B a s i c P r o p e r t i e s a n d free a l g e b r a s , II : V a r i e t i e s a n d t h e logic of i n e q u a l i t i e s , S u b m i t t e d for p u b l i c a t i o n .
[ 4 0 ] S. G i n a l i , R e g u l a r t r e e s a n d t h e free i t e r a t i v e t h e o r y , J. Comput. System Sci. 1 8 ( 1 9 7 9 ) 2 2 8 - 2 4 2 . [ 4 1 ] J. G o g u e n , J. T h a t c h e r . E . W a g n e r a n d J. W r i g h t , Initial a l g e b r a s e m a n t i c s a n d c o n t i n u o u s
a l g e b r a s , J. ACM 2 4 ( 1 9 7 7 ) 6 8 - 9 5 .
[ 4 2 ] S. G o r n , E x p l i c i t definitions a n d linguistic d o m i n o e s , in : J. H a r t a n d S. T a k a s u , E d s . , Systems and Computer Science ( U n i v e r s i t y of T o r o n t o P r e s s , 1 9 6 7 ) 7 7 - 1 0 5 .
[ 4 3 ] I. G u e s s a r i a n , P r o g r a m t r a n s f o r m a t i o n s a n d a l g e b r a i c s e m a n t i c s , Theoret. Comput. Sci. 9 ( 1 9 7 9 ) 3 9 - 6 5 .
[ 4 4 ] I. G u e s s a r i a n , Algebraic Semantics, L e c t u r e N o t e s in C o m p u t e r S c i e n c e 9 9 ( S p r i n g e r , B e r l i n , 1 9 8 1 ) . [ 4 5 ] M . H a r r i s o n , Introduction to Formal Language Theory ( A d d i s o n - W e s l e y , R e a d i n g , M A , 1 9 7 8 ) . [ 4 6 ] M . H a r r i s o n , I. H a v e l a n d A . Y e h u d a i , O n e q u i v a l e n c e of g r a m m a r s t h r o u g h t r a n s f o r m a t i o n t r e e s ,
Theoret. Comput. Sci. 9 ( 1 9 7 9 ) 1 7 3 - 2 0 5 .
[ 4 7 ] S. H e i l b r u n n e r , A n a l g o r i t h m for t h e s o l u t i o n of fixed-point e q u a t i o n s for infinite w o r d s , RAIRO Inform. Theor. 1 3 ( 1 9 7 9 ) 1 3 1 - 1 4 1 .
[ 4 8 ] G . H u e t , R é s o l u t i o n d ' é q u a t i o n s d a n s les l a n g a g e s d ' o r d r e 1 , 2 , . . . w , D o c t o r a l d i s s e r t a t i o n , U n i v e r s i t y P a r i s - 7 ( 1 9 7 6 ) .
[ 4 9 ] G . H u e t , C o n f l u e n t r e d u c t i o n s : a b s t r a c t p r o p e r t i e s a n d a p p l i c a t i o n s t o t e r m r e w r i t i n g s y s t e m s , J.
ACM 2 7 ( 1 9 8 0 ) 7 9 7 - 8 2 1 .
[ 5 0 ] J. L e s z c z y l o w s k i , A t h e o r e m o n r e s o l v i n g e q u a t i o n s in t h e s p a c e of l a n g u a g e s , Bull. Acad. Polon.
Sci., Ser. Sci. Math. Astronom. Phys. 1 9 ( 1 9 7 9 ) 9 6 7 - 9 7 0 .
[ 5 1 ] G . M a r k o w s k y a n d B . R o s e n , B a s e s for c h a i n - c o m p l e t e p o s e t s , IBM J. Res. Develop. 2 0 ( 1 9 7 6 ) 1 3 8 - 1 4 7 .
[ 5 2 ] J. M y c i e l s k i a n d W . T a y l o r , A c o m p a c t i f i c a t i o n of t h e a l g e b r a of t e r m s , Algebra Universalis 6 ( 1 9 7 6 ) 1 5 9 - 1 6 3 .
[ 5 3 ] M . N i v a t , O n t h e i n t e r p r e t a t i o n of r e c u r s i v e p o l y a d i c p r o g r a m s c h e m e s , S y m p o s i a M a t h e m a t i c a 1 5 ( A c a d e m i c P r e s s , N e w Y o r k , 1 9 7 5 ) 2 5 5 - 2 8 1 .
[ 5 4 ] M . N i v a t , M o t s infinis e n g e n d r é s p a r u n e g r a m m a i r e a l g é b r i q u e , RAIRO Inform. Théor. 1 1 ( 1 9 7 7 ) 3 1 1 - 3 2 7 .
[ 5 5 ] M . N i v a t , P r i v a t e c o m m u n i c a t i o n .
[ 5 6 ] L. N o l i n a n d G . R u g g i n , A f o r m a l i z a t i o n of E X E L , Proc. ACM Symposium on Principles of Programming Languages, B o s t o n ( 1 9 7 3 ) .
[ 5 7 ] M . O ' D o n n e l l , Computing in Systems Described by Equations, L e c t u r e N o t e s in C o m p u t e r S c i e n c e 5 8 ( S p r i n g e r , B e r l i n , 1 9 7 7 ) .
[ 5 8 ] M . O y a m a g u c h i a n d N . H o n d a , T h e d e c i d a b i l i t y of t h e e q u i v a l e n c e for d e t e r m i n i s t i c s t a t e l e s s p u s h d o w n a u t o m a t a , Information and Control 3 8 ( 1 9 7 8 ) 3 6 7 - 3 7 6 .
[ 5 9 ] M . O y a m a g u c h i , N . H o n d a a n d Y. I n a g a k i , T h e e q u i v a l e n c e p r o b l e m for r e a l - t i m e strict d e t e r m i n i s - tic l a n g u a g e s , Information and Control 4 5 ( 1 9 8 0 ) 9 0 - 1 1 5 .
[ 6 0 ] M . P a t e r s o n a n d M . W e g m a n , L i n e a r unification, J. Comput. System Sci. 1 6 ( 1 9 7 8 ) 1 5 8 - 1 6 7 . [ 6 1 ] J. R o b i n s o n , A m a c h i n e - o r i e n t e d logic b a s e d o n t h e r e s o l u t i o n p r i n c i p l e , J. ACM 12 ( 1 9 6 5 ) 2 3 - 4 1 . [ 6 2 ] B . R o s e n , T r e e - m a n i p u l a t i n g s y s t e m s a n d C h u r c h - R o s s e r t h e o r e m s , J. ACM 2 0 ( 1 9 7 3 ) 1 6 0 - 1 8 7 . [ 6 3 ] B . R o s e n , P r o g r a m e q u i v a l e n c e a n d c o n t e x t - f r e e g r a m m a r s , J. Comput. System Sci. 11 ( 1 9 7 5 )
3 5 8 - 3 7 4 .
[ 6 4 ] M . S c h ü t z e n b e r g e r , O n c o n t e x t - f r e e l a n g u a g e s a n d p u s h - d o w n a u t o m a t a . Information and Control 6 ( 1 9 6 3 ) 2 4 6 - 2 6 4 .
[ 6 5 ] J. T i u r y n , F i x e d p o i n t s a n d a l g e b r a s w i t h infinitely l o n g e x p r e s s i o n s , Fund. Inform. II ( 1 9 7 8 ) 1 0 7 - 1 2 8 a n d 11 ( 1 9 7 9 ) 3 1 7 - 3 3 5 .
[ 6 6 ] J. T i u r y n , O n a c o n n e c t i o n b e t w e e n r e g u l a r a l g e b r a s a n d r a t i o n a l a l g e b r a i c t h e o r i e s , Proc. 2nd Workshop on Categorical and Algebraic Methods in Computer Science and System Theory, D o r t - m u n d , W e s t G e r m a n y ( 1 9 7 8 ) .
[ 6 7 ] J. T i u r y n , U n i q u e fixed p o i n t s vs. least fixed p o i n t s , R e p o r t 4 9 , R W T H A a c h e n , W e s t G e r m a n y ( 1 9 7 8 ) .
[ 6 8 ] L. V a l i a n t , T h e e q u i v a l e n c e p r o b l e m for d e t e r m i n i s t i c f i n i t e - t u r n p u s h - d o w n a u t o m a t a . Information and Control 2 5 ( 1 9 7 4 ) 1 2 3 - 1 3 3 .
[ 6 9 ] J. W r i g h t , J. T h a t c h e r , E . W a g n e r a n d J. G o g u e n , R a t i o n a l a l g e b r a i c t h e o r i e s a n d fixed-point s o l u t i o n s , Proc. 17th Symposium on Foundations of Computer Science, H o u s t o n , T X ( 1 9 7 6 ) 1 4 7 - 1 5 8 . [ 7 0 ] J. W r i g h t , E . W a g n e r a n d J. T h a t c h e r , A u n i f o r m a p p r o a c h t o i n d u c t i v e p o s e t s a n d i n d u c t i v e
c l o s u r e , Theoret. Comput. Sci. 7 ( 1 9 7 8 ) 5 7 - 7 7 .
T h e o r e t i c a l C o m p u t e r S c i e n c e 3 0 ( 1 9 8 4 ) 2 0 5 - 2 3 9 N o r t h - H o l l a n d
T H E SOLUTIONS OF TWO S T A R - H E I G H T PROBLEMS FOR R E G U L A R T R E E S
J P. B R A Q U E L A I R E a n d B. C O U R C E L L E
Department of Mathematics and Computer Science. Bordeaux-l University. 3340* Interne, trance
Introduction
R e g u l a r t r e e s , i.e., t r e e s w h i c h a r e e i t h e r finite o r infinite w i t h o n l y finitely m a n y d i s t i n c t s u b t r e e s , p l a y a n i m p o r t a n t r o l e in t h e t h e o r y of p r o g r a m s c h e m e s I h e y h a v e b e e n i n v e s t i g a t e d b y C o u s i n e a u [ 9 ] , J a c o b [ 1 6 ] , E l g o t et al. [ 1 3 ] a n d ( o u r c e l l e [ 8 ] .
S i n c e t h e y f o r m t h e free i t e r a t i v e t h e o r y ( g e n e r a t e d by s o m e r a n k e d a l p h a b e t F ) , t h e y a r e d e n o t e d by c e r t a i n iterative theory expressions ( s e e [ 2 , 1 3 , 14]) T h e s e i t e r a t i v e t h e o r y e x p r e s s i o n s i n c l u d e t h e rational expressions i n d e p e n d e n t l y d e f i n e d by C o u s i n e a u [ 9 ] . T h e r e l a t i o n b e t w e e n t h e s e t w o c l a s s e s of e x p r e s s i o n s h a s b e e n s h o w n b y C o u r c e l l e [ 8 ] .
All t h e s e e x p r e s s i o n s u s e a n i t e r a t i o n o p e r a t o r ( d e n o t e d t o r *) v e r y c l o s e t o K l e e n e \ * for l a n g u a g e s . T h e y r a i s e a star-height problem, i.e., t h e p r o b l e m of c o n s t r u c t i n g a r a t i o n a l e x p r e s s i o n of m i n i m a l s t a r - h e i g h t w h i c h d e f i n e s a g i v e n r e g u l a r t r e e
T h i s p r o b l e m is trivial for i t e r a t i v e t h e o r y e x p r e s s i o n s w h i c h u s e v e c t o r i t e r a t i o n s i n c e e v e r y r e g u l a r t r e e c a n b e d e f i n e d by s u c h a n e x p r e s s i o n w i t h o n e i t e r a t i o n if t h e t r e e is infinite a n d n o i t e r a t i o n if it is finite [ 1 2 ] . It is n o t if i t e r a t i v e t h e o r y e x p r e s s i o n s a r e r e s t r i c t e d s o as t o u s e o n l y scalar iteration. W e s o l v e it a n d w e s h o w t h a t t h e m i n i m a l s t a r - h e i g h t is e x a c t l y t h e r a n k of t h e m i n i m a l g r a p h of t h e t r e e ( t h e r a n k of a d i r e c t e d g r a p h h a s b e e n i n t r o d u c e d by E g g a n [ 1 0 ] f o r t h e s t u d y of r a t i o n a l e x p r e s s i o n s d e f i n i n g l a n g u a g e s a n d f u r t h e r i n v e s t i g a t e d b y M c N a u g h t o n [ 1 7 . 18] a n d C o h e n a n d B r z o z o w s k i [ 3 - 6 ] ) .
T h e s e e x p r e s s i o n s u s e a n o p e r a t i o n c a l l e d composition, a t y p i c a l c a s e of w h i c h is e.,
r(e
}. e
n), w h i c h d e n o t e s t h e t r e e o b t a i n e d by t h e s u b s t i t u t i o n of V a l ( ? , ) . . Va!( e
n) at c e r t a i n l e a v e s of V a l ( t ' ) ( w e d e n o t e b y V a l ( ^ ) t h e t r e e d e f i n e d by t h e e x p r e s s i o n e).
T h e m a j o r c o n t r i b u t i o n of C o u s i n e a u w a s t o s h o w t h a t t h e o p e r a t i o n of c o m p o s i - t i o n is d i s p e n s a b l e a n d t h a t t h e r e s u l t i n g e x p r e s s i o n s still g e n e r a t e all r e g u l a r t r e e s ( s e e ¡ 8 ] for a s i m p l e p r o o f ) . T h e s e r e s t r i c t e d e x p r e s s i o n s r a i s e a n o t h e r s t a r - h e i g h t p r o b l e m for w h i c h w e a l s o give t h e s o l u t i o n . T h e m i n i m a l s t a r - h e i g h t in t h i s s e n s e is a l s o o b t a i n e d f r o m t h e c o n s i d e r a t i o n of t h e m i n i m a l g r a p h of t h e t r e e .
94
F o r t e c h n i c a l r e a s o n s , w e shall w o r k n e i t h e r w i t h i t e r a t i v e t h e o r y e x p r e s s i o n s [ 2 , 8, 1 3 ] n o r w i t h r a t i o n a l e x p r e s s i o n s [ 8 , 9 ] b u t w i t h s l i g h t l y d i f f e r e n t e x p r e s s i o n s (still c a l l e d rational) w h i c h u s e t h e f o l l o w i n g c o n s t r u c t i o n s :
*,ie\. i t e r a t e V a l ( ^ ) w i t h r e s p e c t t o t h e v a r i a b l e v.
(J.<< lK)(e^ . . . , ek): s u b s t i t u t e V a l ( e , ) , . . . , V a l ( ef c
) for Vi,...,v
kin
V a l ( c ) .O u r r e s u l t s will be o b t a i n e d for t h e s e r a t i o n a l e x p r e s s i o n s b u t t h e y t r a n s f e r e a s i l y t o t h e a b o v e m e n t i o n e d e x p r e s s i o n s .
T h e p r o o f s of o u r t w o r e s u l t s f o l l o w t h e s a m e p a t t e r n t h a t c a n b e s k e t c h e d a s f o l l o w s .
A r e g u l a r t r e e is m a n i p u l a t e d by m e a n s of a finite p o i n t e d g r a p h of w h i c h it is t h e infinite u n l o o p i n g . T h e s e g r a p h s c a n b e ' s t r u c t u r e d ' , in d i f f e r e n t w a y s , b u t e a c h ' s t r u c t u r i n g ' is c h a r a c t e r i z e d by a n i n t e g e r , its ' d e p t h ' .
F o r e a c h s t r u c t u r i n g of ' d e p t h ' n, o n e c a n c o n s t r u c t a r a t i o n a l e x p e s s i o n of s t a r - h e i g h t n. H e n c e , a c e r t a i n r a t i o n a l e x p r e s s i o n c a n b e a s s o c i a t e d w i t h a ' s t r u c t u r i n g ' of m i n i m a l ' d e p t h ' of t h e m i n i m a l p o i n t e d g r a p h of t h e g i v e n t r e e .
It t u r n s o u t t h a t t h i s r a t i o n a l e x p r e s s i o n is t h e r i g h t o n e , i.e., is of m i n i m a l s t a r - h e i g h t a m o n g all t h o s e d e f i n i n g t h e g i v e n t r e e .
In o r d e r t o p r o v e t h i s , w e first d e f i n e s o m e s y n t a c t i c a l m a n i p u l a t i o n s p e r f o r m i n g s o m e s i m p l i f i c a t i o n s of r a t i o n a l e x p r e s s i o n s . T h e y t r a n s f o r m a r a t i o n a l e x p r e s s i o n i n t o a n e q u i v a l e n t o n e in normal form.
F r o m t h e s y n t a c t i c a l s t r u c t u r i n g of a m i n i m a l r a t i o n a l e x p r e s s i o n in n o r m a l f o r m , o n e c a n c o n s t r u c t a ' s t r u c t u r i n g ' of t h e m i n i m a l g r a p h of t h e t r e e w h o s e ' d e p t h ' is n o t less t h a n t h e s t a r - h e i g h t of t h e e x p r e s s i o n . A n d f r o m t h e first c o n s t r u c t i o n o n e g e t s a n e q u a l i t y a s r e q u i r e d .
References
[1] H. Barendregt. The Lambda-Calculus, Studies in Logic 103 (North-Holland, Amsterdam, 1981 ).
[2] S. Bloom and C Elgot, The existence and construction of free iterative theories .J. Comput. System Sci. 12 ( 1 9 7 6 ) 3 0 5 - 3 1 8 .
[3] R. Cohen, Star-height of certain families of regular events. J. Comput. System Sci. 4 ( 1970) 2 8 1 - 2 9 7 . [4] R. Cohen, Techniques for establishing star-height of regular sets. Math. Systems Theory 5 (1971)
9 7 - 1 1 4 .
[5] R. Cohen, Rank non-increasing transformations on transition graphs, Inform. and Control 20 ( 1972) 9 3 - 1 1 3 .
[6] R. Cohen and J. Brzozowski, General properties of star-height of regular events, J. Comput. System Sci. 4 ( 1 9 7 0 ) 2 6 0 - 2 8 0 .
[7] B. Courcelle, A representation of trees by languages Part I, Theoret. Comput. Sci. 6 (1978) 2 5 5 - 2 7 9 ; Part II, Theoret. Comput. Sci. 7 (1978) 2 5 - 5 5 .
[8] B. Courcelle, Fundamental properties of infinite trees. Theoret. Comput. Sci. 25 (1983) 9 5 - 1 6 9 . [9] G. Cousineau, An algebraic definition for control structures, Theoret. Comput. Sci. 12 (1980)
1 7 5 - 1 9 2 .
[10] L. Eggan, Transition graphs and the star-height of regular events, Michigan Math. J. 10 (1963) 3 8 5 - 3 9 7 .
[11] S. Eilenberg, Automata. Languages and Machines, Vol. A (Academic Press, New York. 1974).
[12] C. Elgot, Monadic computations and iterative algebraic theories, in : H.E. Rose, ed.. Logic Col
loquium 73 (North-Holland, Amsterdam, 1975) pp. 1 7 5 - 2 3 0 .
[13] C. Elgot, S. Bloom and R. Tindell, The algebraic structure of rooted trees, J. Comput. System Sci.
16 ( 1 9 7 8 ) 3 6 2 - 3 9 9 .
[14] S. Ginali, Regular trees and the free iterative theory, J. Comput. System Sci. 18 (1979) 2 2 8 - 2 4 2 . [15] G. Huet, Confluent reductions: abstract properties and applications to term rewriting systems, J.
Assoc. Comput. Mack 27 ( 1 9 8 0 ) 7 9 7 - 8 2 1 .
[16] G. Jacob, Calcul du rang des arbres infinis réguliers, Proc. CAAP' 81, Lecture Notes Comput. Sci.
112 (Springer, Berlin, 1981) pp. 2 3 8 - 2 5 4 .
[17] R. McNaughton, The loop complexity of pure-group events, Inform. Control 11 (1967) 1 6 7 - 1 7 6 . [18] R. McNaughton, The loop complexity of regular events, Inform. Sci. 1 ( 1 9 6 9 ) 3 0 5 - 3 2 8 .
B. COURCELLE
U.E.R. de Mathematiques et Informatique Université de Bordeaux I - F-33405 TALENCE