symbolic
Public Types | Public Member Functions | List of all members
symbolic::Pddl Class Reference

#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 Stateinitial_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 StateIndexstate_index () const
 
const Formulagoal () const
 

Detailed Description

Main class for manipulating the pddl specification.

Constructor & Destructor Documentation

◆ Pddl() [1/2]

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.

Parameters
domain_pddlPath to the domain pddl.
problem_pddlPddl problem string or path to the problem pddl.
apply_axiomsWhether to apply axioms to the initial state.
See also
Python: symbolic.Pddl.__init__().

◆ Pddl() [2/2]

symbolic::Pddl::Pddl ( const std::string &  domain_pddl)
explicit

Parse the pddl specification from the domain file without a problem.

Parameters
domain_pddlPath to the domain pddl.
See also
Python: symbolic.Pddl.__init__().

Member Function Documentation

◆ ApplyActions()

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.

Parameters
stateCurrent state.
action_callAction calls in the form of "action(obj_a, obj_b)".
Returns
Final state.

@seepython{symbolic.Pddl.execute}

◆ axiom_map()

const AxiomContextMap& symbolic::Pddl::axiom_map ( ) const
inline

Map from context predicate name to vector of axioms.

◆ ConsistentState() [1/2]

PartialState symbolic::Pddl::ConsistentState ( const PartialState state) const

Applies the axioms to the given partial state.

Parameters
stateCurrent partial state.
Returns
Partial state with axioms applied.
See also
Python: symbolic.Pddl.consistent_state().

◆ ConsistentState() [2/2]

State symbolic::Pddl::ConsistentState ( const State state) const

Applies the axioms to the given state.

Parameters
stateCurrent state.
Returns
State with axioms applied.
See also
Python: symbolic.Pddl.consistent_state().

◆ DerivedState()

State symbolic::Pddl::DerivedState ( const State state) const

Apply the derived predicates to the given state.

◆ domain_pddl()

const std::string& symbolic::Pddl::domain_pddl ( ) const
inline

Domain filename.

◆ initial_state()

const State& symbolic::Pddl::initial_state ( ) const
inline

Initial state for planning.

◆ IsGoalSatisfied()

bool symbolic::Pddl::IsGoalSatisfied ( const State state) const
inline

Evaluate whether the goal is satisfied at the given state.

◆ IsValid()

bool symbolic::Pddl::IsValid ( bool  verbose = false,
std::ostream &  os = std::cout 
) const

Evaluate whether the pddl specification is valid using VAL.

Parameters
verbosePrint diagnostic information.
osOutput stream where diagnostic information should be printed.
Returns
Whether the pddl specification is valid.
See also
Python: symbolic.Pddl.is_valid().

◆ IsValidAction()

bool symbolic::Pddl::IsValidAction ( const State state,
const std::string &  action 
) const

Evaluate whether the action's preconditions are satisfied.

Parameters
stateCurrent state.
actionAction call in the form of "action(obj_a, obj_b)".
Returns
Whether the action can be applied to the state.
See also
Python: symbolic.Pddl.is_valid_action().

◆ IsValidPlan()

bool symbolic::Pddl::IsValidPlan ( const std::vector< std::string > &  action_skeleton) const

Evaluate whether the given action skeleton is valid and satisfies the goal.

◆ IsValidState() [1/2]

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.

Parameters
stateCurrent partial state.
Returns
Whether the state is valid.
See also
Python: symbolic.Pddl.is_valid_state().

◆ IsValidState() [2/2]

bool symbolic::Pddl::IsValidState ( const State state) const

Evaluates whether the state satisfies the axioms.

Parameters
stateCurrent state.
Returns
Whether the state is valid.
See also
Python: symbolic.Pddl.is_valid_state().

◆ IsValidTuple()

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.

◆ ListValidActions()

std::vector< std::string > symbolic::Pddl::ListValidActions ( const State state) const

List the valid actions from the given state.

◆ ListValidArguments()

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.

◆ name()

const std::string & symbolic::Pddl::name ( ) const

Pddl domain name.

◆ NextState()

State symbolic::Pddl::NextState ( const State state,
const std::string &  action_call 
) const

Apply an action to the given state.

The action's preconditions are not checked. The resulting state includes derived predicates.

Parameters
stateCurrent state.
action_callAction call in the form of "action(obj_a, obj_b)".
Returns
Next state.
See also
Python: symbolic.Pddl.next_state().

◆ problem_pddl()

const std::string& symbolic::Pddl::problem_pddl ( ) const
inline

Problem filename.


The documentation for this class was generated from the following files: