00001 #ifndef SUCCESSOR_GENERATOR_H 00002 #define SUCCESSOR_GENERATOR_H 00003 00004 #include <list> 00005 #include <vector> 00006 #include <fstream> 00007 #include <map> 00008 #include <algorithm> 00009 using namespace std; 00010 00011 class GeneratorBase; 00012 class Operator; 00013 class Variable; 00014 00015 class SuccessorGenerator { 00016 private: 00017 GeneratorBase *root; 00018 00019 typedef vector<pair<Variable *, int> > Condition; 00020 GeneratorBase *construct_recursive(int switchVarNo, list<int> &ops); 00021 SuccessorGenerator(const SuccessorGenerator ©); 00022 00023 vector<Condition> conditions; 00024 vector<Condition::const_iterator> next_condition_by_op; 00025 vector<Variable *> varOrder; 00026 00027 // private copy constructor to forbid copying; 00028 // typical idiom for classes with non-trivial destructors 00029 public: 00030 SuccessorGenerator(); 00031 SuccessorGenerator(const vector<Variable *> &variables, 00032 const vector<Operator> &operators); 00033 ~SuccessorGenerator(); 00034 void dump() const; 00035 void generate_cpp_input(ostream &outfile) const; 00036 }; 00037 00038 #endif