pub enum MergeFn {
AssertEq,
UnionId,
Primitive(ExternalFunctionId, Vec<MergeFn>),
Function(FunctionId, Vec<MergeFn>),
Old,
New,
Const(Value),
}Expand description
How to resolve FD conflicts for a table.
Variants§
AssertEq
Panic if the old and new values don’t match.
UnionId
Use congruence to resolve FD conflicts.
Primitive(ExternalFunctionId, Vec<MergeFn>)
The output of a merge is determined by applying the given ExternalFunction to the result of the argument merge functions.
Function(FunctionId, Vec<MergeFn>)
The output of a merge is determined by looking up the value for the given function and the given arguments in the egraph.
Old
Always return the old value for the given function.
New
Always return the new value for the given function.
Const(Value)
Always overwrite the new value for the given function with a constant. This is more useful as a “base case” in a more complicated merge function (e.g. one that clamps a value between 1 and 100) than it is as a standalone merge function.
Auto Trait Implementations§
impl Freeze for MergeFn
impl RefUnwindSafe for MergeFn
impl Send for MergeFn
impl Sync for MergeFn
impl Unpin for MergeFn
impl UnwindSafe for MergeFn
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more