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.ConditionEquality atom (= O1 O2 ... ON).
BLOCK = EasyType() B1, B2 = EasyParameter(BLOCK), EasyParameter(BLOCK) f = Equal(B1, B2)
Parameters: - arg1 – the first
Objectargument - arg2 – the second
Objectargument - *args –
a list of any remaining
Objectarguments
- arg1 – the first
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.EffectLogical 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.ConditionLogical 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.EffectLogical negation (not P).
CONF = EasyType() AtConf = EasyPredicate(CONF, CONF) Q1 = EasyParameter(CONF) f = Not(AtConf(Q1)))
Parameters: formula – a Formula
stripstream.pddl.logic.predicates module¶
-
class
stripstream.pddl.logic.predicates.EasyPredicate(*types)[source]¶ Bases:
stripstream.pddl.logic.predicates.PredicateAnonymous predicate P which extends
Predicate.CONF = EasyType() AtConf = EasyPredicate(CONF)
Parameters: types – a list of Typeinputs to the predicate-
__call__(*args)¶ Creates an
Atominstance fromargsParameters: args – a list of hashable arguments to selfReturns: Atomwith predicateselfand wrappedObjectargumentsargsRaises: ValueError – if self.typesdoes not match the length ofargs
-
-
class
stripstream.pddl.logic.predicates.EasyFunction(*types)[source]¶ Bases:
stripstream.pddl.logic.predicates.FunctionAnonymous function F which extends
Function.CONF = EasyType() Distance = EasyFunction(CONF, CONF)
Parameters: types – a list of Typeinputs to the predicate-
__call__(*args)¶ Creates an
Atominstance fromargsParameters: args – a list of hashable arguments to selfReturns: Atomwith predicateselfand wrappedObjectargumentsargsRaises: ValueError – if self.typesdoes not match the length ofargs
-
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.EffectUniversal 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
Parameterfree variables - formula – the
Formulawithin the quantifier
- args – a list of
-
class
stripstream.pddl.logic.quantifiers.Exists(args, formula)[source]¶ Bases:
stripstream.pddl.logic.quantifiers.Quantifier,stripstream.pddl.logic.formulas.ConditionExistential 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
Parameterfree variables - formula – the
Formulawithin the quantifier
- args – a list of
Module contents¶
This package contains first-order logical operators.