10 #ifndef SYMBOLIC_NORMAL_FORM_H_
11 #define SYMBOLIC_NORMAL_FORM_H_
19 #include "symbolic/action.h"
20 #include "symbolic/formula.h"
21 #include "symbolic/state.h"
25 struct ConjunctiveFormula;
33 : conjunctions(std::move(conjunctions)) {}
38 const std::vector<Object>& parameters,
39 const std::vector<Object>& arguments)
43 const std::vector<Object>& parameters,
44 const std::vector<Object>& arguments)
46 Create(pddl, symbol, parameters, arguments).value()) {}
49 const std::vector<Object>& parameters,
50 const std::vector<Object>& arguments)
52 Create(pddl, symbol, parameters, arguments).value()) {}
57 bool empty()
const {
return conjunctions.empty(); }
59 static std::optional<DisjunctiveFormula> Create(
61 const std::vector<Object>& parameters,
62 const std::vector<Object>& arguments,
bool apply_axioms =
false) {
63 return Create(pddl, formula.symbol(), parameters, arguments, apply_axioms);
66 static std::optional<DisjunctiveFormula> Create(
67 const Pddl& pddl,
const VAL::goal* symbol,
68 const std::vector<Object>& parameters,
69 const std::vector<Object>& arguments,
bool apply_axioms =
false);
71 static std::optional<DisjunctiveFormula> Create(
72 const Pddl& pddl,
const VAL::effect_lists* symbol,
73 const std::vector<Object>& parameters,
74 const std::vector<Object>& arguments,
bool apply_axioms =
false);
76 static std::optional<DisjunctiveFormula> Create(
const Pddl& pddl,
78 bool apply_axioms =
false);
93 static std::optional<std::pair<DisjunctiveFormula, DisjunctiveFormula>>
95 bool apply_axioms =
false);
97 static std::optional<DisjunctiveFormula> NormalizePreconditions(
98 const Pddl& pddl,
const std::string& action_call,
99 bool apply_axioms =
false);
101 static std::optional<DisjunctiveFormula> NormalizePostconditions(
102 const Pddl& pddl,
const std::string& action_call,
103 bool apply_axioms =
false);
105 static std::optional<DisjunctiveFormula> NormalizeGoal(
106 const Pddl& pddl,
bool apply_axioms =
false);
110 return lhs.conjunctions == rhs.conjunctions;
113 friend std::ostream& operator<<(std::ostream& os,
116 std::vector<Conjunction> conjunctions;
130 friend std::ostream& operator<<(std::ostream& os,
133 std::vector<Disjunction> disjunctions;
142 std::optional<DisjunctiveFormula> Negate(
const Pddl& pddl,
149 #endif // SYMBOLIC_NORMAL_FORM_H_