symbolic.DisjunctiveFormula

class symbolic.DisjunctiveFormula

Bases: pybind11_object

__init__(*args, **kwargs)

Methods

__init__(*args, **kwargs)

normalize_conditions(pddl, action_call[, ...])

Normalize the pre/post conditions of the given action.

normalize_goal(pddl[, apply_axioms])

normalize_postconditions(pddl, action_call)

normalize_preconditions(pddl, action_call[, ...])

Attributes

conjunctions

static normalize_conditions(pddl: symbolic.pysymbolic.Pddl, action_call: str, apply_axioms: bool = False) Optional[Tuple[symbolic.pysymbolic.DisjunctiveFormula, symbolic.pysymbolic.DisjunctiveFormula]]

Normalize the pre/post conditions of the given action.

If either of the conditions are invalid, this function will return an empty optional.

Parameters:
  • pddl – Pddl object.

  • action – Action call in the form of "action(obj_a, obj_b)".

  • apply_axioms – Whether to apply the axioms to the pre/post conditions.

Returns:

Pair of normalized pre/post conditions.

Example

>>> import symbolic
>>> pddl = symbolic.Pddl("../resources/domain.pddl", "../resources/problem.pddl")
>>> symbolic.DisjunctiveFormula.normalize_conditions(pddl, "pick(hook)")
((or
    (and
        inworkspace(hook)
        not inhand(hook)
        not inhand(box)
    )
)
, (or
    (and
        inhand(hook)
        not on(hook, shelf)
        not on(hook, box)
        not on(hook, hook)
        not on(hook, table)
    )
)
)
static normalize_goal(pddl: symbolic.pysymbolic.Pddl, apply_axioms: bool = False) Optional[symbolic.pysymbolic.DisjunctiveFormula]
static normalize_postconditions(pddl: symbolic.pysymbolic.Pddl, action_call: str, apply_axioms: bool = False) Optional[symbolic.pysymbolic.DisjunctiveFormula]
static normalize_preconditions(pddl: symbolic.pysymbolic.Pddl, action_call: str, apply_axioms: bool = False) Optional[symbolic.pysymbolic.DisjunctiveFormula]