Struct conjure_oxide::Reduction
source · #[non_exhaustive]pub struct Reduction {
pub new_expression: Expression,
pub new_top: Expression,
pub symbols: HashMap<Name, DecisionVariable>,
}
Expand description
The result of applying a rule to an expression.
Contains an expression to replace the original, a top-level constraint to add to the top of the constraint AST, and an expansion to the model symbol table.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.new_expression: Expression
§new_top: Expression
§symbols: HashMap<Name, DecisionVariable>
Implementations§
source§impl Reduction
impl Reduction
pub fn new( new_expression: Expression, new_top: Expression, symbols: HashMap<Name, DecisionVariable>, ) -> Reduction
sourcepub fn pure(new_expression: Expression) -> Reduction
pub fn pure(new_expression: Expression) -> Reduction
Represents a reduction with no side effects on the model.
sourcepub fn with_symbols(
new_expression: Expression,
symbols: HashMap<Name, DecisionVariable>,
) -> Reduction
pub fn with_symbols( new_expression: Expression, symbols: HashMap<Name, DecisionVariable>, ) -> Reduction
Represents a reduction that also modifies the symbol table.
sourcepub fn with_top(new_expression: Expression, new_top: Expression) -> Reduction
pub fn with_top(new_expression: Expression, new_top: Expression) -> Reduction
Represents a reduction that also adds a top-level constraint to the model.
pub fn apply(self, model: &mut Model)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Reduction
impl RefUnwindSafe for Reduction
impl Send for Reduction
impl Sync for Reduction
impl Unpin for Reduction
impl UnwindSafe for Reduction
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)