user-defined functions to rewrite literals in clauses