substitute out variables in equality to help partial eval