macro_rules! new_op2_opt {
($s:ident, $name:expr, $(($t1:ident, $t2:ident) -> $rt:ident { $f:expr }),*) => { ... };
}
Expand description
This macro facilitates the creation of a new binary operation with optional behavior.
It integrates a binary operation into the framework by implementing necessary traits and logic through various components.
Initially, it utilizes $crate::impl_basic!
to establish a basic setup for a given operation $s
, associating it with a specified $name
.
The macro then implements the Enumerator2
trait for $s
, effectively enabling the operation to be part of the enumeration process utilized in forward synthesis tasks.
Following this, it calls $crate::impl_op2_opt!
to define additional implementation details for the operation, identifying the input types $t1
and $t2
, the return type $rt
, and the expression $f
that dictates the operation’s computation.
This approach ensures the cohesive integration of optional binary operations that can be used efficiently within the domain-specific synthesis framework, allowing for complex operations to be handled flexibly and dynamically.