Skip to main content

Requirement

Enum Requirement 

Source
pub enum Requirement {
Show 21 variants Strips, Typing, NegativePreconditions, DisjunctivePreconditions, Equality, ExistentialPreconditions, UniversalPreconditions, QuantifiedPreconditions, ConditionalEffects, Fluents, NumericFluents, ObjectFluents, Adl, DurativeActions, DurationInequalities, ContinuousEffects, DerivedPredicates, TimedInitialLiterals, Preferences, Constraints, ActionCosts,
}
Expand description

Domain requirements.

§Usage

Used by Requirements.

§Notes

Some requirements imply others; some are abbreviations for common sets of requirements. If a domain stipulates no requirements, it is assumed to declare a requirement for STRIPS.

§References

  • “Complete BNF description of PDDL 3.1 (completely corrected)”, Daniel L. Kovacs (dkovacs@mit.bme.hu).

Variants§

§

Strips

Basic STRIPS-style adds and deletes.

§

Typing

Allow type names in declarations of variables.

§

NegativePreconditions

Allow not in goal descriptions.

§

DisjunctivePreconditions

Allow or in goal descriptions

§

Equality

Support = as built-in predicate.

§

ExistentialPreconditions

Allow exists in goal descriptions.

§

UniversalPreconditions

Allow forall in goal descriptions

§

QuantifiedPreconditions

§

ConditionalEffects

Allow when in action effects.

§

Fluents

§

NumericFluents

Allow numeric function definitions and use of effects using assignment operators and arithmetic preconditions.

§

ObjectFluents

Allow functions (fluents) whose values are objects rather than numbers.

§

Adl

§

DurativeActions

Allows durative actions. Note that this does not imply NumericFluents.

§

DurationInequalities

Allows duration constraints in durative actions using inequalities.

§

ContinuousEffects

Allows durative actions to affect fluents continuously over the duration of the actions.

§

DerivedPredicates

Allows predicates whose truth value is defined by a formula.

§

TimedInitialLiterals

Allows the initial state to specify literals that will become true at a specified time point. Implies DurativeActions.

§

Preferences

Allows use of preferences in action preconditions and goals.

§

Constraints

Allows use of constraints fields in domain and problem files. These may contain modal operators supporting trajectory constraints.

§

ActionCosts

If this requirement is included in a PDDL specification, the use of numeric fluents is enabled (similar to the NumericFluents requirement).

However, numeric fluents may only be used in certain very limited ways:

  1. Numeric fluents may not be used in any conditions (preconditions, goal conditions, conditions of conditional effects, etc.).
  2. A numeric fluent may only be used as the target of an effect if it is 0-ary and called total-cost. If such an effect is used, then the total-cost fluent must be explicitly initialized to 0 in the initial state.
  3. The only allowable use of numeric fluents in effects is in effects of the form (increase (total-cost) <numeric-term>), where the <numeric-term> is either a nonnegative numeric constant or of the form (<function-symbol> <term>*). (The <term> here is interpreted as shown in the PDDL grammar, i.e. it is a variable symbol or an object constant. Note that this <term> cannot be a <function-term>, even if the object fluents requirement is used.)
  4. No numeric fluent may be initialized to a negative value.
  5. If the problem contains a :metric specification, the objective must be (minimize (total-cost)), or - only if the DurativeActions requirement is also set - to minimize a linear combination of total-cost and total-time with non-negative coefficients.

Note that an action can have multiple effects that increase (total-cost), which is particularly useful in the context of conditional effects.

Also note that these restrictions imply that (total-cost) never decreases throughout plan execution, i.e., action costs are never negative.

Implementations§

Source§

impl Requirement

Source

pub fn contains<T: Borrow<Requirement>>(&self, other: T) -> bool

Returns whether this requirement is other or implies it, e.g. :fluents contains :numeric-fluents.

Source

pub fn as_str(&self) -> &'static str

Returns the PDDL requirement key, e.g. :strips.

Source

pub fn expand(&self) -> &'static [Requirement]

Expands a requirement into the requirements it stands for. This can be helpful when dealing with requirements such as :quantified-preconditions, :fluents and :adl that are shorthands for a set of other requirements; any other requirement expands to itself.

Trait Implementations§

Source§

impl AsRef<str> for Requirement

Source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Borrow<str> for Requirement

Source§

fn borrow(&self) -> &str

Immutably borrows from an owned value. Read more
Source§

impl Clone for Requirement

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Requirement

Source§

impl Debug for Requirement

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Requirement

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Requirement

Available on crate feature serde only.
Source§

fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for Requirement

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Requirement

Source§

impl FromIterator<Requirement> for Requirements

Source§

fn from_iter<T: IntoIterator<Item = Requirement>>(iter: T) -> Self

Creates a value from an iterator. Read more
Source§

impl Hash for Requirement

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for Requirement

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

fn clamp_to<R>(self, range: R) -> Self
where Self: Sized, R: ClampBounds<Self>,

🔬This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range. Read more
Source§

impl Parser for Requirement

Available on crate feature parser only.
Source§

type Item = Requirement

The parsed value; Self except for DurationConstraint, which may be empty.
Source§

fn from_str(input: &str) -> Result<Self::Item, ParseError>

Parses the entire input into the specified Item type. Read more
Source§

impl PartialEq for Requirement

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialEq<&Requirement> for Requirement

Source§

fn eq(&self, other: &&Requirement) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialEq<&str> for Requirement

Source§

fn eq(&self, other: &&str) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialEq<Requirement> for &Requirement

Source§

fn eq(&self, other: &Requirement) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialEq<String> for Requirement

Source§

fn eq(&self, other: &String) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialOrd for Requirement

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Serialize for Requirement

Available on crate feature serde only.
Source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

The requirement’s name without its leading colon, e.g. "strips".

Source§

impl StructuralPartialEq for Requirement

Source§

impl TryFrom<&str> for Requirement

Source§

type Error = UnknownKeyword

The type returned in the event of a conversion error.
Source§

fn try_from(value: &str) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl Visitor<Requirement, RcDoc<'static>> for PrettyRenderer

Available on crate feature pretty only.
Source§

fn visit(&self, value: &Requirement) -> RcDoc<'static>

Visits value and returns the result.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<V, T, O> Accept<V, T, O> for T
where V: Visitor<T, O>,

Source§

fn accept(&self, v: &V) -> O

Lets the visitor v visit self.
Source§

impl<V, T, O> AcceptMut<V, T, O> for T
where V: VisitorMut<T, O>,

Source§

fn accept_mut(&self, v: &mut V) -> O

Lets the mutable visitor v visit self.
Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pretty for T
where T: PrettyVisit,

Source§

fn pretty(&self, width: usize) -> PrettyPrinted<'_, T>

Available on crate feature pretty only.
Wrap self together with a target line width. The returned value implements Display.
Source§

impl<T> PrettyVisit for T
where T: Sealed, PrettyRenderer: Visitor<T, RcDoc<'static>>,

Source§

fn to_doc(&self, r: &PrettyRenderer) -> RcDoc<'static>

Available on crate feature pretty only.
Builds the document for self with the renderer r.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.