Enum pddl_parser::domain::expression::Expression
source · pub enum Expression {
Atom {
name: String,
parameters: Vec<Parameter>,
},
And(Vec<Expression>),
Not(Box<Expression>),
Assign(Box<Expression>, Box<Expression>),
Increase(Box<Expression>, Box<Expression>),
Decrease(Box<Expression>, Box<Expression>),
ScaleUp(Box<Expression>, Box<Expression>),
ScaleDown(Box<Expression>, Box<Expression>),
BinaryOp(BinaryOp, Box<Expression>, Box<Expression>),
Number(i64),
}Expand description
An enumeration of expressions that can be used in PDDL planning domains and problems.
Variants§
Atom
An atomic expression consisting of a name and an optional list of parameters.
And(Vec<Expression>)
A logical “and” expression that takes a list of sub-expressions as arguments.
Not(Box<Expression>)
A logical “not” expression that takes a single sub-expression as an argument.
Assign(Box<Expression>, Box<Expression>)
An assignment expression that assigns the value of the second sub-expression to the first sub-expression.
Increase(Box<Expression>, Box<Expression>)
An increase expression that increases the value of the first sub-expression by the value of the second sub-expression.
Decrease(Box<Expression>, Box<Expression>)
A decrease expression that decreases the value of the first sub-expression by the value of the second sub-expression.
ScaleUp(Box<Expression>, Box<Expression>)
A scale-up expression that multiplies the value of the first sub-expression by the value of the second sub-expression.
ScaleDown(Box<Expression>, Box<Expression>)
A scale-down expression that divides the value of the first sub-expression by the value of the second sub-expression.
BinaryOp(BinaryOp, Box<Expression>, Box<Expression>)
A binary operation expression that applies a binary operation to two sub-expressions.
Number(i64)
A numeric constant expression.
Implementations§
source§impl Expression
impl Expression
sourcepub fn parse_expression(
input: TokenStream<'_>
) -> IResult<TokenStream<'_>, Expression, ParserError>
pub fn parse_expression( input: TokenStream<'_> ) -> IResult<TokenStream<'_>, Expression, ParserError>
Parse an expression from a token stream.
Trait Implementations§
source§impl Clone for Expression
impl Clone for Expression
source§fn clone(&self) -> Expression
fn clone(&self) -> Expression
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for Expression
impl Debug for Expression
source§impl<'de> Deserialize<'de> for Expression
impl<'de> Deserialize<'de> for Expression
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
source§impl Hash for Expression
impl Hash for Expression
source§impl Ord for Expression
impl Ord for Expression
source§fn cmp(&self, other: &Expression) -> Ordering
fn cmp(&self, other: &Expression) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
source§impl PartialEq<Expression> for Expression
impl PartialEq<Expression> for Expression
source§fn eq(&self, other: &Expression) -> bool
fn eq(&self, other: &Expression) -> bool
self and other values to be equal, and is used
by ==.source§impl PartialOrd<Expression> for Expression
impl PartialOrd<Expression> for Expression
source§fn partial_cmp(&self, other: &Expression) -> Option<Ordering>
fn partial_cmp(&self, other: &Expression) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read more