## Universal regular path queries (2003)

### Cached

### Download Links

- [www.dcs.warwick.ac.uk]
- [web.comlab.ox.ac.uk]
- [web.comlab.ox.ac.uk]
- [web.comlab.ox.ac.uk]
- [www-users.cs.umn.edu]
- DBLP

### Other Repositories/Bibliography

Venue: | Higher-Order and Symbolic Computation |

Citations: | 13 - 1 self |

### BibTeX

@INPROCEEDINGS{Moor03universalregular,

author = {Oege De Moor and David Lacey and Eric Van Wyk},

title = {Universal regular path queries},

booktitle = {Higher-Order and Symbolic Computation},

year = {2003},

pages = {16--1}

}

### Years of Citing Articles

### OpenURL

### Abstract

Given are a directed edge-labelled graph G with a distinguished node n0, and a regular expression P which may contain variables. We wish to compute all substitutions φ (of symbols for variables), together with all nodes n such that all paths n0 → n are in φ(P). We derive an algorithm for this problem using relational algebra, and show how it may be implemented in Prolog. The motivation for the problem derives from a declarative framework for specifying compiler optimisations. 1 Bob Paige and IFIP WG 2.1 Bob Paige was a long-standing member of IFIP Working Group 2.1 on Algorithmic Languages and Calculi. In recent years, the main aim of this group has been to investigate the derivation of algorithms from specifications by program transformation. Already in the mid-eighties, Bob was way ahead of the pack: instead of applying transformational techniques to well-worn examples, he was applying his theories of program transformation to new problems, and discovering new algorithms [16, 48, 52]. The secret of his success lay partly in his insistence on the study of general algorithm design strategies (in particular

### Citations

4096 |
Introduction to Automata Theory, Languages and Computation
- Hopcroft, Ullman
- 1979
(Show Context)
Citation Context ... 1984) in a calculational style. Again we leave it to the interested reader to work out the detailed definition of G ⊗ P ′. In formal language theory, it is known as the product machine of G and P ′ (=-=Hopcroft and Ullman, 1979-=-, page 59). An example of a graph G , a pattern P , deterministic pattern P ′ and the cross product G⊗P ′ is shown in Figure 3. The final states of the pattern and cross product have thickly drawn edg... |

1347 | Imperative functional programming
- Jones, Wadler
- 1993
(Show Context)
Citation Context ...computed these pairs, we check for each v that each of the ss it is paired up with contains asnal state in F . 4 A Haskell program We now aim to code the procedure given above as a program in Haskell =-=[11]-=-. The algebra [Init ; Step] that was formally derived in the previous section has an obvious interpretation in automata theory: it is the product automaton of thesow graph G = [InitG ; StepG ] with th... |

1023 |
Advanced Compiler Design and Implementation
- Muchnick
- 1997
(Show Context)
Citation Context ...ions, although there have been many proposals, e.g. [4, 10, 17, 25, 31, 41, 43, 61–63]. In a traditional compiler, the optimising transformations are typically performed as rewrites on the flow graph =-=[2, 3, 46]-=-. The difficulty lies in the specification of the necessary side conditions. For example, consider constant propagation. In essence, it is simply the rewrite rule x := y ⇒ x := c where y is a program ... |

307 | Functional programming with bananas, lenses, envelopes, and barbed wire
- Meijer, Fokkinga, et al.
- 1991
(Show Context)
Citation Context ... single pass over xs. Formally, there exists a composite machine G ⊗ P ′ such that a b c a 5,{7,8} 〈([G]), ([P ′ ])〉 = ([G ⊗ P ′ ]) . (5) This identity is affectionately known as the banana-split law =-=[44]-=-. It was not invented to reason about automata, but rather to capture the tupling transformation [23, 54] in a calculational style. Again we leave it to the interested reader to work out the detailed ... |

294 | Index structures for path expressions
- Milo, Suciu
- 1999
(Show Context)
Citation Context ...n requiring that all paths (between the relevant vertices) are in the regular language. It would be interesting to investigate whether the techniques used to speed up existential regular path queries =-=[45]-=- can be adapted for universal queries as well. This connection with database research also follows a lead of Bob Paige: his own language for expressing side conditions of transformations in APTS [49] ... |

