pub struct EFlintOperator;
Expand description
Defines identifiers for eFLINT operators, as well as the number of operands they require.
Note that iterator operators (FORALL, FOREACH, EXISTS) are defined separately in EFlintIteratorOperator
.
Implementations§
Source§impl EFlintOperator
impl EFlintOperator
Sourcepub const COUNT: &str = "COUNT"
pub const COUNT: &str = "COUNT"
Counts the number of instances generated by a single instance value.
Sourcepub const ENABLED: &str = "ENABLED"
pub const ENABLED: &str = "ENABLED"
Takes a single instance value and checks if that instance can be derived by the current rules. Essentially is EFlintOperator::HOLDS
but without considering postulation.
Sourcepub const GREATER: &str = "GT"
pub const GREATER: &str = "GT"
Compares two numeric values to examine if the first is stricly greater than the second.
Sourcepub const GREATER_OR_EQUALS: &str = "GE"
pub const GREATER_OR_EQUALS: &str = "GE"
Compares two numeric values to examine if the first is greater than- or equal to the second.
Sourcepub const HOLDS: &str = "HOLDS"
pub const HOLDS: &str = "HOLDS"
Essentially inline boolean query, i.e., takes a single instance value and checks if that instance is true.
Sourcepub const LESSER: &str = "LT"
pub const LESSER: &str = "LT"
Compares two numeric values to examine if the first is stricly smaller than the second.
Sourcepub const LESSER_OR_EQUALS: &str = "LE"
pub const LESSER_OR_EQUALS: &str = "LE"
Compares two numeric values to examine if the first is smaller than- or equal to the second.
Sourcepub const MAX: &str = "MAX"
pub const MAX: &str = "MAX"
Returns the maximum value from the instances generated by a single instance value.
Sourcepub const MIN: &str = "MIN"
pub const MIN: &str = "MIN"
Returns the minimum value from the instances generated by a single instance value.
Sourcepub const NOT_EQUALS: &str = "NE"
pub const NOT_EQUALS: &str = "NE"
Checks if two values are not equal (inverse of EFlintOperator::EQUALS
).
Sourcepub const SUM: &str = "SUM"
pub const SUM: &str = "SUM"
Sums the instances generated by a single instance value together to a numeric value.
Sourcepub const VIOLATED: &str = "VIOLATED"
pub const VIOLATED: &str = "VIOLATED"
Takes a single instance value and checks if, if that instantiation were to be added to the knowledge base, it would trigger any violations.
Sourcepub const WHEN: &str = "WHEN"
pub const WHEN: &str = "WHEN"
Filters an instance expression with a boolean expression to keep only the ones that evaluate to true.
Sourcepub const fn logical() -> &'static [&'static str]
pub const fn logical() -> &'static [&'static str]
Returns a list of all the logic operators in eFLINT.
§Returns
A static slice with all logic operators.
Sourcepub const fn comparison() -> &'static [&'static str]
pub const fn comparison() -> &'static [&'static str]
Returns a list of all the comparison operators in eFLINT.
§Returns
A static slice with all comparison operators.
Sourcepub const fn arithmetic() -> &'static [&'static str]
pub const fn arithmetic() -> &'static [&'static str]
Returns a list of all the arithmetic operators in eFLINT.
§Returns
A static slice with all arithmetic operators.
Sourcepub const fn iterator() -> &'static [&'static str]
pub const fn iterator() -> &'static [&'static str]
Returns a list of all the iterator operators in eFLINT.
§Returns
A static slice with all iterator operators.
Sourcepub const fn miscellaneous() -> &'static [&'static str]
pub const fn miscellaneous() -> &'static [&'static str]
Returns a list of all the miscellaneous operators in eFLINT.
§Returns
A static slice with all miscellaneous operators.
Sourcepub fn kind(op: &str) -> ExpressionKind
pub fn kind(op: &str) -> ExpressionKind
Returns the expression kind (boolean or instance) to which the given operator evaluates.
§Arguments
op
: The eFLINT operator to return the expression kind for.
§Returns
An auxillary::ExpressionKind
what denotes which of the two kinds it is.
§Panics
This function panics if the given string is not one of the eFLINT operators.
Sourcepub fn n_operators(op: &str) -> usize
pub fn n_operators(op: &str) -> usize
Trait Implementations§
Source§impl Clone for EFlintOperator
impl Clone for EFlintOperator
Source§fn clone(&self) -> EFlintOperator
fn clone(&self) -> EFlintOperator
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more