REWRITE_TARGETED_W_METRIC(rule, v, f, m)
takes a rule, the name of a vertex 'v' within the rule (as a string), a targeting function 'f' from graphs to a vertex name, and a metric function m. It will apply the rule on a graph 'g' by first attempting to match 'v' on 'f(g)', then matching the rest, only if the resulting graph reduces the metric.
Add a new simproc combinator:
REWRITE_TARGETED_W_METRIC(rule, v, f, m) takes a rule, the name of a vertex 'v' within the rule (as a string), a targeting function 'f' from graphs to a vertex name, and a metric function m. It will apply the rule on a graph 'g' by first attempting to match 'v' on 'f(g)', then matching the rest, only if the resulting graph reduces the metric.
(and ditto for weak metrics)