184 |
The Synthesizer Generator: A System for Constructing Language-Based Editors
- Teitelbaum, Reps
(Show Context)
Citation Context ...be generated from declarative specifications: for instance, there are commonly used tools for syntax analysis (lex and yacc), for semantic analysis (attribute grammar systems such as FNC-2 and the SG =-=[39, 56]-=-) and also for instruction selection (IBURG [33]). There is however no such widely accepted tool for the declarative specification of optimising transformations, although there have been many proposal... |

140 |
Modern Compiler Implementation in ML
- Appel
- 1997
(Show Context)
Citation Context ...ions, although there have been many proposals, e.g. [4, 10, 17, 25, 31, 41, 43, 61–63]. In a traditional compiler, the optimising transformations are typically performed as rewrites on the flow graph =-=[2, 3, 46]-=-. The difficulty lies in the specification of the necessary side conditions. For example, consider constant propagation. In essence, it is simply the rewrite rule x := y ⇒ x := c where y is a program ... |

118 | Building program optimizers with rewriting strategies
- Visser, Benaissa, et al.
- 1998
(Show Context)
Citation Context ...)). There is however no such widely accepted tool for the declarative specification of optimising transformations, although there have been many proposals, e.g. (Boyle et al., 1987; Bik et al., 1998; =-=Visser et al., 1998-=-; Assmann, 1996; Tjiang and Hennessy, 1992; Klein et al., 1996; Lipps et al., 1988; Faith et al., 1997; Cordy et al., 1995; Whitfield and Soffa, 1997). In a traditional compiler, the optimising transf... |

114 |
Finite differencing of computable expressions
- Paige, Koenig
- 1982
(Show Context)
Citation Context ...ew problems, and discovering new algorithms [16, 48, 52]. The secret of his success lay partly in his insistence on the study of general algorithm design strategies (in particular finite differencing =-=[47, 51]-=- and data structure selection [19]) rather than the study of tiny derivational steps that some of the working group had focussed on. His success in the systematic discovery of new algorithms was in it... |

113 | UnQL : A Query Language and Algebra for Semistructured Data Based on Structural Recursion
- Buneman, Fernandez, et al.
(Show Context)
Citation Context ...ect in the database community. In particular, the query language UnQL provides the possibility of querying hierarchically structured data through the use of regular expressions that contain variables =-=[18]-=-. The queries are existential in that it suffices to find some path that is in the regular language, rather than requiring that all paths (between the relevant vertices) are in the regular language. I... |

111 | Proebsting: Engineering a Simple, Efficient Code Generator Generator
- Fraser, Hanson, et al.
- 1992
(Show Context)
Citation Context ...stance, there are commonly used tools for syntax analysis (lex and yacc), for semantic analysis (attribute grammar systems such as FNC-2 and the SG [39, 56]) and also for instruction selection (IBURG =-=[33]-=-). There is however no such widely accepted tool for the declarative specification of optimising transformations, although there have been many proposals, e.g. [4, 10, 17, 25, 31, 41, 43, 61–63]. In a... |

91 |
Fast Algorithms for Solving Path Problems
- Tarjan
- 1981
(Show Context)
Citation Context ...this motivated the exploration of universal regular path queries. In hindsight it is a very obvious thing to do, given the close connection between path problems, regular algebra and program analysis =-=[6, 60, 61]-=-. It remains to be seen how the algorithm presented here compares in practice with our use of a model checker. Two of us (Van Wyk and Lacey) have been working on a method of proving the correctness of... |

74 | Sharlit–a tool for building optimizers
- Tjiang, Hennessy
- 1992
(Show Context)
Citation Context ...this motivated the exploration of universal regular path queries. In hindsight it is a very obvious thing to do, given the close connection between path problems, regular algebra and program analysis =-=[6, 60, 61]-=-. It remains to be seen how the algorithm presented here compares in practice with our use of a model checker. Two of us (Van Wyk and Lacey) have been working on a method of proving the correctness of... |

74 | An approach for exploring code improving transformations - Whitfield, Soffa - 1997 |

