A Modal Logic for Termgraph Rewriting
We propose a modal logic tailored to describe graph transformations and discuss some of its properties. We focus on a particular class of graphs called termgraphs. They are first-order terms augmented with sharing and cycles. Termgraphs allow one to …
Authors: ** - Ph. Balbiani (Université de Toulouse, CNRS, IRIT) - R. Echahed (Laboratoire LIG
A mo dal Logic for T ermgraph Re writing ⋆ Ph. Balbiani 1 , R. Ec hahed 2 , and A. Herzig 1 1 Universit ´ e de T oulouse, CNRS Institut de Rec herc he en Informatique de T oulouse (IRIT) 118 route de Narbonne, 31062 T oulouse Cedex 9, F rance { balbiani ,herzig } @ irit.fr 2 Lab oratoire LIG Bˆ at IMAG C BP 53 38041 Grenoble Cedex, F rance Rachid.Ech ahed@imag .fr Abstract. W e prop ose a m o dal logic tailored to describ e graph t rans- formations and discuss some of its prop erties. W e focu s on a particular class of graphs called termgraphs. They are first-order terms augmented with sharing and cycles. T ermgraphs allo w one to describ e clas sical data- structures (p ossi bly with pointers) such as doub ly -link ed lists, circular lists et c. W e show how the proposed logic can faithfully describ e (i) ter- mgraphs as well as (ii) the app lica tion of a termgraph rewrite rule (i.e. matc hing and replacemen t) and (iii) the computation of normal f orms with resp ect to a giv en rewrite system. W e also show how th e prop osed logic, whic h is more ex pressiv e than prop os itional dynamic logic, can b e used to sp ecify shap es of classical data-structures (e.g. binary trees, circular lists etc.). 1 In t r oduction Graphs are common structures widely used in several a reas in co mputer science and discr ete mathema tics . Their transforma tion constitute a domain o f re search per se with a la rge num ber of p otential applications [11, 8, 9]. There are many different w ays to define gr aphs and graph transformatio n. W e consider in this pap er structures k nown as termgr aphs a nd their trans formation via rewrite rules [5, 10 ]. Roughly sp eaking, a ter mgraph is a first-o r der term with p ossible sharing (of sub-terms) and cycles. Below we depict three examples of termgr a phs : G 0 is a classical first-o rder term. G 1 represents the same expr ession as G 0 but arg ument x is shared. G 1 is often used to define the function double doubl e ( x ) = G 1 . The second termgr aph G 2 represents a circula r list of tw o “recor ds” (represented here by oper a tor cons ) shar ing the same conten t G 1 . ⋆ This work has been partly funded b y the p ro ject ARROWS of t he F rench A genc e Nationale de la Re cher che. + } } { { { { ! ! C C C C x x G 0 + x G 1 cons $ $ I I I I I / / cons z z u u u u u s s + x G 3 T ermgr aphs a llow t o represent real-world data structures (with p oin ters ) such as circular lists, doubly-linked lists etc [7], and rewriting allows to effi- ciently pro cess such graphs. They are th us a suitable framework for declar ativ e languages dealing with s uc h c o mplex data str uctures. How ever, while there e xist rewriting-ba sed proof metho ds for first-order terms, there is a lack of appro- priate termgra ph rewriting pro of methods, diminishing thus their ope r ational bene fits. Indeed, equational logic provides a log ical se ttin g for first-or der term rewriting [4], and many theorem prov ers use r ewrite techniques in or der to e ffi- ciently achiev e equa tional reas oning. I n [6] an extension of first-o rder (clausal) logic dea ling with termgraphs has b een pr o posed to giv e a log ic co un terpar t of termgraph rewriting. In such a logic op erations are in terpreted as contin uo us functions [12, 13] a nd bisimila r gra phs cannot b e distinguished (t w o termgra phs are bisimilar if and only if they represe nt the sa me r ational term). Due to tha t, reasoning on termgraphs is unfortunately muc h trickier than in first-o rder clas- sical logic. F or example, equational theories on termgraphs are not recursively enum erable w he r eas equational theo ries on terms are r.e.). In this pap er, we inv estig ate a mo dal logic with possible w o rlds semantics which b etter fits the o p erational features of termgraph rewriting sys tems. T er- mgraphs can easily be interpreted within the framew ork of possible worlds se- mantics, where no des are considered as w orlds and edges as modalities. Ba s ed on this observ atio n, we investigate a new moda l logic which has b e en tailored to fit ter mgraph rewr iting . W e show how termgraphs as well as rewrite rules can b e sp ecified by means of mo dal form ulae. In particular w e s ho w how a rewrite step can be defined b y means of a modal formula which enco des termgraph match- ing (graph homomor phism) and termgra ph replacement (gr aph construction and mo dification). W e show also how to define prop erties on such structures , such a s being a list, a circ ula r list, a tree, a binary tree. The computation o f termgra ph normal for m is formulated in th is new logic. In a ddition, we form ulate inv a r i- ant pr eserv ation by rewriting rules and discuss subcla sses fo r which v a lidit y is decidable. The next tw o sections in tro duce respec tiv ely the co nsidered class of term- graph rewrite systems and the prop osed modal logic. In s ection 4 w e discuss briefly the expr essiv e p ow er of the mo dal log ic a nd show particularly how g raph homomorphisms can be enco ded. In section 5 we show how elementary graph transformatio ns can b e expressed as mo dal lo gic for m ulae whareas section 6 shows ho w termg raph rewriting can b e spe c ified as moda l form ula e. Section 7 gives some concluding rema r ks. 2 T ermgraph Rewriting This s ection defines the framework of graph rewrite systems that w e consider in the paper. Ther e ar e different approaches in the literature to define graph transformatio ns. W e follow her e an algo r ithmic appro ac h to termgraph r ewriting [5]. Our definitions are consistent with [7 ]. Definition 21 (Graph) A termgr aph , or simply a gr aph is a tuple G = ( N , E , L n , L e , S , T ) which consists of a finite set of no des N , a finite set of edges E , a (partial) no de lab elling function L n : N → Ω w hich a ssocia tes lab els in Ω to no des in N , a (total) edge lab elling function L e : E → F which a s sociates , to every edg e in E , a la bel (or feature) in F , a so ur ce function S : E → N and a target function T : E → N whic h sp ecify resp ectiv e ly , for every edge e , its s ource S ( e ) and its target T ( e ). Note that G is a first-o rder ter m if and o nly if G is a tree . W e assume that the lab elling of edges L e fulfills the following additional deter- minism c o ndition: ∀ e 1 , e 2 ∈ E , ( S ( e 1 ) = S ( e 2 ) a nd L e ( e 1 ) = L e ( e 2 )) implies e 1 = e 2 . This last condition expresses the fa ct that for every node n there exists at most o ne edge e o f lab e l a such that the source of e is n . W e denote suc h an edge by the tuple ( n, a, m ) where m is the target o f edge e . Notation : F o r eac h la b elled no de n the fact that ω = L n ( n ) is written n : ω , and each unlab elled no de n is written as n : • . This ‘unlabelle d’ symbol • is used in termgra phs to represent anon ymo us v ar ia bles. n : ω ( a 1 ⇒ n 1 , . . . , a k ⇒ n k ) describ es a no de n lab elled by symbol ω with k o utgoing edges, e 1 , . . . , e k , such that for every edge e i , L e ( e i ) = a i , S ( e i ) = n a nd T ( e i ) = n i . In the sequel we will use the linear notation of termgra phs [5] defined by the following grammar. The v a riable A (resp. F and n ) rang es over the set Ω (resp. F and N ) : TermGraph ::= Node | Node + TermGraph Node ::= n : A (F ⇒ No de ,. . . ,F ⇒ Node ) | n : • | n the op erator + stands for the disjoint union of termgr aph definitions. W e assume that e very node is labe lle d at most once. The expres sion n : ω ( n 1 , . . . , n k ) sta nds for n : ω (1 ⇒ n 1 , . . . , k ⇒ n k ). A gr aph homomorphi sm , h : G → G 1 , wher e G = ( N , E , L n , L e , S , T ) and G 1 = ( N 1 , E 1 , L n 1 , L e 1 , S 1 , T 1 ) is a pair of functions h = ( h n , h e ) with h n : N → N 1 and h e : E → E 1 which preserves the lab elling o f no des and edges as well as the source and target functions. This means that fo r e ac h lab elled node m in G , L n 1 ( h n ( m )) = L n ( m ) and for ea c h edge f in G , L e 1 ( h e ( f )) = L e ( f ), S 1 ( h e ( f )) = h n ( S ( f )) and T 1 ( h e ( f )) = h n ( T ( f )). Notice that the image by h n of a n unlabelled no de may b e any no de. Remark : B ecause of the determinism condition, a homomor phism h : G → G 1 is completely defined by the function h n : N → N 1 which should sa tis fy the following c o nditions : for each lab elled no de m in G , L n 1 ( h n ( m )) = L n ( m ) and for ev ery outgoing e dg e from m , say ( m, a, w ), for some feature a a nd no de w , the edg e ( h n ( m ) , a, h n ( w )) b elongs to E 1 . Example 22 Let B 1 , B 2 and B 3 be the following termgr aphs. B 1 : n 0 : h 1 n 1 : g b a & & M M M M M n 2 : • n 3 : • B 2 : B n 0 : h 1 n 1 : g b a % % L L L L L L n 2 : 0 n 3 : • B 3 : n 0 : h 1 n 1 : g b a n 2 : 0 and h a nd h ′ be t w o functions o n nodes defined as follows: h ( n i ) = n i for i in { 0 , 1 , 2 , 3 } and h ′ ( n i ) = n i for i in { 0 , 1 , 2 } and h ′ ( n 3 ) = n 2 . h defines a homomorphism from B 1 to B 2 . h ′ defines a homomo rphism from B 1 to B 3 and from B 2 to B 3 . There is no homomorphism from B 3 to B 2 or to B 1 , nor from B 2 to B 1 . The following definition intro duces a notion of actions . Ea c h action sp ecifies an elementary tr ansformation of g raphs. These elementary a ctions are used la ter on to define gra ph trans formations b y means of rewrite r ules. Definition 23 (Actions) An action has one of the following forms. – a no de definition or no de label ling n : f ( a 1 ⇒ n 1 , . . . , a k ⇒ n k ) where n, n 1 , . . . , n k are no des and f is a lab el of no de n . F or i ∈ { 1 , . . . , k } , a i is the lab el of an edge, e i , suc h that ( L e ( e i ) = a i ) and whose s ource is n ( S ( e i ) = n ) and target is node n i ( T ( e i ) = n i ). This actio n, first cr eates a new node n if n does not a lready exist in the cont ext o f application of the action. Then no de n is defined b y its lab el and its o utgoing edges. – a n edge redirection or lo cal redirection n ≫ a m where n, m are no des and a is the feature o f an edge e o utgoing node n ( S ( e ) = n and L e ( e ) = a ). This ac tion is an edge redirection and mea ns that the ta rget of edge e is redir e cted to point to the no de m (i.e., T ( e ) = m after per forming the action n ≫ a m ). – a global redirection n ≫ m where n a nd m are no des. This means that a ll edges e p oin ting to n ( T ( e ) = n ) a re redirected to p oin t to the no de m ( T ( e ) = m ). The res ult o f a pply ing an action α to a termgra ph G = ( N , E , L n , L e , S , T ) is denoted b y α [ G ] and is defined as the following termgraph G 1 = ( N 1 , E 1 , L n 1 , L e 1 , S 1 , T 1 ) such that : – If α = n : f ( a 1 ⇒ n 1 , . . . , a k ⇒ n k ) then • N 1 = N ∪ { n, n 1 , . . . , n k } , • L n 1 ( n ) = f and L n 1 ( m ) = L n ( m ) if m 6 = n , • Let E = { e i | 1 ≤ i ≤ k , e i is an edge such that S ( e i ) = n, T ( e i ) = n i and L e ( e i ) = a i } . E 1 = E ∪ E , • L e 1 ( e ) = a i if e = e i ∈ E L e ( e ) if e 6∈ E • S 1 ( e ) = n if e = e i ∈ E S ( e ) if e 6∈ E • T 1 ( e ) = n i if e = e i ∈ E T ( e ) if e 6∈ E ∪ denotes classical union. This means that the no des in { n, n 1 , . . . , n k } w hich already b elong to G are reused whereas the others are new. – If α = n ≫ a m then • N 1 = N , L n 1 = L n , L e 1 = L e , S 1 = S a nd • Let e be the edge of la bel a outgo ing n . T 1 ( e ) = m and T 1 ( e ′ ) = T ( e ′ ) if e ′ 6 = e . – If α = n ≫ m then N 1 = N , L n 1 = L n , L e 1 = L e , S 1 = S a nd T 1 ( e ) = m if T ( e ) = n T ( e ) otherwis e A r o ote d termgr a ph is a termgraph G with a distinguished node n called its r oot. W e write G = ( N , E , L n , L e , S , T , n ). The application o f an a ction α to a ro oted ter mgraph G = ( N , E , L n , L e , S , T , n ) is a ro oted termg raph G 1 = ( N 1 , E 1 , L n 1 , L e 1 , S 1 , T 1 , n 1 ) such that G 1 = α [ G ] and r oot n 1 is defined as follows : – n 1 = n if α is not of the form n ≫ p . – n 1 = p if α is of the for m n ≫ p . The application of a sequence of ac tio ns ∆ to a (roo ted) termgraph G is defined inductively a s follows : ∆ [ G ] = G if ∆ is the empt y sequence and ∆ [ G ] = ∆ ′ [ α [ G ]] if ∆ = α ; ∆ ′ where “;” is the concatenation (or sequen tial) op eration. L e t h be a homo mo rphism. W e denote by h ( ∆ ) the sequence o f actions obtained fro m ∆ by substituting e v ery no de m o ccurring in ∆ by h ( m ). Example 24 This example illustrates the application of a ctions. Let H 1 , H 2 , H 3 , H 4 and H 5 be the following termgr aphs. H 1 : n 1 : f a n 2 : 0 H 2 : n 1 : g b a % % L L L L L L n 2 : 0 n 3 : • H 3 : n 0 : h 1 n 1 : g b a % % L L L L L L n 2 : 0 n 3 : • H 4 : n 0 : h 1 n 1 : g b a n 2 : 0 n 3 : • H 5 : n 0 : h 1 n 1 : g a \ \ b B B n 2 : 0 n 3 : • H 2 is obtained from H 1 by applying the action n 1 : g ( b ⇒ n 2 , a ⇒ n 3 ). n 1 is relab elled whereas n 3 is a new unlab elled no de. H 3 is obtained from H 2 by applying the action α = n 0 : h ( n 1 ). n 0 is a new no de labelled b y h . h has one argument n 1 . H 4 is o btained from H 3 by applying the action n 1 ≫ a n 2 . The effect of this action is to change the tar get n 3 of the e dge ( n 1 , a, n 3 ) by n 2 . H 5 is o btained fro m H 4 by a pplying the action n 2 ≫ n 0 . This action redirec ts the incoming edg es of no de n 2 to targ et node n 0 . Definition 25 (Rule, system, rewrite step) A r ewrite rule is an expressio n of the fo r m l → r where l is a termgr a ph and r is a sequence o f ac tio ns. A r ule is written l → ( a 1 , . . . , a n ) or l → a 1 ; . . . ; a n where the a ′ i s are elementary actions. A termgr aph r ewrite system is a set of re write rules. W e say that the term-gra ph G r ewrites to G 1 using the rule l → r iff ther e exists a homomor phism h : l → G and G 1 = h ( r )[ G ]. W e write G → l → r G 1 , or simply G → G 1 . Example 26 W e give her e an example of a rewrite step. Co nsider the following rewrite r ule: n 1 : g ( a ⇒ n 2 : • , b ⇒ n 3 : • ) → n 0 : h (1 ⇒ n 1 ); n 1 ≫ a n 2 ; n 2 ≫ n 0 The reader may ea sily verify that the g raph H 2 of Example 24 can b e rewr it- ten by the considered rule into the graph H 5 of Exa mple 24. Example 27 W e give her e somme illustra ting examples o f the consider ed class of rewr ite systems. W e firs t define a n o peration, inser t , which inserts an element in a circular list. r : in sert ( m : • , p 1 : cons ( m 1 : • , p 1 )) → p 2 : cons ( m, p 1 ); p 1 ≫ 2 p 2 ; r ≫ p 2 r : in sert ( m : • , p 1 : cons ( m 1 : • , p 2 ))+ p 3 : cons ( m 2 , p 1 ) → p 4 : cons ( m, p 1 ); p 3 ≫ 2 p 4 ; r ≫ p 4 As a second example, we define below the o peratio n l eng th which computes the nu m ber of elements of a n y , p ossibly circular , list. r : l eng th ( p : • ) → r ′ : l eng th ′ ( p, p ); r ≫ r ′ r : l eng th ′ ( p 1 : nil , p 2 : • ) → r ′ : 0; r ≫ r ′ r : l eng th ′ ( p 1 : cons ( n : • , p 2 : • ) , p 2 ) → r ′ : succ (0); r ≫ r ′ r : l eng th ′ ( p 1 : cons ( n : • , p 2 : • ) , p 3 : • ) → r ′ : s ( q : • ); q : l eng th ′ ( p 2 , p 3 ); r ≫ r ′ Poin ters help v er y often to enhance the efficiency of alg o rithms. In the fol- lowing, we define the op eration rev er se whic h p erforms the so -called “in-s itu list r ev er sal”. o : r ev erse ( p : • ) → o ′ : rev er se ′ ( p, q : nil ); o ≫ o ′ o : r ev erse ′ ( p 1 : cons ( n : • , q : nil ) , p 2 : • ) → p 1 ≫ 2 p 2 ; o ≫ p 1 o : r ev erse ′ ( p 1 : cons ( n : • , p 2 : cons ( m : • , p 3 : • ) , p 4 : • ) → p 1 ≫ 2 p 4 ; o ≫ 1 p 2 ; o ≫ 2 p 1 The la s t example illustrates the enco ding of classical term rew r ite systems. W e define the addition on na turals a s well as the function doub le with their usua l meanings. r : +( n : 0 , m : • ) → r ≫ m r : +( n : s ucc ( p : • ) , m : • ) → q : suc c ( k : +( p, m )); r ≫ q r : doub le ( n : • ) → q : +( n, n ); r ≫ q 3 Mo dal logic It is now time to define the s yn tax and the s eman tics of the logic of graph mo difiers that w ill b e used as a to o l to talk ab out ro oted termgr aphs. 3.1 Syn tax Like the lang uage of propositiona l dynamic logic, the languag e of the logic of graph mo difiers is ba sed on the idea of asso ciating with each action α o f an action languag e a mo dal connective [ α ]. The formula [ α ] φ is read “after every terminating execution of α , φ is true” . Consider , as in section 2, a co un table set F (with t ypica l member s denoted a , b , etc) of edge la b els and a coun table set Ω (with typical mem b ers deno ted ω , π , etc) of no de lab els. These lab els are formulas defined b elo w. A no de lab eled by π is called a π no de . F ormally w e define the se t of all actions (with t ypical members denoted α , β , etc) and the set of all form ula s (with t ypica l members denoted φ , ψ , etc) as follows: – α ::= a | U | n | n | φ ? | ( ω := g φ ) | ( ω := l φ ) | ( a + ( φ, ψ )) | ( a − ( φ, ψ )) | ( α ; β ) | ( α ∪ β ) | α ⋆ , – φ :: ω | ⊥ | ¬ φ | ( φ ∨ ψ ) | [ α ] φ . W e a dopt the s tandard abbr eviations for the o ther Bo olean connectives. More- ov er, for all actions α and for all form ulas φ , let h α i φ b e ¬ [ α ] ¬ φ . As usual, w e follow the standard r ules for omission o f the parentheses. An atomic action is either an edg e lab el a in F , the universal actio n U , a test φ ? or an up date actio n n , n , ω := g φ , ω := l φ , a + ( φ, ψ ) or a − ( φ, ψ ). U reads “go anywhere”, n reads “add some new no de”, n reads “add some new no de and g o there”, ω := g φ reads “as sign to ω no des the truth v alue of φ ev erywhere (globally)”, ω := l φ reads “assign to ω the truth v alue of φ here (locally)” , a + ( φ, ψ ) reads “add a edges from all φ no des to all ψ nodes” , and a − ( φ, ψ ) reads “delete a edges from all φ no des to a ll ψ no des”. Complex actions are built b y means o f the regular op erators “;”, “ ∪ ” and “ ⋆ ”. An up date action is an action without edge lab els and without U . An up date a ction is := l -free if no lo cal as signmen t ω := l φ o ccurs in it. 3.2 Seman ti cs Like the truth-conditions of the form ula s of ordinary mo dal logics, the truth- conditions of the formulas o f the logic of gra ph mo difiers is ba sed on the idea of int erpreting, within a ro oted termgr aph G = ( N , E , L n , L e , S , T , n 0 ), edg e lab els in F by sets of edges and no de lab els in Ω b y sets of no des. In this sectio n, we consider a more general notion of node la beling functions L n of termgr a phs such that no des can hav e several lab els (prop ositions). In this c a se the lab eling function has the following profile L n : N → P ( Ω ). No de lab e ling functions considered in section 2 wher e a node ca n have at mo st one label is o b vious ly a particular case. L e t I G be the int erpretation function in G of labels defined as follows: – I G ( a ) = { e ∈ E : L e ( e ) = a } , – I G ( ω ) = { n ∈ N : ω ∈ L n ( n ) } . F or all abstract actions a , let R G ( a ) = { ( n 1 , n 2 ): there e xists a n edg e e ∈ I G ( a ) such tha t S ( e ) = n 1 and T ( e ) = n 2 } be the binary relation int erpreting the abstract action a in G . The truth-c onditions of the form ulas of the logic of graph mo difiers are defined by induction as follows: – G | = ω iff n 0 ∈ I G ( ω ), – G 6| = ⊥ , – G | = ¬ φ iff G 6| = φ , – G | = φ ∨ ψ iff G | = φ or G | = ψ , – G | = [ α ] φ iff for all ro oted ter mg raphs G ′ = ( N ′ , E ′ , L n ′ , L e ′ , S ′ , T ′ , n ′ 0 ), if G − → α G ′ then G ′ | = φ where the binary relatio ns − → α are de fined by induction as follows: – G − → a G ′ iff N ′ = N , E ′ = E , L n ′ = L n , L e ′ = L e , S ′ = S , T ′ = T and ( n 0 , n ′ 0 ) ∈ R G ( a ), – G − → φ ? G ′ iff N ′ = N , E ′ = E , L n ′ = L n , L e ′ = L e , S ′ = S , T ′ = T , n ′ 0 = n 0 and G ′ | = φ , – G − → U G ′ iff N ′ = N , E ′ = E , L n ′ = L n , L e ′ = L e , S ′ = S and T ′ = T , – G − → n G ′ iff N ′ = N ∪ { n 1 } where n 1 is a new node, E ′ = E , L n ′ ( m ) = L n ( m ) if m 6 = n 1 , L n ′ ( n 1 ) = ∅ , L e ′ = L e , S ′ = S , T ′ = T and n ′ 0 = n 0 , – G − → n G ′ iff N ′ = N ∪ { n 1 } where n 1 is a new no de, E ′ = E , L n ′ ( m ) = L n ( m ) if m 6 = n 1 , L n ′ ( n 1 ) = ∅ , L e ′ = L e , S ′ = S , T ′ = T and n ′ 0 = n 1 , – G − → ω := g φ G ′ iff N ′ = N , E ′ = E , L n ′ ( m ) = if ( N , E , L n , L e , S , T , m ) | = φ } then L n ( m ) ∪ { ω } else L n ( m ) \ { ω } , L e ′ = L e , S ′ = S , T ′ = T and n ′ 0 = n 0 , – G − → ω := l φ G ′ iff N ′ = N , E ′ = E , L n ′ ( n 0 ) = if ( N , E , L n , L e , S , T , n 0 ) | = φ then L n ( n 0 ) ∪ { ω } else L n ( n 0 ) \ { ω } , L n ′ ( m ) = L n ( m ) if m 6 = n 0 , L e ′ = L e , S ′ = S , T ′ = T and n ′ 0 = n 0 , – G − → a +( φ,ψ ) G ′ iff N ′ = N , E ′ = E ∪ { ( n 1 , a, n 2 ) : ( N , E , L n , L e , S , T , n 1 ) | = φ and ( N , E , L n , L e , S , T , n 2 ) | = ψ } , L n ′ = L n , L e ′ ( e ) = if e ∈ E then L e ( e ) else a , S ′ ( e ) = if e ∈ E then S ( e ) else e is of the fo r m ( n 1 , a, n 2 ) and S ′ ( e ) = n 1 , T ′ = if e ∈ E then T ( e ) else e is of the form ( n 1 , a, n 2 ) and T ′ ( e ) = n 2 and n ′ 0 = n 0 , – G − → a − ( φ,ψ ) G ′ iff N ′ = N , E ′ = E \{ ( n 1 , a, n 2 ) : ( N , E , L n , L e , S , T , n 1 ) | = φ and ( N , E , L n , L e , S , T , n 2 ) | = ψ } , L n ′ = L n , L e ′ ( e ) = L e ( e ), S ′ = S , T ′ = T and n ′ 0 = n 0 , – G − → α ; β G ′ iff there exists a ro oted termgraph G ′′ = ( N ′′ , E ′′ , L n ′′ , L e ′′ , S ′′ , T ′′ , n ′′ 0 ) such that G − → α G ′′ and G ′′ − → β G ′ , – G − → α ∪ β G ′ iff G − → α G ′ or G − → β G ′ , – G − → α ⋆ G ′ iff there exists a sequence G (0) = ( N (0) , E (0) , L n (0) , L e (0) , S (0) , T (0) , n (0) 0 ), . . . , G ( k ) = ( N ( k ) , E ( k ) , L n ( k ) , L e ( k ) , S ( k ) , T ( k ) , n ( k ) 0 ) of r ooted termgr aphs such that G (0) = G , G ( k ) = G ′ and for all non-negative in tegers i , if i < k then G ( i ) − → α G ( i +1) . The a b ov e definitions of fo r m ulas reflect our in tuitive understanding of the ac- tions of the languag e of the logic of gr aph mo difiers. Obviously , G | = h α i φ iff there exists a ro o ted termgra ph G ′ = ( N ′ , E ′ , L n ′ , L e ′ , S ′ , T ′ , n ′ 0 ) such that G − → α G ′ and G ′ | = φ . The for mula φ is said to be v alid in class C o f ro oted termgraphs, in symbols C | = φ , iff G | = φ for each r o oted termgraph G = ( N , E , L n , L e , S , T , n 0 ) in C . The cla ss o f all r o oted ter mgraphs will b e deno ted more briefly a s C all . 3.3 V alidities Obviously , as in pro p ositional dynamic lo g ic, we have – C all | = [ φ ?] ψ ↔ ( φ → ψ ), – C all | = [ α ; β ] φ ↔ [ α ][ β ] φ , – C all | = [ α ∪ β ] φ ↔ [ α ] φ ∧ [ β ] φ , – C all | = [ α ⋆ ] φ ↔ φ ∧ [ α ][ α ⋆ ] φ . If α is a := l -free up date a ction then – C all | = [ α ] ⊥ ↔ ⊥ , – C all | = [ α ] ¬ φ ↔ ¬ [ α ] φ , – C all | = [ α ]( φ ∨ ψ ) ↔ [ α ] φ ∨ [ α ] ψ . The next series of equiv alences guar an tees that each o f our := l -free up date ac- tions can b e moved acr oss the abstr act a ctions of the for m a or U : – C all | = [ n ][ a ] φ ↔ [ a ][ n ] φ , – C all | = [ n ][ U ] φ ↔ [ n ] φ ∧ [ U ][ n ] φ , – C all | = [ n ][ a ] φ ↔ ⊤ , – C all | = [ n ][ U ] φ ↔ [ n ] φ ∧ [ U ][ n ] φ , – C all | = [ ω := g φ ][ a ] ψ ↔ [ a ][ ω := g φ ] φ , – C all | = [ ω := g φ ][ U ] ψ ↔ [ U ][ ω := g φ ] ψ , – C all | = [ a + ( φ, ψ )][ b ] χ ↔ [ b ][ a + ( φ, ψ )] χ if a 6 = b a nd C all | = [ a + ( φ, ψ )][ b ] χ ↔ [ b ][ a + ( φ, ψ )] χ ∧ ( φ → [ U ]( ψ → [ a + ( φ, ψ )] χ )) if a = b , – C all | = [ a + ( φ, ψ )][ U ] χ ↔ [ U ][ a + ( φ, ψ )] χ , – C all | = [ a − ( φ, ψ )][ b ] χ ↔ [ b ][ a − ( φ, ψ )] χ if a 6 = b a nd C all | = [ a − ( φ, ψ )][ b ] χ ↔ ( ¬ φ ∧ [ b ][ a − ( φ, ψ )] χ ) ∨ ( φ ∧ [ b ]( ¬ ψ → [ a − ( φ, ψ )] χ )) if a = b , – C all | = [ a − ( φ, ψ )][ U ] χ ↔ [ U ][ a − ( φ, ψ )] χ . Finally , once we hav e moved each of our := l -free up date actio ns ac r oss the ab- stract actions of th e form a o r U , these up date actio ns can b e eliminated by means of the following equiv alences: – C all | = [ n ] ω ↔ ω , – C all | = [ n ] ω ↔ ⊥ , – C all | = [ ω := g φ ] π ↔ π if ω 6 = π and C all | = [ ω := g φ ] π ↔ φ if ω = π , – C all | = [ a + ( φ, ψ )] ω ↔ ω , – C all | = [ a − ( φ, ψ )] ω ↔ ω . Prop osition 31 F or al l := l -fr e e ⋆ -fr e e formulas φ , ther e exists a := l -fr e e ⋆ -fr e e formula ψ wi thout up date actio ns such that C all | = φ ↔ ψ . Pr o of. See the ab ov e discuss io n. Just as for := l -free up date actions, we hav e the following equiv alences for the upda te actions of the form ω := l φ : – C all | = [ ω := l φ ] ⊥ ↔ ⊥ , – C all | = [ ω := l φ ] ¬ ψ ↔ ¬ [ ω := l φ ] ψ , – C all | = [ ω := l φ ]( ψ ∨ χ ) ↔ [ ω := l φ ] ψ ∨ [ ω := l φ ] χ , – C all | = [ ω := l φ ] π ↔ π if ω 6 = π and C all | = [ ω := g φ ] π ↔ φ if ω = π . But it is not p ossible to for mulate reduction axioms for the cases [ ω := l φ ][ a ] ψ and [ ω := l φ ][ U ] ψ . More pre c is ely , Prop osition 32 Ther e exists a ⋆ -fr e e formula φ su ch that for al l ⋆ -fr e e formulas ψ without up date actio ns, C all 6| = φ ↔ ψ . Pr o of. T ake the ⋆ -free for m ula φ = [ ω := g ⊥ ][ U ][ ω := l ⊤ ][ a ] ¬ ω . The reade r may easily verify that for a ll ro oted ter mgraphs G = ( N , E , L n , L e , S , T , n 0 ), G | = φ iff R G ( a ) is irreflex iv e. Seeing that the fact that the binary relation int erpreting an abstr a ct actio n of the for m a is ir reflexiv e ca nnot be mo dally defined in prop ositional dyna mic lo g ic, then for all fo r m ulas ψ without update actions, C all 6| = φ ↔ ψ . 3.4 Decidability , axiomatization and a link with h ybrid logics Firstly , let us consider the se t L of all := l -free ⋆ -free form ulas φ suc h that C all | = φ . T o gether with a pro cedure for de c iding membership in ⋆ -free pr opositiona l dynamic lo gic, the equiv ale nces preceding pro position 3 1 provide a pro cedure for deciding mem be r ship in L . Hence, membership in L is decidable. Secondly , let us conside r the set L (:= l ) o f all ⋆ -free formulas φ such that C all | = φ . Aucher et al. [3] have defined a recursive translation from the lang ua ge of hybrid lo gic [2] in to the s et o f all our ⋆ -free for m ulas that preserves satisfiability . It is known that the problem of deciding s atisfiabilit y of hybrid log ic for mulas is undecidable [1, Section 4.4]. The language o f h ybr id log ic ha s formulas of the form @ i φ (“ φ is true at i ”), @ x φ (“ φ is true at x ”) and ↓ x.φ (“ φ holds after x is bo und to the current state”), where NOM = { i 1 , . . . } is a set o f no minals, a nd SV AR = { x 1 , . . . } is a set of state v ar iables. The (slig h tly a da pted) tr anslation of a given hybrid formula φ 0 is recur siv ely de fined as follows. τ ( ω ) = ω τ ( i ) = ω i where ω i do es not o ccur in φ 0 τ ( x ) = ω x where ω x do es not o ccur in φ 0 τ ( ¬ φ ) = ¬ τ ( φ ) τ ( φ ∨ ψ ) = τ ( φ ) ∨ τ ( ψ ) τ ([ a ] φ ) = [ a ] τ ( φ ) τ ([ U ] φ ) = [ U ] τ ( φ ) τ (@ i φ ) = h U i ( ω i ∧ τ ( φ )) τ (@ x φ ) = h U i ( ω x ∧ τ ( φ )) τ ( ↓ x.φ ) = [ ω x := g ⊥ ][ ω x := l ⊤ ] τ ( φ ) As the satisfiability problem is undecidable in hybrid logic, membership in L (:= l ) is undecidable, to o. Thirdly , let us consider the set L ( ⋆ ) of all := l -free formulas φ such that C all | = φ . It is still an op en problem whether mem b ership in L ( ⋆ ) is de c ida ble o r not: while the up date actio ns can b e eliminated fro m := l -free formulas, it is not clear whether this ca n b e done for formulas in which e.g. iterations of a s signmen ts o ccur. As for the ax iomatization issue, the equiv alences preceding propo sition 31 provide a sound a nd complete axiom system of L , whereas no axiom system o f L (:= l ) a nd L ( ⋆ ) is known to be so und and complete. 4 Definabilit y of classes of termgraphs F or a ll abs tract actions a , by means o f the update actio ns of the form ω := l φ , we can express the fact that the binary relatio n in ter preting an abstract action of the form a is deterministic, irreflexive or lo cally reflexive. More precisely , for all ro oted ter mgraphs G = ( N , E , L n , L e , S , T , n 0 ), – G | = [ ω := g ⊥ ][ π := g ⊥ ][ U ][ ω := l ⊤ ][ a ][ π := l ⊤ ][ U ]( ω → [ a ] π ) iff R G ( a ) is deterministic, – G | = [ ω := g ⊥ ][ U ][ ω := l ⊤ ][ a ] ¬ ω iff R G ( a ) is irreflexive, – G | = [ ω := g ⊥ ][ ω := l ⊤ ] h a i ω iff R G ( a ) is lo cally reflexive in n 0 . T ogether with the up date actions of the form ω := l φ , the regula r oper a tion “ ⋆ ” enables us to define no n-elemen tar y class e s of ro oted termgra phs. As a fir st example, the class of all infinite ro oted ter mgraphs ca nnot be modally defined in pr opositiona l dyna mic logic but the following formula pins it down: – [ ω := g ⊤ ][( U ; ω ?; ω := l ⊥ ) ⋆ ] h U i ω . As a second exa mple, take the class of all a -cycle-free r ooted termg raphs. It ca n- not be mo dally defined in prop ositional dynamic logic but the following formula pins it down: – [ ω := g ⊤ ][ U ][ ω := l ⊥ ][ a + ] ω . As a third example, within the cla ss of all a -deterministic r ooted termgra phs, the class of all a -c ir cular r ooted termg r aphs 3 cannot b e mo da lly defined in prop osi- tional dyna mic log ic but the following formula pins it down: – [ ω := g ⊥ ][ U ][ ω := l ⊤ ] h a + i ω . Now, within the clas s of all ro oted termgraphs that are bo th a - a nd b -deter ministic, the cla ss of all ( a ≤ b ) ro oted termgra phs 4 cannot b e mo dally defined in prop o- sitional dyna mic logic but the following formula pins it down: – [ ω := g ⊥ ][ ω := l ⊤ ][ π := g ⊥ ][ π := l ⊤ ][(( U ; ω ?; a ; ¬ ω ?; ω := l ⊤ ); ( U ; π ?; b ; ¬ π ?; π := l ⊤ )) ⋆ ]( h U i ( π ∧ [ b ] ⊥ ) → h U i ( ω ∧ [ a ] ⊥ )). Finally , within the class o f all finite ( a ∪ b )-cycle- free ( a, b )-deterministic ro oted termgraphs, the class of all ( a, b )-binary ro oted termgraphs canno t be modally defined in pro positional dyna mic logic but the following formula pins it down: – [ ω := g ⊥ ][ U ][ ω := l ⊤ ][ a ][ π := g ⊤ ][( a ∪ b ) ⋆ ][ π := l ⊥ ][ U ]( ω → [ b ][( a ∪ b ) ⋆ ] π ). Most imp ortan t of all is the ability of the language of the log ic of gr aph mo difiers to ch aracter iz e finite graph ho momorphisms. Prop osition 41 L et G = ( N , E , L n , L e , S , T , n 0 ) b e a finite r o ote d termgr aph. Ther e exists a ⋆ -fr e e action α G and a ⋆ -fr e e formula φ G such that f or al l finite r o ote d t ermgr aphs G ′ = ( N ′ , E ′ , L n ′ , L e ′ , S ′ , T ′ , n ′ 0 ) , G ′ | = h α G i φ G iff ther e exists a gr aph homo morphism fr om G into G ′ . Pr o of. Let G = ( N , E , L n , L e , S , T , n 0 ) b e a finite ro oted termgraph. Suppose that N = { 0 , . . . , N − 1 } and consider a sequence ( π 0 , . . . , π N − 1 ) of pairwise distinct elements of Ω . Ea c h π i will identify exactly one no de of N , a nd π 0 will ident ify the ro ot. W e define the action α G and the formula φ G as follows: – β G = ( π 0 := g ⊥ ); . . . ; ( π N − 1 := g ⊥ ), – for all non-negative integers i , if i < N then γ i G = ( ¬ π 0 ∧ . . . ∧ ¬ π i − 1 )?; ( π i := l ⊤ ); U , – α G = β G ; γ 0 G ; . . . ; γ N − 1 G , 3 In an a -circular ro oted termgraph for every no de n th ere is a n i and there are a 1 , . . . a n such that a = a 1 = a n and n k is related to n k +1 by an edge lab elled a , for all k ≤ i . 4 Ro oted termgraphs are termgraphs where the path obtained by follo wing feature b is longer than or equ al to the path obtained by follo wing feature a . – for all non-negative integers i , if i < N then ψ i G = if L n ( i ) is defined then h U i ( π i ∧ L n ( i )) else ⊤ , – for all non-negative integers i , j , if i, j < N then χ i,j G = if there exis ts an edge e ∈ E such that S ( e ) = i and T ( e ) = j then h U i ( π i ∧ hL e ( e ) i π j ) els e ⊤ , – φ G = ψ 0 G ∧ . . . ∧ ψ N − 1 G ∧ χ 0 , 0 G ∧ . . . ∧ χ N − 1 ,N − 1 G . The r eader may easily verify that for all finite ro oted termgr aphs G ′ = ( N ′ , E ′ , L n ′ , L e ′ , S ′ , T ′ , n ′ 0 ), G ′ | = h α G i φ G iff there exists a g raph homo- morphism fro m G to G ′ . 5 Definabilit y of t r an sformations of termgraphs In this section we sho w how elemen tary actions ov er termgraphs as defined in Section 2 can b e enco ded by means of formulas of the prop osed mo dal logic. Let α a be the action defined as follows: – α a = ( ω := g ⊥ ); ( ω := l ⊤ ); ( π := g ⊥ ); ( π := g h a i ω ); ( a − ( ⊤ , ω )); n ; ( ω := g ⊥ ); ( ω := l ⊤ ); ( a + ( π , ω )). The r eader may easily verify that for all ro oted termgra phs G = ( N , E , L n , L e , S , T , n 0 ) and G ′ = ( N ′ , E ′ , L n ′ , L e ′ , S ′ , T ′ , n ′ 0 ), G − → α a G ′ iff G ′ is obta ine d from G by redirecting every a -edge p oin ting to the curr en t r oot tow ards a freshly created new ro ot. Hence, together with the up date a c tio ns n , n , ω := g φ , ω := l φ , a + ( φ, ψ ) and a − ( φ, ψ ), the regula r op erations “;”, “ ∪ ” a nd “ ⋆ ” ena ble us to define the elementary actions of no de lab elling, lo cal redirectio n and global redirection of Section 2. Let us fir s tly consider the elementary a ction of no de labe lling : n : f ( a 1 ⇒ n 1 , . . . , a k ⇒ n k ). Applying this elementary action consists in redir e c ting towards no des n 1 , . . . , n k the ta r gets o f a 1 -, . . . , a k - edges starting from no de n . It corresp onds to the action nl ( n : f ( a 1 ⇒ n 1 , . . . , a k ⇒ n k )) defined as follows: – n l ( n : f ( a 1 ⇒ n 1 , . . . , a k ⇒ n k )) = U ; π n ?; ( f := l ⊤ ); ( a 1 +( π n , π n 1 )); . . . ; ( a k + ( π n , π n k )). where the π i ’s a re a s in the pr oof o f Prop osition 41. The r eader ma y eas- ily verify that for a ll ro oted ter mgraphs G = ( N , E , L n , L e , S , T , n 0 ), G ′ = ( N ′ , E ′ , L n ′ , L e ′ , S ′ , T ′ , n ′ 0 ), G − → nl ( n : f ( a 1 ⇒ n 1 ,...,a k ⇒ n k )) G ′ iff G ′ is o btained from G by redirecting tow ards no des n 1 , . . . , n k the ta r gets of a 1 -, . . . , a k - edges starting from no de n . Let us secondly consider the elemen ta r y action o f lo cal redirection: n ≫ l a m . Applying this elementary action consists in redirecting tow ards no de m the tar g et o f a n a -edge starting fro m no de n . It co rrespo nds to the a ction lr ( n, a, m ) defined as follows: – l r ( n, a, m ) = ( a − ( π n , ⊤ )); ( a + ( π n , π m )). The reader may easily verify that for all ro oted termgr aphs G = ( N , E , L n , L e , S , T , n 0 ), G ′ = ( N ′ , E ′ , L n ′ , L e ′ , S ′ , T ′ , n ′ 0 ), G − → lr ( n,a,m ) G ′ iff G ′ is obtained from G by redirecting to wards no de m the target o f an a -edge sta rting from no de n . Let us thirdly consider the elemen tary a ction of glo bal redirection: n ≫ g a m . Applying this e le men tary action co nsists in r edirecting tow a r ds no de n the target o f every a -edge p o in ting tow ards no de m . It cor r esponds to the action g r ( n, a, m ) defined as follows: – g r ( n, a, m ) = ( λ a := g ⊥ ); ( λ a := g h a i π n ); ( a − ( ⊤ , π n )); ( a + ( λ a , π m )). The reader may easily verify that for all ro oted termgr aphs G = ( N , E , L n , L e , S , T , n 0 ), G ′ = ( N ′ , E ′ , L n ′ , L e ′ , S ′ , T ′ , n ′ 0 ), G − → gr ( n,a,m ) G ′ iff G ′ is obtained fro m G by redirecting tow ar ds no de n the tar get of every a -edge po in ting tow ards no de m . T o r edirect to wards n the ta rget of all edges p oint ing tow a rds m , the action g r ( n, a , m ) can b e p erformed for all a ∈ F . W e g et g r ( n, m ) = V a ∈F g r ( n, a , m ). 6 T ransla ting rewrite rules in mo da l logic Now we ar e ready to show how termgraph rew r iting can b e sp ecified by means of fo rm ulas o f the pr oposed mo dal log ic. Let G → ( a 1 , . . . , a n ) b e a rewrite rule as defined in Section 2, i.e., G = ( N , E , L n , L e , S , T , n 0 ) is a finite roo ted ter mgraph and ( a 1 , . . . , a n ) is a finite sequence of elementary actions. W e hav e seen how to associa te to G a ⋆ -free action α G and a ⋆ -free formula φ G such that for all finite ro oted termgraphs G ′ = ( N ′ , E ′ , L n ′ , L e ′ , S ′ , T ′ , n ′ 0 ), G ′ | = h α G i φ G iff there exists a gra ph homomorphism from G into G ′ . W e hav e a lso seen how to asso ciate to the elementary actio ns a 1 , . . . , a n actions α 1 , . . . , α n . In the following pr oposition we show how to formulate the fa c t that a nor ma l form with resp ect to a r e write rule (genera lization to a set of rules is o b vious ) sa tisfies a given formula ϕ . A termgr aph t is in nor mal form with resp ect to a rule R iff t canno t be rewr itten b y means of R . Such formulation may help to expr ess pr oof oblig ations of progra ms sp ecified as termgr aph r ewrite rules. Let n 1 , . . . , n k be the list of all no de s o ccurring in a 1 , . . . , a n but not o ccurring in G . The truth of the matter is that Prop osition 61 L et ϕ b e a mo dal formula. F or al l finite r o ote d termgr aphs G ′ = ( N ′ , E ′ , L n ′ , L e ′ , S ′ , T ′ , n ′ 0 ) , every normal form of G ′ with re sp e ct to G → ( a 1 , . . . , a n ) satisfies ϕ iff G ′ | = [( α G ; φ G ?; n ; ( π n 1 := g ⊥ ); ( π n 1 := l ⊤ ); . . . ; n ; ( π n k := g ⊥ ); ( π n k := l ⊤ ); α 1 ; . . . ; α n ) ⋆ ]([ α G ; φ G ?] ⊥ → ϕ ) . Pr o of. ⇐ : Suppo se that G ′ | = [( α G ; φ G ?; n ; ( π n 1 := g ⊥ ); ( π n 1 := l ⊤ ); . . . ; n ; ( π n k := g ⊥ ); ( π n k := l ⊤ ); α 1 ; . . . ; α n ) ⋆ ]([ α G ; φ G ?] ⊥ → ϕ ). Consider a normal form G nf of G ′ with resp ect to G → ( a 1 , . . . , a n ). Then there e x ists a non-negative integer k and there exist finite ro oted termgraphs G 0 , . . . , G k such that: – G 0 = G ′ , – G k = G nf , – for all non-neg ativ e integers i , if i < k then G i → G → ( a 1 ,...,a n ) G i +1 . Hence, fo r all non-negative in tegers i , if i < k then G i − → α G ; φ G ?; n ;( π n 1 := g ⊥ );( π n 1 := l ⊤ ); ... ; n ;( π n k := g ⊥ );( π n k := l ⊤ ); α 1 ; ... ; α n G i +1 . Moreover, seeing that G nf is a norma l f orm with r espect to G → ( a 1 , . . . , a n ), G nf | = [ α G ; φ G ?] ⊥ . Since G ′ | = [( α G ; φ G ?; n ; ( π n 1 := g ⊥ ); ( π n 1 := l ⊤ ); . . . ; n ; ( π n k := g ⊥ ); ( π n k := l ⊤ ); α 1 ; . . . ; α n ) ⋆ ]([ α G ; φ G ?] ⊥ → ϕ ), then G nf | = ϕ . Thus, ev ery normal form of G ′ with r espect to G → ( a 1 , . . . , a n ) sa tisfies ϕ . ⇒ : Supp ose tha t every normal form of G ′ with res pect to G → ( a 1 , . . . , a n ) satisfies ϕ . Let G nf be a finite ro oted termgra ph such that G ′ − → ( α G ; φ G ?; n ;( π n 1 := g ⊥ );( π n 1 := l ⊤ ); ... ; n ;( π n k := g ⊥ );( π n k := l ⊤ ); α 1 ; ... ; α n ) ⋆ G nf and G nf | = [ α G ; φ G ?] ⊥ . Then G nf is a normal form of G ′ with resp ect to G → ( a 1 , . . . , a n ). Hence, G nf satisfies ϕ . Thus, G ′ | = [( α G ; φ G ?; n ; ( π n 1 := g ⊥ ); ( π n 1 := l ⊤ ); . . . ; n ; ( π n k := g ⊥ ); ( π n k := l ⊤ ); α 1 ; . . . ; α n ) ⋆ ]([ α G ; φ G ?] ⊥ → ϕ ). In other resp ects, the following pro position shows how an inv ar ia n t ϕ of a rewr ite rule ca n b e expr essed in the prop osed logic. Prop osition 62 L et ϕ b e a mo dal formula. The r ewrite rule G → ( a 1 , . . . , a n ) str ongly pr eserves ϕ iff | = ϕ → [ α G ; φ G ?; n ; ( π n 1 := g ⊥ ); ( π n 1 := l ⊤ ); . . . ; n ; ( π n k := g ⊥ ); ( π n k := l ⊤ ); α 1 ; . . . ; α n ] ϕ . Pr o of. ⇐ : Suppo se that | = ϕ → [ α G ; φ G ?; n ; ( π n 1 := g ⊥ ); ( π n 1 := l ⊤ ); . . . ; n ; ( π n k := g ⊥ ); ( π n k := l ⊤ ); α 1 ; . . . ; α n ] ϕ . Let G ′ , G ′′ be finite ro oted ter mgraphs such that G ′ | = ϕ and G ′ → G → ( a 1 ,...,a n ) G ′′ . The n G ′ | = [ α G ; φ G ?; n ; ( π n 1 := g ⊥ ); ( π n 1 := l ⊤ ); . . . ; n ; ( π n k := g ⊥ ); ( π n k := l ⊤ ); α 1 ; . . . ; α n ] ϕ and G ′ − → α G ; φ G ?; n ;( π n 1 := g ⊥ );( π n 1 := l ⊤ ); ... ; n ;( π n k := g ⊥ );( π n k := l ⊤ ); α 1 ; ... ; α n G ′′ . Hence, G ′′ | = ϕ . Thus, the rewrite rule G → ( a 1 , . . . , a n ) str ongly preserves ϕ . ⇒ : Supp ose that the rewrite rule G → ( a 1 , . . . , a n ) str ongly pr eserv es ϕ . Let G ′ , G ′′ be finite r ooted termg r aphs such that G ′ | = ϕ and G ′ − → α G ; φ G ?; n ;( π n 1 := g ⊥ );( π n 1 := l ⊤ ); ... ; n ;( π n k := g ⊥ );( π n k := l ⊤ ); α 1 ; ... ; α n G ′′ . Then G ′ → G → ( a 1 ,...,a n ) G ′′ and G ′′ | = ϕ . Thus, | = ϕ → [ α G ; φ G ?; n ; ( π n 1 := g ⊥ ); ( π n 1 := l ⊤ ); . . . ; n ; ( π n k := g ⊥ ); ( π n k := l ⊤ ); α 1 ; . . . ; α n ] ϕ . 7 Conclusion W e ha v e defined a mo dal logic whic h can b e used either (i) to describe data- structures which are p ossibly defined by means of p oin ter s a nd considere d as termgraphs in this pap er, (ii) to sp ecify prog rams defined as rewrite rules which pro cess these data-structures or (iii) to reason ab out data-str uctures themselves and ab out the b ehavior of the co nsidered pr ograms. The features o f the pro - po sed logic are very app ealing. They co n tribute to define a lo gic which captures faithfully the b eha v ior of ter mgraph rewrite systems. They also open new pe r - sp ectiv es for the verification of progr ams manipulating p ointers. Our logic is undecidable in general. This is not surpr ising at all with resp ect to its expressive power. Howev er, this logic is very pr omising in developing new pro of pro cedure regar ding pro p erties of termgra ph r ewrite systems. F or instanc e , we ha ve discussed a first fra gmen t of the logic, consisting of for m ulas without relab elling actions, where v alidity is decidable. F uture work include mainly the inv estigatio n of new decida ble fragments of our logic and their application to progra m verification. References 1. C. A reces , P . Blackburn, and M. Marx. A ro ad-map on complexity for hybrid logics. In J. Flum and M. R odr ´ ıguez-Artalejo, editors, Computer Scienc e L o gic , num b er 1683 in LNCS, pages 307–321, Madrid, Spain, 1999. Springer. Proceedings of the 8th A n n u al Conference of the EACSL, Madrid, September 1999. 2. C. Areces and B. ten Cate. Hyb rid logics. In P . Blackburn, J. v an Ben them, and F. W olter, editors, Handb o ok of Mo dal L o gic , volume 3. Elsevier Science, 2006. 3. G. Aucher, P . Balbiani, L. F ari˜ nas Del Cerro, and A. Herzig. Global and local graph mo difiers. Ele ctr onic Notes in The or etic al Computer Scienc e (ENTCS), Sp e cial issue “Pr o c e e di ngs of the 5th W ork shop on Metho ds f or Mo dalities (M4M5 2007)” , 231:293–30 7, 2009. 4. F. Baader and T. Nipko w. T erm R ewriting and Al l That . Cambridge U niv ersity Press, 1998. 5. H. Barendregt, M. v an Ee kelen, J. Glauert, R . Kennew ay , M. J. Plasmeij er, and M. S leep. T erm graph rewriting. In P ARLE’87 , pages 141–158. Springer V erlag LNCS 259, 1987. 6. R. Caferra, R . Echahed, and N . Peltier. A term-graph clausal logic: Completeness and incompleteness results. Journal of Appl ie d Non-classic al L o gics , 18:373–411, 2008. 7. R. Ec h ahed. Inductively sequ en tial term-graph rewrite systems. In 4th Inter- national Confer enc e on Gr aph T r ansformations (ICGT) , vol ume 521 4 of Le ctur e Notes in Computer Scienc e , p age s 84–98. Springer, 2008. 8. H. Ehrig, G. Engels, H .-J. Kreowski, and G. R ozen b erg, editors. Handb o ok of Gr aph Gr ammars and Computing by Gr aph T r ansformations, V olume 2: Applic ations, L anguages and T o ols . W orld Scientific, 1999. 9. H. Ehrig, H.-J. Kreowski, U. Montanari, and G. Rozenberg, editors. Handb o ok of Gr aph Gr ammars and Computing by Gr aph T r ansformations, V olume 3: Concur- r ency, Par al lelism and Distribution . W orld S cientific, 1999. 10. D. Pl ump. T erm graph rewriting. In H. Ehrig, G. Engels, H. J. Kreowski, and G. Rozenberg, editors, Handb o ok of Gr aph Gr ammars and Computing by Gr aph T r ansformation , vo lume 2, pages 3–61. W orld Scientific, 1999. 11. G. Rozenberg, editor. Handb o ok of Gr aph Gr ammars and Computing by Gr aph T r ansformations, V olume 1: F oundations . W orld Scientific, 1997. 12. J. Tiuryn. Fixed-p oin ts and algebras with infi nitely long expression, part 1, regular algebras. F undamenta Informatic ae , 2:103–1 27, 1978. 13. J. Tiuryn. Fixed-p oints and algebras with infinitely long expression, part 2, µ - clones of regular algebras. F undamenta Inf ormat ic ae , 2(3):317–3 35, 1979.
Original Paper
Loading high-quality paper...
Comments & Academic Discussion
Loading comments...
Leave a Comment