about summary refs log tree commit diff
path: root/src/fix-ng/fix-expr.hh
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2003-10-30T16·11+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2003-10-30T16·11+0000
commite537844f4ebc53df13f52722fb16bbeb1f4cbd18 (patch)
tree798eeaa266774cb7dde8fb00f3cb0ed0de53c475 /src/fix-ng/fix-expr.hh
parent442b09ea33dcf516a6f5244ed2c362682e1347b0 (diff)
* Bottomup rewrite function.
Diffstat (limited to 'src/fix-ng/fix-expr.hh')
-rw-r--r--src/fix-ng/fix-expr.hh27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/fix-ng/fix-expr.hh b/src/fix-ng/fix-expr.hh
new file mode 100644
index 000000000000..5c50e9170fe5
--- /dev/null
+++ b/src/fix-ng/fix-expr.hh
@@ -0,0 +1,27 @@
+#ifndef __FIXEXPR_H
+#define __FIXEXPR_H
+
+#include <aterm2.h>
+
+#include "util.hh"
+
+
+/* Fix expressions are represented as ATerms.  The maximal sharing
+   property of the ATerm library allows us to implement caching of
+   normals forms efficiently. */
+typedef ATerm Expr;
+
+
+/* Generic bottomup traversal over ATerms.  The traversal first
+   recursively descends into subterms, and then applies the given term
+   function to the resulting term. */
+
+struct TermFun
+{
+    virtual ATerm operator () (ATerm e) = 0;
+};
+
+ATerm bottomupRewrite(TermFun & f, ATerm e);
+
+
+#endif /* !__FIXEXPR_H */