pub enum FluentExpression {
Number(Number),
Function(FunctionHead),
Negative(Box<FluentExpression>),
BinaryOp(BinaryOp, Box<FluentExpression>, Box<FluentExpression>),
MultiOp(MultiOp, Box<FluentExpression>, Vec<FluentExpression>),
}Expand description
A function/fluent expression used e.g. in a DurationValue.
§Requirements
Requires Numeric Fluents.
§Usage
Used by FluentExpression itself, as well as PrimitiveEffect, DurationValue,
DurativeActionFluentExpression and TimedFluentExpression.
Variants§
Number(Number)
A numerical expression.
Function(FunctionHead)
A function that derives a value.
Negative(Box<FluentExpression>)
The negative value of a fluent expression.
BinaryOp(BinaryOp, Box<FluentExpression>, Box<FluentExpression>)
An operation applied to two fluent expressions.
MultiOp(MultiOp, Box<FluentExpression>, Vec<FluentExpression>)
An operation applied to two or more fluent expressions, with at least two
in the Vec; see multi_op for fewer.
Implementations§
Source§impl FluentExpression
impl FluentExpression
Sourcepub fn new_number<N: Into<Number>>(number: N) -> Self
pub fn new_number<N: Into<Number>>(number: N) -> Self
Creates a numeric literal.
Sourcepub fn binary_op(
op: BinaryOp,
lhs: FluentExpression,
rhs: FluentExpression,
) -> Self
pub fn binary_op( op: BinaryOp, lhs: FluentExpression, rhs: FluentExpression, ) -> Self
Creates a binary operation, (<binary-op> <f-exp> <f-exp>).
Sourcepub fn new_binary_op(
op: BinaryOp,
lhs: FluentExpression,
rhs: FluentExpression,
) -> Self
pub fn new_binary_op( op: BinaryOp, lhs: FluentExpression, rhs: FluentExpression, ) -> Self
Creates a binary operation, (<binary-op> <f-exp> <f-exp>).
Sourcepub fn multi_op<I: IntoIterator<Item = FluentExpression>>(
op: MultiOp,
lhs: FluentExpression,
rhs: I,
) -> Self
pub fn multi_op<I: IntoIterator<Item = FluentExpression>>( op: MultiOp, lhs: FluentExpression, rhs: I, ) -> Self
Creates an operation over two or more operands, (<multi-op> <f-exp> <f-exp>+).
(<multi-op> a b) is a binary operation and (<multi-op> a) isn’t PDDL, so
with one operand in rhs this returns the equal BinaryOp, and with none
it returns lhs. The result then prints and parses back to an equal value.
Sourcepub fn new_multi_op<I: IntoIterator<Item = FluentExpression>>(
op: MultiOp,
lhs: FluentExpression,
rhs: I,
) -> Self
pub fn new_multi_op<I: IntoIterator<Item = FluentExpression>>( op: MultiOp, lhs: FluentExpression, rhs: I, ) -> Self
Creates an operation over two or more operands, (<multi-op> <f-exp> <f-exp>+).
Sourcepub fn negative(value: FluentExpression) -> Self
pub fn negative(value: FluentExpression) -> Self
Creates a negation, (- <f-exp>).
Sourcepub fn new_negative(value: FluentExpression) -> Self
pub fn new_negative(value: FluentExpression) -> Self
Creates a negation, (- <f-exp>).
Sourcepub const fn function(f_head: FunctionHead) -> Self
pub const fn function(f_head: FunctionHead) -> Self
Creates a fluent expression from a function head.
Sourcepub fn new_function(f_head: FunctionHead) -> Self
pub fn new_function(f_head: FunctionHead) -> Self
Creates a fluent expression from a function head.
Trait Implementations§
Source§impl Clone for FluentExpression
impl Clone for FluentExpression
Source§impl Debug for FluentExpression
impl Debug for FluentExpression
Source§impl<'de> Deserialize<'de> for FluentExpression
Available on crate feature serde only.
impl<'de> Deserialize<'de> for FluentExpression
serde only.Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Source§impl From<FluentExpression> for DurationValue
impl From<FluentExpression> for DurationValue
Source§fn from(value: FluentExpression) -> Self
fn from(value: FluentExpression) -> Self
Source§impl From<FluentExpression> for DurativeActionFluentExpression
impl From<FluentExpression> for DurativeActionFluentExpression
Source§fn from(value: FluentExpression) -> Self
fn from(value: FluentExpression) -> Self
Source§impl From<FluentExpression> for TimedFluentExpression
impl From<FluentExpression> for TimedFluentExpression
Source§fn from(value: FluentExpression) -> Self
fn from(value: FluentExpression) -> Self
Source§impl Parser for FluentExpression
Available on crate feature parser only.
impl Parser for FluentExpression
parser only.Source§type Item = FluentExpression
type Item = FluentExpression
Self except for
DurationConstraint, which may be empty.Source§impl PartialEq for FluentExpression
impl PartialEq for FluentExpression
Source§impl Serialize for FluentExpression
Available on crate feature serde only.
impl Serialize for FluentExpression
serde only.impl StructuralPartialEq for FluentExpression
Source§impl Visitor<FluentExpression, RcDoc<'static>> for PrettyRenderer
Available on crate feature pretty only.
impl Visitor<FluentExpression, RcDoc<'static>> for PrettyRenderer
pretty only.Source§fn visit(&self, value: &FluentExpression) -> RcDoc<'static>
fn visit(&self, value: &FluentExpression) -> RcDoc<'static>
value and returns the result.Auto Trait Implementations§
impl Forget for FluentExpression
impl Freeze for FluentExpression
impl Move for FluentExpression
impl RefUnwindSafe for FluentExpression
impl Send for FluentExpression
impl Sync for FluentExpression
impl Unpin for FluentExpression
impl UnsafeUnpin for FluentExpression
impl UnwindSafe for FluentExpression
Blanket Implementations§
Source§impl<V, T, O> AcceptMut<V, T, O> for Twhere
V: VisitorMut<T, O>,
impl<V, T, O> AcceptMut<V, T, O> for Twhere
V: VisitorMut<T, O>,
Source§fn accept_mut(&self, v: &mut V) -> O
fn accept_mut(&self, v: &mut V) -> O
v visit self.Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Pretty for Twhere
T: PrettyVisit,
impl<T> Pretty for Twhere
T: PrettyVisit,
Source§impl<T> PrettyVisit for T
impl<T> PrettyVisit for T
Source§fn to_doc(&self, r: &PrettyRenderer) -> RcDoc<'static>
fn to_doc(&self, r: &PrettyRenderer) -> RcDoc<'static>
pretty only.self with the renderer r.