An extension of the interpreter pattern to define domain-parametric rewriting systems