symbolic
|
#include <pddl.h>
Public Types | |
using | ObjectTypeMap = std::unordered_map< std::string, std::vector< Object > > |
using | AxiomContextMap = std::unordered_map< std::string, std::vector< std::weak_ptr< Axiom > >> |
Public Member Functions | |
Pddl (const std::string &domain_pddl, const std::string &problem_pddl, bool apply_axioms=true) | |
Pddl (const std::string &domain_pddl) | |
bool | IsValid (bool verbose=false, std::ostream &os=std::cout) const |
State | NextState (const State &state, const std::string &action_call) const |
State | ApplyActions (const State &state, const std::vector< std::string > &action_calls) const |
State | DerivedState (const State &state) const |
State | ConsistentState (const State &state) const |
PartialState | ConsistentState (const PartialState &state) const |
bool | IsValidAction (const State &state, const std::string &action) const |
bool | IsValidState (const State &state) const |
bool | IsValidState (const PartialState &state) const |
bool | IsValidTuple (const State &state, const std::string &action_call, const State &next_state) const |
bool | IsValidTuple (const std::set< std::string > &state, const std::string &action_call, const std::set< std::string > &next_state) const |
bool | IsGoalSatisfied (const State &state) const |
bool | IsGoalSatisfied (const std::set< std::string > &state) const |
bool | IsValidPlan (const std::vector< std::string > &action_skeleton) const |
std::vector< std::vector< Object > > | ListValidArguments (const State &state, const Action &action) const |
std::vector< std::vector< std::string > > | ListValidArguments (const std::set< std::string > &state, const std::string &action_name) const |
std::vector< std::string > | ListValidActions (const State &state) const |
std::vector< std::string > | ListValidActions (const std::set< std::string > &state) const |
void | AddObject (const std::string &name, const std::string &type) |
void | RemoveObject (const std::string &name) |
const VAL::analysis * | symbol () const |
const std::string & | name () const |
const std::string & | domain_pddl () const |
const std::string & | problem_pddl () const |
const State & | initial_state () const |
void | set_initial_state (State &&state) |
const ObjectTypeMap & | object_map () const |
const std::vector< Object > & | constants () const |
const std::vector< Object > & | objects () const |
const std::vector< Action > & | actions () const |
const std::vector< Predicate > & | predicates () const |
const std::vector< std::shared_ptr< Axiom > > & | axioms () const |
const AxiomContextMap & | axiom_map () const |
const std::vector< DerivedPredicate > & | derived_predicates () const |
const StateIndex & | state_index () const |
const Formula & | goal () const |
Main class for manipulating the pddl specification.
symbolic::Pddl::Pddl | ( | const std::string & | domain_pddl, |
const std::string & | problem_pddl, | ||
bool | apply_axioms = true |
||
) |
Parse the pddl specification from the domain and problem files.
domain_pddl | Path to the domain pddl. |
problem_pddl | Pddl problem string or path to the problem pddl. |
apply_axioms | Whether to apply axioms to the initial state. |
|
explicit |
Parse the pddl specification from the domain file without a problem.
domain_pddl | Path to the domain pddl. |
State symbolic::Pddl::ApplyActions | ( | const State & | state, |
const std::vector< std::string > & | action_calls | ||
) | const |
Execute a sequence of actions from the given state.
The action preconditionss are not checked. The resulting state includes derived predicates.
state | Current state. |
action_call | Action calls in the form of "action(obj_a, obj_b)" . |
@seepython{symbolic.Pddl.execute}
|
inline |
Map from context predicate name to vector of axioms.
PartialState symbolic::Pddl::ConsistentState | ( | const PartialState & | state | ) | const |
Applies the axioms to the given partial state.
state | Current partial state. |
Applies the axioms to the given state.
state | Current state. |
Apply the derived predicates to the given state.
|
inline |
Domain filename.
|
inline |
Initial state for planning.
|
inline |
Evaluate whether the goal is satisfied at the given state.
bool symbolic::Pddl::IsValid | ( | bool | verbose = false , |
std::ostream & | os = std::cout |
||
) | const |
Evaluate whether the pddl specification is valid using VAL.
verbose | Print diagnostic information. |
os | Output stream where diagnostic information should be printed. |
bool symbolic::Pddl::IsValidAction | ( | const State & | state, |
const std::string & | action | ||
) | const |
Evaluate whether the action's preconditions are satisfied.
state | Current state. |
action | Action call in the form of "action(obj_a, obj_b)" . |
bool symbolic::Pddl::IsValidPlan | ( | const std::vector< std::string > & | action_skeleton | ) | const |
Evaluate whether the given action skeleton is valid and satisfies the goal.
bool symbolic::Pddl::IsValidState | ( | const PartialState & | state | ) | const |
Evaluates whether the partial state satisfies the axioms.
Returns false only if a partial state fully satisfies the pre-conditions of the axiom and explicitly does not satisfy the post-conditions. If a proposition in the partial state is unknown, the axiom is assumed to be satisfied.
state | Current partial state. |
bool symbolic::Pddl::IsValidState | ( | const State & | state | ) | const |
Evaluates whether the state satisfies the axioms.
state | Current state. |
bool symbolic::Pddl::IsValidTuple | ( | const State & | state, |
const std::string & | action_call, | ||
const State & | next_state | ||
) | const |
Evaluate whether the (s, a, s') tuple is valid.
std::vector< std::string > symbolic::Pddl::ListValidActions | ( | const State & | state | ) | const |
List the valid actions from the given state.
std::vector< std::vector< Object > > symbolic::Pddl::ListValidArguments | ( | const State & | state, |
const Action & | action | ||
) | const |
List the valid arguments for an action from the given state.
const std::string & symbolic::Pddl::name | ( | ) | const |
Pddl domain name.
Apply an action to the given state.
The action's preconditions are not checked. The resulting state includes derived predicates.
state | Current state. |
action_call | Action call in the form of "action(obj_a, obj_b)" . |
|
inline |
Problem filename.