Fawkes API Fawkes Development Version
pddl_parser::ActionSemantics Class Reference

Functor for semantic checks when parsing actions of a PDDL domain. More...

#include <pddl_semantics.h>

Public Member Functions

Action operator() (const iterator_type &where, const Action &parsed, const Domain &domain) const
 Check whether the parameter list is properly typed and all expressions that express conditions/effects are well-formed in the domain. More...
 

Static Public Member Functions

static bool check_type (const iterator_type &where, const std::string &got, const std::string &expected, const Domain &domain)
 Helper to check whether a type matches the expected one. More...
 
static void check_action_condition (const iterator_type &where, const Expression &expr, const Domain &domain, const Action &action, string_pairs_type &bound_vars)
 Helper to recursively check expression semantics within precondition and effects of actions. More...
 
static void check_action_predicate (const iterator_type &where, const Predicate &pred, const ExpressionType &type, const Domain &domain, const Action &action, string_pairs_type &bound_vars)
 Helper to recursively check expression semantics within predicates. More...
 

Detailed Description

Functor for semantic checks when parsing actions of a PDDL domain.

Definition at line 131 of file pddl_semantics.h.

Member Function Documentation

◆ check_action_condition()

void pddl_parser::ActionSemantics::check_action_condition ( const iterator_type &  where,
const Expression expr,
const Domain domain,
const Action action,
string_pairs_type &  bound_vars 
)
static

Helper to recursively check expression semantics within precondition and effects of actions.

Parameters
wherePosition of the parsed action.
exprExpression to be checked.
domainPartial domain containing everything that was parsed so far.
actionAction containing the expression to check.
bound_varsVariables that are bound through quantified formulas on an upper recursion level.

Definition at line 175 of file pddl_semantics.cpp.

References pddl_parser::QuantifiedFormula::args, pddl_parser::Expression::expression, pddl_parser::QuantifiedFormula::sub_expr, and pddl_parser::Expression::type.

◆ check_action_predicate()

void pddl_parser::ActionSemantics::check_action_predicate ( const iterator_type &  where,
const Predicate pred,
const ExpressionType &  type,
const Domain domain,
const Action action,
string_pairs_type &  bound_vars 
)
static

Helper to recursively check expression semantics within predicates.

Parameters
wherePosition of the parsed action.
predPredicate to be checked.
typeExpression type of the predicate.
domainPartial domain containing everything that was parsed so far.
actionAction containing the expression to check.
bound_varsVariables that are bound through quantified formulas on an upper recursion level.

Definition at line 201 of file pddl_semantics.cpp.

References pddl_parser::Action::action_params, pddl_parser::Predicate::arguments, pddl_parser::Domain::constants, pddl_parser::Predicate::function, and pddl_parser::Domain::predicates.

◆ check_type()

bool pddl_parser::ActionSemantics::check_type ( const iterator_type &  where,
const std::string &  got,
const std::string &  expected,
const Domain domain 
)
static

Helper to check whether a type matches the expected one.

Recursively steps up the type hierarchy until the expected type is found or the topmost level is reached.

Parameters
wherePosition of the parsed action.
gotType that has to be checked.
expectedType that is to be matched.
domainpartial domain containing everything that was parsed so far
Returns
true iff got is a sub-type of/the same type as expected.

Definition at line 155 of file pddl_semantics.cpp.

References pddl_parser::Domain::types.

◆ operator()()

Action pddl_parser::ActionSemantics::operator() ( const iterator_type &  where,
const Action parsed,
const Domain domain 
) const

Check whether the parameter list is properly typed and all expressions that express conditions/effects are well-formed in the domain.

Parameters
wherePosition of the parsed action.
parsedAction that got parsed.
domainPartial domain containing everything that was parsed so far.
Returns
parsed Action.

Definition at line 127 of file pddl_semantics.cpp.

References pddl_parser::Action::action_params, pddl_parser::Action::effect, pddl_parser::Action::precondition, and pddl_parser::Domain::types.


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