Skip to main content

reduction

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 equalities
  • transform = upper_bound { field = expression, ... } — one rule-level upper bound
  • transform = unavailable { field = "reason", ... } — no symbolic parameter transform
  • unavailable = { field = "reason", ... } — fields that cannot be propagated
  • aggregate = identity or aggregate = custom — register the reduction result’s AggregateReductionResult implementation alongside its witness extractor

§Syntax

#[reduction(transform = exact {
    num_vars = "num_vertices^2",
    num_constraints = num_edges,
})]