Attribute Macro reduction
#[reduction]Expand description
Attribute macro for automatic reduction registration.
Parses a ReduceTo impl block and generates the corresponding inventory::submit!
call. Variant fields are derived from Problem::variant().
Type generics are not supported — all ReduceTo impls must use concrete types.
If you need a reduction for a generic problem, write separate impls for each concrete
type combination.
§Attributes
transform = exact { field = expression, ... }— exact target-parameter equalitiestransform = upper_bound { field = expression, ... }— one rule-level upper boundtransform = unavailable { field = "reason", ... }— no symbolic parameter transformunavailable = { field = "reason", ... }— fields that cannot be propagatedaggregate = identityoraggregate = custom— register the reduction result’sAggregateReductionResultimplementation alongside its witness extractor
§Syntax
ⓘ
#[reduction(transform = exact {
num_vars = "num_vertices^2",
num_constraints = num_edges,
})]