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),
Forall(Vec<TypedParameter>, Box<Expression>),
Duration(DurationInstant, Box<Expression>),
}
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.
Forall(Vec<TypedParameter>, Box<Expression>)
A forall expression that takes a list of typed parameters and a sub-expression as arguments.
Duration(DurationInstant, Box<Expression>)
A duration expression that takes a duration instant and a sub-expression as arguments. The duration instant can be one of at start
, at end
, or over all
.
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 more