1 ///////////////////////////////////////////////////////////////////////////////
3 // This file implements the rewriting partial evaluator/supercompiler.
4 // This is used to optimize Prop's rewriting systems.
6 ///////////////////////////////////////////////////////////////////////////////
7 #include <AD/automata/topdowng.h>
17 ///////////////////////////////////////////////////////////////////////////////
19 // The constructors and destructors
21 ///////////////////////////////////////////////////////////////////////////////
22 RewriteMix::RewriteMix() { reduction_limit = 10; }
23 RewriteMix::~RewriteMix() {}
25 ///////////////////////////////////////////////////////////////////////////////
27 // Method to optimize a set of rewrite rules.
28 // Currently, we'll only optimize if there are no other rules
29 // except bottomup rules.
31 ///////////////////////////////////////////////////////////////////////////////
32 void RewriteMix::optimize_rewrite()
33 { if (options.optimize_rewrite && Fmap != 0)
34 { if (Fmap->topdown_rule_map.size() > 0 ||
35 Fmap->preorder_rule_map.size() > 0 ||
36 Fmap->postorder_rule_map.size() > 0 ||
37 Fmap->before_rule_map.size() > 0)
38 { msg("%Lrewrite class %s will not be optimized due to the presence"
39 " of non-bottomup rules\n",Fmap->class_name);
43 msg("%Lpartial evaluating rewrite class %s\n", Fmap->class_name);
46 msg("%Lfinished optimizing rewrite class %s\n", Fmap->class_name);