21 #include "effect_visitor.h"
24 using namespace pddl_parser;
39 : pddl_operator_(pddl_operator), positive_effect_(positive)
52 return vector<string>();
65 return vector<string>({a});
81 vector<string> sub_effects =
84 res.insert(res.end(), sub_effects.begin(), sub_effects.end());
90 vector<string> sub_effects =
93 res.insert(res.end(), sub_effects.begin(), sub_effects.end());
97 string constants =
"";
99 vector<string> p_strings =
102 if (p_strings.size() != 1) {
104 "expected exactly one");
106 string p_string = p_strings[0];
107 if (p_string[0] ==
'?') {
109 if (p_string.length() <= 1) {
112 params +=
" " + p_string.substr(1);
117 constants +=
" " + p_string;
120 res.push_back(
string(
"(domain-effect"
134 + (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.
expression_t expression
The expression formula.
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,...