In previous papers we have proposed a graphical query language for expressing traversal recursions in labelled, directed graphs. A fundamental feature of the language is the use of regular expressions to specify constraints on paths in these graphs. When only constants are allowed in regular expressions, it has been shown that these queries can be evaluated efficiently. In this paper, we study the inclusion of variables in regular expressions. We show that efficient evaluation algorithms still exist, and in so doing provide a translation to a class of Datalog programs, the augmented regular chain programs, which can always be factored. This class of programs is incomparable to previously identified classes of factorable programs.
Peter T. Wood