[493c477] | 1 | /* emacs edit mode for this file is -*- C++ -*- */ |
---|
[2dd068] | 2 | |
---|
| 3 | #ifndef INCL_CF_GENERATOR_H |
---|
| 4 | #define INCL_CF_GENERATOR_H |
---|
| 5 | |
---|
[e4fe2b] | 6 | // #include "config.h" |
---|
[ab4548f] | 7 | |
---|
[2dd068] | 8 | #include "canonicalform.h" |
---|
| 9 | |
---|
| 10 | /*BEGINPUBLIC*/ |
---|
| 11 | |
---|
| 12 | class CFGenerator |
---|
| 13 | { |
---|
| 14 | public: |
---|
| 15 | CFGenerator() {} |
---|
| 16 | virtual ~CFGenerator() {} |
---|
| 17 | virtual bool hasItems() const { return false; } |
---|
| 18 | virtual void reset() {}; |
---|
| 19 | virtual CanonicalForm item() const { return 0; } |
---|
| 20 | virtual void next() {}; |
---|
[99ffd8] | 21 | virtual CFGenerator * clone() const { return new CFGenerator();} |
---|
[2dd068] | 22 | }; |
---|
| 23 | |
---|
| 24 | class FFGenerator : public CFGenerator |
---|
| 25 | { |
---|
| 26 | private: |
---|
| 27 | int current; |
---|
| 28 | public: |
---|
| 29 | FFGenerator() : current(0) {} |
---|
| 30 | ~FFGenerator() {} |
---|
| 31 | bool hasItems() const; |
---|
| 32 | void reset() { current = 0; } |
---|
| 33 | CanonicalForm item() const; |
---|
| 34 | void next(); |
---|
| 35 | void operator++ () { next(); } |
---|
| 36 | void operator++ ( int ) { next(); } |
---|
[99ffd8] | 37 | CFGenerator * clone() const; |
---|
[2dd068] | 38 | }; |
---|
| 39 | |
---|
| 40 | class GFGenerator : public CFGenerator |
---|
| 41 | { |
---|
| 42 | private: |
---|
| 43 | int current; |
---|
| 44 | public: |
---|
| 45 | GFGenerator(); |
---|
| 46 | ~GFGenerator() {} |
---|
| 47 | bool hasItems() const; |
---|
| 48 | void reset(); |
---|
| 49 | CanonicalForm item() const; |
---|
| 50 | void next(); |
---|
| 51 | void operator++ () { next(); } |
---|
| 52 | void operator++ ( int ) { next(); } |
---|
[99ffd8] | 53 | CFGenerator * clone() const; |
---|
[2dd068] | 54 | }; |
---|
| 55 | |
---|
[99ffd8] | 56 | class AlgExtGenerator: public CFGenerator |
---|
[2dd068] | 57 | { |
---|
| 58 | private: |
---|
| 59 | Variable algext; |
---|
[b96e07] | 60 | FFGenerator **gensf; |
---|
| 61 | GFGenerator **gensg; |
---|
[2dd068] | 62 | int n; |
---|
| 63 | bool nomoreitems; |
---|
| 64 | AlgExtGenerator(); |
---|
| 65 | AlgExtGenerator( const AlgExtGenerator & ); |
---|
| 66 | AlgExtGenerator& operator= ( const AlgExtGenerator & ); |
---|
| 67 | public: |
---|
| 68 | AlgExtGenerator( const Variable & a ); |
---|
| 69 | ~AlgExtGenerator(); |
---|
| 70 | |
---|
| 71 | bool hasItems() const { return ! nomoreitems; } |
---|
| 72 | void reset(); |
---|
| 73 | CanonicalForm item() const; |
---|
| 74 | void next(); |
---|
| 75 | void operator++ () { next(); } |
---|
| 76 | void operator++ ( int ) { next(); } |
---|
[99ffd8] | 77 | CFGenerator * clone() const; |
---|
[2dd068] | 78 | }; |
---|
| 79 | |
---|
| 80 | class CFGenFactory |
---|
| 81 | { |
---|
| 82 | public: |
---|
| 83 | static CFGenerator* generate(); |
---|
| 84 | }; |
---|
| 85 | |
---|
| 86 | /*ENDPUBLIC*/ |
---|
| 87 | |
---|
[493c477] | 88 | #endif /* ! INCL_CF_GENERATOR_H */ |
---|