58 |
The weakest prespecification
- Hoare, He
- 1986
(Show Context)
Citation Context ... S ⊆ R. Expressed as an equivalence, that means T ⊆ R/S ≡ T · S ⊆ R , for all T : X ← Y . Readers familiar with relational semantics of imperative programs will recognise the weakest prespecification =-=[34, 35]-=- in this formula. Specification Here is the problem that we wish to solve: compute each node n of the flow graph such that ∀xs ∈ A ∗ : n([G])xs ⇒ xs ∈ L(F , P) . We could also have formulated that req... |

56 |
Data flow analysis as model checking
- Steffen
- 1991
(Show Context)
Citation Context ...ve specified the side conditions of such transformations in a variant of temporal logic [42], inspired by the work of Steffen and his coworkers on specifying data flow analyses through temporal logic =-=[59]-=-. The formulae in temporal logic are verified using a model checker, which also finds instantiations of free variables. We noticed that many of our examples do not use the full power of temporal logic... |

55 | Proving correctness of compiler optimizations by temporal logic
- Lacey, Jones, et al.
- 2002
(Show Context)
Citation Context ... Two of us (Van Wyk and Lacey) have been working on a method of proving the correctness of program transformations whose side conditions are stated in temporal logic, in collaboration with Neil Jones =-=[42-=-]. It was a draft of their paper that prompted the exploration of a simplied formalism for the side conditions. It appears that the proof methods for the temporal formalism carry over without much mod... |

50 | Merging monads and folds for functional programming
- Meijer, Jeuring
- 1995
(Show Context)
Citation Context ...titutions, we attempt to join it with the current substitution . If there are no con icts, the result is Just , and we proceed as before, using a monadic fold operator in lieu of the ordinary foldl [4=-=5-=-]. If, however, the two substitutions andscannot be combined, we have reached a dead end in the search, and the result of query 0 is the empty set. The new type of followers is followers :: FlowGraph... |

