1 //////////////////////////////////////////////////////////////////////////////
4 // ADLib, Prop and their related set of tools and documentation are in the
5 // public domain. The author(s) of this software reserve no copyrights on
6 // the source code and any code generated using the tools. You are encouraged
7 // to use ADLib and Prop to develop software, in both academic and commercial
8 // settings, and are free to incorporate any part of ADLib and Prop into
11 // Although you are under no obligation to do so, we strongly recommend that
12 // you give away all software developed using our tools.
14 // We also ask that credit be given to us when ADLib and/or Prop are used in
15 // your programs, and that this notice be preserved intact in all the source
18 // This software is still under development and we welcome any suggestions
19 // and help from the users.
23 //////////////////////////////////////////////////////////////////////////////
25 #ifndef prop_bottomup_pattern_matching_automata_h
26 #define prop_bottomup_pattern_matching_automata_h
28 /////////////////////////////////////////////////////////////////////////////
29 // Bottom up tree matching automata\cite{tree-matching}.
31 // Note: we'll use the index compression techique in\cite{Chase87} and
32 // the match set unifiers in \cite{Lippe}. Please see references
34 /////////////////////////////////////////////////////////////////////////////
37 #include <AD/automata/treeauto.h> // Tree automaton
38 #include <AD/automata/treepat.h> // Tree patterns
40 class BottomUp
: public TreeAutomaton
{
42 BottomUp(const BottomUp
&); // no copy constructor
43 void operator = (const BottomUp
&); // no assignment
47 //////////////////////////////////////////////////////////////////////////
49 //////////////////////////////////////////////////////////////////////////
50 typedef TreeAutomaton Super
;
51 typedef Super::Offset Offset
; // table offsets
52 typedef Super::State State
; // a state in the tree matcher
53 typedef Super::Functor Functor
; // constructor of a term
54 typedef Super::Arity Arity
; // arity of a functor
58 //////////////////////////////////////////////////////////////////////////
59 // Constructor and destructor
60 //////////////////////////////////////////////////////////////////////////
64 //////////////////////////////////////////////////////////////////////////
65 // Compilation and code generation
66 //////////////////////////////////////////////////////////////////////////
67 virtual void compile (TreePatterns
&);
68 virtual const char * algorithm () const;