21 #include "effect_visitor.h"
24 using namespace pddl_parser;
39 : pddl_operator_(pddl_operator), positive_effect_(positive)
53 return vector<string>({a});
69 vector<string> sub_effects =
71 res.insert(res.end(), sub_effects.begin(), sub_effects.end());
77 vector<string> sub_effects =
80 res.insert(res.end(), sub_effects.begin(), sub_effects.end());
84 string constants =
"";
86 vector<string> p_strings =
88 if (p_strings.size() != 1) {
90 "expected exactly one");
92 string p_string = p_strings[0];
93 if (p_string[0] ==
'?') {
95 if (p_string.length() <= 1) {
98 params +=
" " + p_string.substr(1);
103 constants +=
" " + p_string;
106 res.push_back(
string(
"(domain-effect"
120 + (positive_effect_ ?
"POSITIVE" :
"NEGATIVE")
std::vector< std::string > operator()(pddl_parser::Atom &a) const
Translate an Atom into a vector of strings.
EffectToCLIPSFactVisitor(const std::string &pddl_operator, bool positive)
Constructor.
Exception thrown by the parser if an error occurs during parsing.
A PDDL formula (either part of a precondition or an effect(.
std::vector< Expression > arguments
The arguments of the predicate or the subformulae of the compound formula.
Atom function
The name of the predicate for atomic formulae, 'and' for a conjunction, 'or' for a disjunction,...