fact: Fixpoint localMin (st : State) (r : Rose Checker.Result) {struct r} : (nat * Checker.Result) := match r with | MkRose res ts => let fix localMin' st ts {struct ts} := match ts return (nat * Checker.Result) with | nil => let zero := callbackPostFinalFailure st res in (numSuccessShrinks st + zero, res) | cons ((MkRose res' _) as r') ts' => let zero := callbackPostTest st res in match ok res' with | Some x => let consistent_tags := match result_tag res, result_tag res' with | Some t1, Some t2 => if string_dec t1 t2 then true else false | None, None => true | _, _ => false end in if andb (negb x) consistent_tags then localMin (updSuccessShrinks st (fun x => x + 1 + zero)) r' else localMin' (updTryShrinks st (fun x => x + 1)) ts' | None => localMin' (updTryShrinks st (fun x => x + 1)) ts' end end in localMin' st (force ts) end.
imports: mathcomp.ssreflect.ssreflect mathcomp(ssrnat ssrbool eqtype div) ExtLib(Structures.Monad) SimpleIO(SimpleIO) QuickChick(RoseTrees RandomQC Generators Producer SemChecker) QuickChick(Show Checker State Classes) Coq.Strings.Ascii Coq.Strings.String List Recdef Arith.EqNat