domain_transition_graph.h
Go to the documentation of this file.
00001 #ifndef DOMAIN_TRANSITION_GRAPH_H
00002 #define DOMAIN_TRANSITION_GRAPH_H
00003 
00004 #include <set>
00005 #include "operator.h"
00006 #include <tr1/tuple>
00007 
00008 using namespace std;
00009 
00010 class Axiom_relational;
00011 class Variable;
00012 
00013 class DomainTransitionGraph {
00014     public:
00015         typedef std::tr1::tuple<const Variable*, double, condition_type> Edge;
00016 
00017         struct CompareCondsIgnoringType {
00018             bool operator()(const Edge& lhs, const Edge& rhs) const {
00019                 if(std::tr1::get<0>(lhs) < std::tr1::get<0>(rhs))
00020                     return true;
00021                 else if(std::tr1::get<0>(lhs) > std::tr1::get<0>(rhs))
00022                     return false;
00023                 if(std::tr1::get<1>(lhs) < std::tr1::get<1>(rhs))
00024                     return true;
00025                 else
00026                     return false;
00027             }
00028         };
00029 
00030         typedef set<Edge, CompareCondsIgnoringType> SetEdgeCondition;
00031         typedef vector<std::tr1::tuple<const Variable *, double, condition_type> > EdgeCondition;
00032 
00033         virtual ~DomainTransitionGraph() {};
00034 
00035         virtual void addTransition(int from, int to, const Operator &op,
00036                 int op_index, trans_type type, vector<Variable *> variables) = 0;
00037         virtual void addAxRelTransition(int from, int to, const Axiom_relational &ax,
00038                 int ax_index) = 0;
00039         virtual void finalize() = 0;
00040         virtual void dump() const = 0;
00041         virtual void generate_cpp_input(ostream &outfile) const = 0;
00042         virtual bool is_strongly_connected() const = 0;
00043 
00044 };
00045 
00046 class DomainTransitionGraphModule: public DomainTransitionGraph
00047 {
00048         void addTransition(int from, int to, const Operator &op, int op_index,
00049                 trans_type type, vector<Variable *> variables)
00050         {
00051         }
00052         void addAxRelTransition(int from, int to, const Axiom_relational &ax,
00053                 int ax_index)
00054         {
00055         }
00056         void finalize()
00057         {
00058         }
00059         void dump() const
00060         {
00061         }
00062         void generate_cpp_input(ostream &outfile) const
00063         {
00064             outfile << 0 << endl;
00065         }
00066         bool is_strongly_connected() const
00067         {
00068             return false;
00069         }
00070 
00071 };
00072 
00073 extern void build_DTGs(const vector<Variable *> &varOrder,
00074         const vector<Operator> &operators, const vector<Axiom_relational> &axioms,
00075         const vector<Axiom_functional> &axioms_func,
00076         vector<DomainTransitionGraph*> &transition_graphs);
00077 extern bool are_DTGs_strongly_connected(
00078         const vector<DomainTransitionGraph*> &transition_graphs);
00079 
00080 #endif


tfd_modules
Author(s): Maintained by Christian Dornhege (see AUTHORS file).
autogenerated on Mon Oct 6 2014 07:52:06