def minimal_element(strategy, random): element = some_template(strategy, random) while True: for new_element in strategy.full_simplify(random, element): try: strategy.reify(new_element) element = new_element break except UnsatisfiedAssumption: pass else: break return element
def minimal_element(strategy, random): tracker = Tracker() element = some_template(strategy, random) while True: for new_element in strategy.full_simplify(random, element): if tracker.track(new_element) > 1: continue try: with BuildContext(): strategy.reify(new_element) element = new_element break except UnsatisfiedAssumption: pass else: break return element
def test_can_full_simplify_breaking_example(machine): runner = machine.find_breaking_runner() strategy = StateMachineSearchStrategy() r = Random(1) for _ in strategy.full_simplify(r, runner): pass