46 | Transformational design and implementation of a new efficient solution to the ready simulation problem, Science of Computer Programming 24(3
- Bloom, Paige
- 1995
(Show Context)
Citation Context ...as way ahead of the pack: instead of applying transformational techniques to well-worn examples, he was applying his theories of program transformation to new problems, and discovering new algorithms =-=[16, 48, 52]-=-. The secret of his success lay partly in his insistence on the study of general algorithm design strategies (in particular finite differencing [47, 51] and data structure selection [19]) rather than ... |

42 | Efficient tabling mechanisms for logic programs
- Ramakrishnan, Rao, et al.
- 1995
(Show Context)
Citation Context ...nsformations and the associated path queries are known; the queries are then run when we also have a flow graph to transform. The particular implementation of Prolog that we have chosen is called XSB =-=[55, 58]-=-. It is particularly 11ssuitable for experiments in program transformation and analysis [24]. 3.1 Common Subexpression Elimination Common subexpression elimination is applicable at node N if all paths... |

37 | Elements of a relational theory of datatypes - Backhouse, Hoogendijk |

37 | Imperative program transformation by rewriting
- Lacey, Moor
- 2001
(Show Context)
Citation Context ...rger effort to construct a toolkit for easy experimentation with compiler optimisations. In previous work, we have specified the side conditions of such transformations in a variant of temporal logic =-=[42]-=-, inspired by the work of Steffen and his coworkers on specifying data flow analyses through temporal logic [59]. The formulae in temporal logic are verified using a model checker, which also finds in... |

34 | From regular expressions to DFAs using compressed NFAs
- Chang, Paige
- 1992
(Show Context)
Citation Context ...o see a further exploration of automata and language theory in this style (see also [5, 13, 53]). The application of program transformation to algorithms involving automata was pioneered by Bob Paige =-=[16, 22, 40]-=-. Very recently we became aware that existential regular path queries are a well studied subject in the database community. In particular, the query language UnQL provides the possibility of querying ... |

34 |
Automata in general algebras
- Eilenberg, Wright
- 1967
(Show Context)
Citation Context ...Indeed, fold-left exactly operates like a deterministic state machine, with initial state init and transition relation step. In a pioneering paper on algebra and automata theory, Eilenberg and Wright =-=[30]-=- have shown that fold-left can be generalised to take relational arguments. This has the obvious intuitive interpretation, where each application of step makes a nondeterministic choice among the poss... |

33 |
Programming with invariants
- Paige
- 1986
(Show Context)
Citation Context ...ew problems, and discovering new algorithms [16, 48, 52]. The secret of his success lay partly in his insistence on the study of general algorithm design strategies (in particular finite differencing =-=[47, 51]-=- and data structure selection [19]) rather than the study of tiny derivational steps that some of the working group had focussed on. His success in the systematic discovery of new algorithms was in it... |

31 | O.: Categories, relations and dynamic programming - Moor - 1992 |

30 |
How to Uniformly specify Program Analysis and Transformation
- Assmann
- 1996
(Show Context)
Citation Context ...no such widely accepted tool for the declarative specification of optimising transformations, although there have been many proposals, e.g. (Boyle et al., 1987; Bik et al., 1998; Visser et al., 1998; =-=Assmann, 1996-=-; Tjiang and Hennessy, 1992; Klein et al., 1996; Lipps et al., 1988; Faith et al., 1997; Cordy et al., 1995; Whitfield and Soffa, 1997). In a traditional compiler, the optimising transformations are t... |

30 | der Woude. Relational catamorphisms - Backhouse, Bruin, et al. - 1991 |

30 |
A linear time solution to the single function coarsest partition problem
- Paige, Tarjan, et al.
- 1985
(Show Context)
Citation Context ...as way ahead of the pack: instead of applying transformational techniques to well-worn examples, he was applying his theories of program transformation to new problems, and discovering new algorithms =-=[16, 48, 52]-=-. The secret of his success lay partly in his insistence on the study of general algorithm design strategies (in particular finite differencing [47, 51] and data structure selection [19]) rather than ... |

29 | Regular algebra applied to path finding problems
- Backhouse, Carré
- 1975
(Show Context)
Citation Context ...this motivated the exploration of universal regular path queries. In hindsight it is a very obvious thing to do, given the close connection between path problems, regular algebra and program analysis =-=[6, 60, 61]-=-. It remains to be seen how the algorithm presented here compares in practice with our use of a model checker. Two of us (Van Wyk and Lacey) have been working on a method of proving the correctness of... |

28 | der Woude. Polynomial relators - Backhouse, Bruin, et al. - 1992 |

27 | Viewing a Program Transformation System at Work
- Paige
- 1994
(Show Context)
Citation Context ...n. His success in the systematic discovery of new algorithms was in itself remarkable, but perhaps even more impressive was the fact that he succeeded in automating his derivations in the APTS system =-=[20, 49]-=-. This provided the ultimate proof that he had succeeded in identifying deep principles in algorithm design: an automated derivation leaves no room for cheating. The mechanism for applying transformat... |

27 |
Finite dierencing of computable expressions
- Paige, Koenig
- 1982
(Show Context)
Citation Context ...o new problems, and discovering new algorithms [16, 48, 52]. The secret of his success lay partly in his insistence on the study of general algorithm design strategies (in particularsnite dierencing [=-=47, 51]-=- and data structure selection [19]) rather than the study of tiny derivational steps that some of the working group had focussed on. His success in the systematic discovery of new algorithms was in it... |

26 | der Woude. A relational theory of datatypes. Available from www.cs.nott.ac.uk/∼rcb/papers - Aarts, Backhouse, et al. - 1992 |

22 | More efficient bottom-up multi-pattern matching in trees’. Theoretical Computer Science 106(1), 21–60. ur_path_queries.tex; 28/10/2002; 9:34; p.22 Universal Regular Path Queries 23
- Cai, Paige, et al.
- 1992
(Show Context)
Citation Context ...vation leaves no room for cheating. The mechanism for applying transformations in the APTS system was that of rewrite rules, and a fast pattern matching algorithm (invented, naturally, by Bob himself =-=[21]-=-) provided the basic engine. The rules could have side conditions expressed as queries on a ‘database’ of facts about the program under consideration. The facts in the database could be any result of ... |

21 |
Towards Increased Productivity of Algorithm Implementation
- Cai, Paige
- 1993
(Show Context)
Citation Context ...n. His success in the systematic discovery of new algorithms was in itself remarkable, but perhaps even more impressive was the fact that he succeeded in automating his derivations in the APTS system =-=[20, 49]-=-. This provided the ultimate proof that he had succeeded in identifying deep principles in algorithm design: an automated derivation leaves no room for cheating. The mechanism for applying transformat... |

21 | KHEPERA: A system for rapid implementation of domain specific languages
- Faith, Nyland, et al.
- 1997
(Show Context)
Citation Context ...formations, although there have been many proposals, e.g. (Boyle et al., 1987; Bik et al., 1998; Visser et al., 1998; Assmann, 1996; Tjiang and Hennessy, 1992; Klein et al., 1996; Lipps et al., 1988; =-=Faith et al., 1997-=-; Cordy et al., 1995; Whitfield and Soffa, 1997). In a traditional compiler, the optimising transformations are typically performed as rewrites on the flow graph (Aho et al., 1985; Appel, 1998; Muchni... |

21 |
C.: Design, implementation and evaluation of the FNC-2 attribute grammar system
- Jourdan, Parigot, et al.
- 1990
(Show Context)
Citation Context ...be generated from declarative specifications: for instance, there are commonly used tools for syntax analysis (lex and yacc), for semantic analysis (attribute grammar systems such as FNC-2 and the SG =-=[39, 56]-=-) and also for instruction selection (IBURG [33]). There is however no such widely accepted tool for the declarative specification of optimising transformations, although there have been many proposal... |

18 | Reductivity arguments and program construction - Doornbos - 1996 |

18 | DFA & OPT-metaframe: A toolkit for program analysis and optimization - Klein, Knoop, et al. - 1996 |

16 | Type analysis and data structure selection
- Cai, Facon, et al.
(Show Context)
Citation Context ...ithms [16, 48, 52]. The secret of his success lay partly in his insistence on the study of general algorithm design strategies (in particular finite differencing [47, 51] and data structure selection =-=[19]-=-) rather than the study of tiny derivational steps that some of the working group had focussed on. His success in the systematic discovery of new algorithms was in itself remarkable, but perhaps even ... |

16 | Induction and recursion on datatypes - Doornbos, Backhouse - 1995 |

14 | From dynamic programming to greedy algorithms - Bird, Moor - 1993 |

14 | Future directions in program transformations
- Paige
- 1996
(Show Context)
Citation Context ...am analyses. A major difficulty, which we repeatedly discussed with Bob, was to express the queries in a declarative meta-language, and to maintain the database incrementally as the rules are applied =-=[50]-=-. These remain major problems in the field of automated program transformation, and the present paper is a small contribution towards solving them. We follow Bob’s example in our attempt to derive the... |

13 | Program derivation with verified transformations – a case study
- Keller, Paige
- 1996
(Show Context)
Citation Context ...o see a further exploration of automata and language theory in this style (see also [5, 13, 53]). The application of program transformation to algorithms involving automata was pioneered by Bob Paige =-=[16, 22, 40]-=-. Very recently we became aware that existential regular path queries are a well studied subject in the database community. In particular, the query language UnQL provides the possibility of querying ... |

12 | O.: Solving optimisation problems with catamorphism - Bird, Moor - 1992 |

12 |
Relational Program Derivation and Contextfree Language Recognition
- Bird, Moor
- 1994
(Show Context)
Citation Context ...lem, but the proof turned out to be so pretty that we decided to include it in this paper. It would be interesting to see a further exploration of automata and language theory in this style (see also =-=[5, 13, 53]-=-). The application of program transformation to algorithms involving automata was pioneered by Bob Paige [16, 22, 40]. Very recently we became aware that existential regular path queries are a well st... |

10 |
Real-time simulation of a set machine on a
- Paige
- 1989
(Show Context)
Citation Context ...as way ahead of the pack: instead of applying transformational techniques to well-worn examples, he was applying his theories of program transformation to new problems, and discovering new algorithms =-=[16, 48, 52]-=-. The secret of his success lay partly in his insistence on the study of general algorithm design strategies (in particular finite differencing [47, 51] and data structure selection [19]) rather than ... |

9 | Generic programming with relations and functors - Bird, Hoogendijk, et al. - 1993 |

9 |
Xsb as the natural habitat for general purpose program analysis
- Codish, Demoen, et al.
- 1997
(Show Context)
Citation Context ...ve a flow graph to transform. The particular implementation of Prolog that we have chosen is called XSB [55, 58]. It is particularly 11ssuitable for experiments in program transformation and analysis =-=[24]-=-. 3.1 Common Subexpression Elimination Common subexpression elimination is applicable at node N if all paths from program entry to N can be split into four parts: • First there is a part that we do no... |