-
Notifications
You must be signed in to change notification settings - Fork 0
/
state.hpp
96 lines (66 loc) · 2.85 KB
/
state.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#ifndef STATE_HPP__
#define STATE_HPP__
class State
{
public:
State( std::stringstream & p_sStream,
unsigned int p_iStateNum,
const TypeTable & p_TypeTable,
const std::vector< FormulaPred > & p_vAllowablePredicates );
State( std::string p_sString,
unsigned int p_iStateNum,
const TypeTable & p_TypeTable,
const std::vector< FormulaPred > & p_vAllowablePredicates );
State( const State & p_Other );
virtual ~State();
int GetStateNum() const;
unsigned int GetNumAtoms() const;
bool Equal( const State & p_Other ) const;
std::vector< TermConstantP > GetConstants() const;
std::string ToStr() const;
std::string ToPddl() const;
std::vector<Substitution *> * GetInstantiations( const FormulaPVec & p_pPrecs,
const Substitution * p_pSub,
const std::set< TermVariableP > & p_vRelVars ) const;
std::vector<Substitution *> * GetInstantiations( const FormulaConjP & p_pPrecs,
const Substitution * p_pSub,
const std::set< TermVariableP > & p_vRelVars ) const;
std::vector<Substitution *> * GetInstantiations( const Operator * p_pOp,
const Substitution * p_pSub ) const;
std::vector<Substitution *> * GetInstantiations( const FormulaPredP & p_pHead,
const FormulaConjP & p_pPrecs,
const Substitution * p_pSub,
const std::set< TermVariableP > & p_vRelVars ) const;
bool IsConsistent( const FormulaP & p_pForm ) const;
bool CouldBeConsistent( const FormulaP & p_pForm ) const;
State * NextState( const Operator * p_pOp, const Substitution * p_pSub ) const;
size_t GetMemSizeMin() const;
size_t GetMemSizeMax() const;
private:
void ApplyEffects( const FormulaP & p_pEff );
void ConstructorInternal( std::stringstream & p_Stream,
const TypeTable & p_TypeTable,
const std::vector< FormulaPred > & p_vAllowablePredicates );
std::vector< Substitution * > *
GetInstantiationsPredicate( const FormulaPVec & p_pPrecs,
const Substitution * p_pSub,
const std::set< TermVariableP > & p_vRelVars ) const;
std::vector< Substitution * > *
GetInstantiationsEquality( const FormulaPVec & p_pPrecs,
const Substitution * p_pSub,
const std::set< TermVariableP > & p_vRelVars ) const;
std::vector< Substitution * > *
GetInstantiationsNegation( const FormulaPVec & p_pPrecs,
const Substitution * p_pSub,
const std::set< TermVariableP > & p_vRelVars ) const;
void GetInstantiationsDoublePredicate( const FormulaPVec & p_pPrecs,
const Substitution * p_pSub,
const FormulaPredP & p_pAtom,
const std::set< TermVariableP > & p_vRelVars,
std::vector< Substitution * > & p_vRet ) const;
std::vector< std::vector< FormulaPredP > > m_vAtoms;
mutable std::vector< TermConstantP > m_vConstants;
int m_iStateNum;
};
bool operator==( const State & p_First, const State & p_Second );
#endif//STATE_HPP__