Fawkes API  Fawkes Development Version
precondition_visitor.h
1 /***************************************************************************
2  * precondition_visitor.h - A static visitor to translate a precondition
3  *
4  * Created: Mon 16 Oct 2017 18:33:34 CEST 18:33
5  * Copyright 2017 Till Hofmann <hofmann@kbsg.rwth-aachen.de>
6  ****************************************************************************/
7 
8 /* This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU Library General Public License for more details.
17  *
18  * Read the full text in the LICENSE.GPL file in the doc directory.
19  */
20 
21 #ifndef _PLUGINS_CLIPS_PDDL_PARSER_PRECONDITION_VISITOR_H_
22 #define _PLUGINS_CLIPS_PDDL_PARSER_PRECONDITION_VISITOR_H_
23 
24 #include <pddl_parser/pddl_parser.h>
25 
26 #include <boost/variant/variant.hpp>
27 #include <string>
28 #include <vector>
29 
30 class PreconditionToCLIPSFactVisitor : public boost::static_visitor<std::vector<std::string>>
31 {
32 public:
33  PreconditionToCLIPSFactVisitor(const std::string &parent, int sub_counter, bool is_main = false);
34  std::vector<std::string> operator()(pddl_parser::Atom &a) const;
35  std::vector<std::string> operator()(pddl_parser::Predicate &p) const;
36  std::vector<std::string> operator()(pddl_parser::QuantifiedFormula &q) const;
37 
38 private:
39  std::string parent_;
40  uint sub_counter_;
41  bool is_main_;
42 };
43 
44 #endif /* !PLUGINS_CLIPS_PDDL_PARSER_PRECONDITION_VISITOR_H__ */
Translate a PDDL precondition into CLIPS facts.
PreconditionToCLIPSFactVisitor(const std::string &parent, int sub_counter, bool is_main=false)
Constructor.
std::vector< std::string > operator()(pddl_parser::Atom &a) const
Translate an Atom into a vector of strings.
A PDDL formula (either part of a precondition or an effect(.
Definition: pddl_ast.h:107
A PDDL quantified formula.
Definition: pddl_ast.h:89