Add head_reduce_mmv (reduction function modulo metavariables)

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>