stripstream.pddl.logic package

Submodules

stripstream.pddl.logic.atoms module

class stripstream.pddl.logic.atoms.Equal(arg1, arg2, *args)[source]

Bases: stripstream.pddl.logic.formulas.Formula, stripstream.pddl.logic.formulas.Condition

Equality atom (= O1 O2 ... ON).

BLOCK = EasyType()
B1, B2 = EasyParameter(BLOCK), EasyParameter(BLOCK)

f = Equal(B1, B2)
Parameters:
  • arg1 – the first Object argument
  • arg2 – the second Object argument
  • *args

    a list of any remaining Object arguments

class stripstream.pddl.logic.atoms.Cost(cost)[source]

Bases: stripstream.pddl.logic.atoms.Increase

Increase cost atom (increase total-cost F) which extends Function by setting function to be TotalCost().

Parameters:cost – the numeric or Function amount that TotalCost() increases

stripstream.pddl.logic.connectives module

class stripstream.pddl.logic.connectives.And(*formulas)[source]

Bases: stripstream.pddl.logic.connectives.Connective, stripstream.pddl.logic.formulas.Condition, stripstream.pddl.logic.formulas.Effect

Logical conjunction (and P1 P2 ... PN).

BLOCK, POSE = EasyType(), EasyType()
AtPose = EasyPredicate(BLOCK, POSE)
CollisionFree = EasyPredicate(POSE, POSE)
B2 = EasyParameter(BLOCK)
P1, P2 = EasyParameter(POSE), EasyParameter(POSE)

f = And(AtPose(B2, P2), CollisionFree(P1, P2))

Logical connective abstract class.

Parameters:formulas – a list of Formula
class stripstream.pddl.logic.connectives.Or(*formulas)[source]

Bases: stripstream.pddl.logic.connectives.Connective, stripstream.pddl.logic.formulas.Condition

Logical disjunction (or P1 P2 ... PN).

BLOCK, POSE = EasyType(), EasyType()
CollisionFree = EasyPredicate(BLOCK, POSE)
B1, B2 = EasyParameter(BLOCK), EasyParameter(BLOCK)
P1, P2 = EasyParameter(POSE)

f = Or(Equal(B1, B2), Safe(B2, P1)))

Logical connective abstract class.

Parameters:formulas – a list of Formula
class stripstream.pddl.logic.connectives.Not(formula)[source]

Bases: stripstream.pddl.logic.connectives.Connective, stripstream.pddl.logic.formulas.Condition, stripstream.pddl.logic.formulas.Effect

Logical negation (not P).

CONF = EasyType()
AtConf = EasyPredicate(CONF, CONF)
Q1 = EasyParameter(CONF)

f = Not(AtConf(Q1)))
Parameters:formula – a Formula
class stripstream.pddl.logic.connectives.When(formula1, formula2)[source]

Bases: stripstream.pddl.logic.connectives.Connective, stripstream.pddl.logic.formulas.Effect

Logical implication (when P1 P2).

Parameters:
  • formula1 – a Formula for the antecedent
  • formula2 – a Formula for the consequent

stripstream.pddl.logic.predicates module

class stripstream.pddl.logic.predicates.EasyPredicate(*types)[source]

Bases: stripstream.pddl.logic.predicates.Predicate

Anonymous predicate P which extends Predicate.

CONF = EasyType()
AtConf = EasyPredicate(CONF)
Parameters:types – a list of Type inputs to the predicate
__call__(*args)

Creates an Atom instance from args

Parameters:args – a list of hashable arguments to self
Returns:Atom with predicate self and wrapped Object arguments args
Raises:ValueError – if self.types does not match the length of args
class stripstream.pddl.logic.predicates.EasyFunction(*types)[source]

Bases: stripstream.pddl.logic.predicates.Function

Anonymous function F which extends Function.

CONF = EasyType()
Distance = EasyFunction(CONF, CONF)
Parameters:types – a list of Type inputs to the predicate
__call__(*args)

Creates an Atom instance from args

Parameters:args – a list of hashable arguments to self
Returns:Atom with predicate self and wrapped Object arguments args
Raises:ValueError – if self.types does not match the length of args

stripstream.pddl.logic.quantifiers module

class stripstream.pddl.logic.quantifiers.ForAll(args, formula)[source]

Bases: stripstream.pddl.logic.quantifiers.Quantifier, stripstream.pddl.logic.formulas.Condition, stripstream.pddl.logic.formulas.Effect

Universal quantifier (forall (X1 X2 ... XN) P).

Example safe for all blocks formula:

BLOCK, POSE = EasyType(), EasyType()
Safe = EasyPredicate(BLOCK, POSE)
B1, B2 = EasyParameter(BLOCK), EasyParameter(BLOCK)
P1 = EasyParameter(POSE)

f = ForAll([B2], Or(Equal(B1, B2), Safe(B2, P1)))

Quantifier abstract class.

Parameters:
  • args – a list of Parameter free variables
  • formula – the Formula within the quantifier
class stripstream.pddl.logic.quantifiers.Exists(args, formula)[source]

Bases: stripstream.pddl.logic.quantifiers.Quantifier, stripstream.pddl.logic.formulas.Condition

Existential quantifier (exists (X1 X2 ... XN) P).

Example collision free for some pose formula:

BLOCK, POSE = EasyType(), EasyType()
AtPose = EasyPredicate(BLOCK, POSE)
CollisionFree = EasyPredicate(POSE, POSE)
B2 = EasyParameter(BLOCK)
P1, P2 = EasyParameter(POSE), EasyParameter(POSE)

f = Exists([P2], And(AtPose(B2, P2), CollisionFree(P1, P2)))

Quantifier abstract class.

Parameters:
  • args – a list of Parameter free variables
  • formula – the Formula within the quantifier

Module contents

This package contains first-order logical operators.