with debug
[prop.git] / prop-src / rwmix.cc
blob6aa99f0907ba5cd6ad8097c9f5fc5d30781e9057
1 ///////////////////////////////////////////////////////////////////////////////
2 // This file is generated automatically using Prop (version 2.3.6),
3 // last updated on Nov 2, 1999.
4 // The original source file is "rwmix.pcc".
5 ///////////////////////////////////////////////////////////////////////////////
7 #line 1 "rwmix.pcc"
8 ///////////////////////////////////////////////////////////////////////////////
9 //
10 // This file implements the rewriting partial evaluator/supercompiler.
11 // This is used to optimize Prop's rewriting systems.
13 ///////////////////////////////////////////////////////////////////////////////
14 #include <AD/automata/topdowng.h>
15 #include "ast.h"
16 #include "ir.h"
17 #include "rwmix.h"
18 #include "patenv.h"
19 #include "type.h"
20 #include "funmap.h"
21 #include "options.h"
22 #include "trs.h"
24 ///////////////////////////////////////////////////////////////////////////////
26 // The constructors and destructors
28 ///////////////////////////////////////////////////////////////////////////////
29 RewriteMix::RewriteMix() { reduction_limit = 10; }
30 RewriteMix::~RewriteMix() {}
32 ///////////////////////////////////////////////////////////////////////////////
34 // Method to optimize a set of rewrite rules.
35 // Currently, we'll only optimize if there are no other rules
36 // except bottomup rules.
38 ///////////////////////////////////////////////////////////////////////////////
39 void RewriteMix::optimize_rewrite()
40 { if (options.optimize_rewrite && Fmap != 0)
41 { if (Fmap->topdown_rule_map.size() > 0 ||
42 Fmap->preorder_rule_map.size() > 0 ||
43 Fmap->postorder_rule_map.size() > 0 ||
44 Fmap->before_rule_map.size() > 0)
45 { msg("%Lrewrite class %s will not be optimized due to the presence"
46 " of non-bottomup rules\n",Fmap->class_name);
47 return;
50 msg("%Lpartial evaluating rewrite class %s\n", Fmap->class_name);
51 trs = new TRS(*this);
52 trs->mix();
53 msg("%Lfinished optimizing rewrite class %s\n", Fmap->class_name);
56 #line 49 "rwmix.pcc"
58 ------------------------------- Statistics -------------------------------
59 Merge matching rules = yes
60 Number of DFA nodes merged = 0
61 Number of ifs generated = 0
62 Number of switches generated = 0
63 Number of labels = 0
64 Number of gotos = 0
65 Adaptive matching = enabled
66 Fast string matching = disabled
67 Inline downcasts = enabled
68 --------------------------------------------------------------------------