gcc config
[prop.git] / prop-src / rwmix.ph.old
blob22a8de78b106e2677bce444bcd7b9d9494e2bbc6
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 //  This file defines the rewriting partial evaluator
4 //
5 ///////////////////////////////////////////////////////////////////////////////
6 #ifndef rewriting_mix_h
7 #define rewriting_mix_h
9 #include "ast.h"
10 #include "ir.h"
11 #include "rwgen.h"
13 ///////////////////////////////////////////////////////////////////////////////
15 //  The rewriting partial evaluator
17 ///////////////////////////////////////////////////////////////////////////////
18 class RewriteMix : public virtual RewritingCompiler
19 {  RewriteMix (const RewriteMix&);     // no copy constructor
20    void operator = (const RewriteMix&);  // no assignment
21 private:
22    int reduction_limit;
23 public:
24             RewriteMix();
25    virtual ~RewriteMix();
27    virtual MatchRules optimize_rewrite (Id, MatchRules);
29 private:
30    ////////////////////////////////////////////////////////////////////////////
31    //
32    //  Private methods
33    //
34    ////////////////////////////////////////////////////////////////////////////
35    enum Result { SUCCESS, FAILURE, UNKNOWN };
37    MatchRules mix (MatchRules);
39    ////////////////////////////////////////////////////////////////////////////
40    //
41    //  Pattern matching methods.
42    //
43    ////////////////////////////////////////////////////////////////////////////
44    Result pmatch (Pat, Exp);
45    Result pmatch (Pats, Exps);
46    Result pmatch (LabPats, LabExps);
47    Result pmatch (Exp, MatchRule);
49    ////////////////////////////////////////////////////////////////////////////
50    //
51    //  Normalization methods.
52    //
53    ////////////////////////////////////////////////////////////////////////////
54    Exp normalize (Exp, MatchRules, Bool&);
55    Result reduce (Exp, MatchRules, Exp&);
57    ////////////////////////////////////////////////////////////////////////////
58    //
59    //  Simplication methods.
60    //
61    ////////////////////////////////////////////////////////////////////////////
62    Exp simplify  (Exp, Exp = NOexp);
65 #endif