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, ... } — uniform upper bounds
  • transform = { exact { ... }, upper_bound { ... }, unavailable { ... } } — per-field relations
  • transform = unavailable { field = "reason", ... } — no symbolic parameter transform
  • unavailable = { field = "reason", ... } — fields that cannot be propagated

§Syntax

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