(case, predicate, reductions=0)
| 215 | |
| 216 | |
| 217 | def reduce(case, predicate, reductions=0): |
| 218 | for _ in range(reduction_attempts): |
| 219 | (reduced, simplified) = simplify(case) |
| 220 | if reduced and not predicate(simplified): |
| 221 | return reduce(simplified, predicate, reductions + 1) |
| 222 | return (reductions, case) |
| 223 | |
| 224 | |
| 225 | def isnt(predicate): |