stripstream.pddl package

Submodules

stripstream.pddl.objects module

show-inheritance:
 
class stripstream.pddl.objects.EasyType[source]

Bases: stripstream.pddl.objects.Type

Anonymous type which extends Type by automatically generating a unique name.

CONF = EasyType()
class stripstream.pddl.objects.EasyParameter(type)[source]

Bases: stripstream.pddl.objects.Parameter

Anonymous parameter which extends Parameter by automatically generating a unique name.

CONF = EasyType()
Q = EasyParameter(CONF)
Parameters:type – the Type of the parameter

stripstream.pddl.operators module

class stripstream.pddl.operators.Action(name, parameters, condition, effect, cost=None)[source]

Bases: stripstream.pddl.operators.Operator

PDDL action class.

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

a = Action(name='move', parameters=[Q1, Q2],
           condition=AtConf(Q1),
           effect=And(AtConf(Q2), Not(AtConf(Q1))))
Parameters:
  • name – the name of the action
  • parameters – a list of Parameter
  • condition – a Condition
  • effect – an Effect
  • cost – a numeric cost
class stripstream.pddl.operators.STRIPSAction(name, parameters, conditions, effects, cost=None)[source]

Bases: stripstream.pddl.operators.Action, stripstream.pddl.operators.STRIPS

STRIPS action class which extends Action by assuming condition and effect are conjunctions of literals.

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

a = Action(name='move', parameters=[Q1, Q2],
           conditions=[AtConf(Q1)],
           effects=[AtConf(Q2), Not(AtConf(Q1))])
Parameters:
  • name – the string name of the action
  • parameters – a list of Parameter
  • conditions – a list of Atom or Not
  • effects – a list of Atom or Not
  • cost – a numeric cost
class stripstream.pddl.operators.Axiom(effect, condition)[source]

Bases: stripstream.pddl.operators.Operator

PDDL axiom (derived predicate).

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

x = Axiom(effect=Safe(B2, P1),
          condition=Exists([P2], And(AtPose(B2, P2), CollisionFree(P1, P2))))
Parameters:
  • effect – the Atom derived predicate
  • condition – a Condition
class stripstream.pddl.operators.STRIPSAxiom(conditions, effects)[source]

Bases: stripstream.pddl.operators.Axiom, stripstream.pddl.operators.STRIPS

STRIPS axiom class which extends Axiom by assuming condition is a conjunction of literals.

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

x = Axiom(conditions=[AtPose(B2, P2), CollisionFree(P1, P2)],
          effects=[Safe(B2, P1)])
Parameters:
  • conditions – a list of Atom or Not
  • effects – a list of Atom or Not

stripstream.pddl.cond_streams module

class stripstream.pddl.cond_streams.EasyGenStream(inputs, outputs, conditions, effects, generator, **kwargs)[source]

Bases: stripstream.pddl.cond_streams.ConditionalStream

Conditional stream given by a generator.

Example for inverse kinematics:

CONF, POSE = EasyType(), EasyType()
LegalKin = EasyPredicate(POSE, CONF)
Q, P = EasyParameter(CONF), EasyParameter(POSE)

cs = EasyGenStream(inputs=[P], outputs=[Q], conditions=[], effects=[LegalKin(P, Q)],
                   generator=lambda p: iter([p]))
Parameters:
  • inputs – a list of Parameter which are the inputs to generator
  • outputs – a list of Parameter which are the outputs from generator
  • conditions – a list of Atom forming a conjunctive condition on inputs
  • effects – a list of Atom forming a conjunctive effect on inputs and outputs
  • generator – a function from values for inputs to a generator for values of outputs
  • kwargs – keyword arguments for ConditionalStream
class stripstream.pddl.cond_streams.EasyTestStream(inputs, conditions, effects, test, **kwargs)[source]

Bases: stripstream.pddl.cond_streams.ConditionalStream

Conditional stream given by a test.

Example for collision checking:

POSE = EasyType()
CollisionFree = EasyPredicate(POSE, POSE)
P1, P1 = EasyParameter(POSE), EasyParameter(POSE)

cs = EasyTestStream(inputs=[P1, P2], conditions=[], effects=[CollisionFree(P1, P2)],
                    test=lambda p1, p2: p1 != p2)
Parameters:
  • inputs – a list of Parameter which are the inputs to test
  • conditions – a list of Atom forming a conjunctive condition on inputs
  • effects – a list of Atom forming a conjunctive effect on inputs
  • test – a function from values for inputs to {False, True}
  • kwargs – keyword arguments for ConditionalStream
class stripstream.pddl.cond_streams.EasyFnStream(inputs, outputs, conditions, effects, function, test=<function <lambda>>, **kwargs)[source]

Bases: stripstream.pddl.cond_streams.ConditionalStream

Conditional stream given by a function.

Parameters:
  • inputs – a list of Parameter which are the inputs to generator
  • outputs – a list of Parameter which are the outputs from generator
  • conditions – a list of Atom forming a conjunctive condition on inputs
  • effects – a list of Atom forming a conjunctive effect on inputs and outputs
  • function – a function from values for inputs to values of outputs
  • test – an optional function from values for inputs to {False, True} # TODO
  • kwargs – keyword arguments for ConditionalStream

Module contents

This package contains the source for a PDDL representation of a STRIPStream problem.