(* QuickChick Prelude *)
Set Warnings "-extraction-opaque-accessed,-extraction".
Set Warnings "-notation-overridden,-parsing".
Set Bullet Behavior "Strict Subproofs".
(* End prelude *)
Inductive ev : nat -> Prop :=
| ev_0 : ev 0
| ev_SS : forall n : nat, ev n -> ev (S (S n)).
Derive ArbitrarySizedSuchThat for (fun n => ev n).
Derive SizedProofEqs for (fun n => ev n).
Derive SizeMonotonicSuchThatOpt for (fun n => ev n).
Derive GenSizedSuchThatCorrect for (fun n => ev n).
Derive GenSizedSuchThatSizeMonotonicOpt for (fun n => ev n).
(* Future work: Before relevant software foundations testing book, this needs to be automated... *)
Instance dec_ev (n : nat) : Dec (ev n) :=
{| dec := let fix aux n :=
let n' := n in
let Heq := erefl n' : n' = n in
match n as n'' return (n' = n'' -> _) with
| O => fun H => left _
| S O => fun H => right _
| S (S n) => fun H => _ (aux n)
end Heq in
aux n |}.
Admitted. (* QuickChick ev_plus4. *)
Admitted. (* (*N*) QuickChick ev_minus2. *)
Admitted. (* (*N*) QuickChick ev_minus2'. *)
Admitted. (* OUT-OF-SCOPE *)
(* existential dummy *)
Definition double_reverse n : nat := n.
Instance dec_ex_double n : Dec (exists k, n = double k).
constructor; unfold decidable.
left; exists (double_reverse n).
eapply double_reverse_correct.
Defined.
Admitted. (* QuickChick ev_even_firsttry. (* Existential *) *)
Global Instance testSuchThat_swap_2 {A B : Type} {pre : A -> Prop}
{prop : A -> B -> Type}
`{Checkable (forall a, pre a -> forall b, prop a b)} :
Checkable (forall a b, pre a -> prop a b ) :=
{| checker f := @checker (forall a, pre a -> forall b, prop a b) _ _ |}.
Inductive ev' : nat -> Prop :=
| ev'_0 : ev' 0
| ev'_2 : ev' 2
| ev'_sum : forall n m, ev' n -> ev' m -> ev' (n + m).
Admitted. (* OUT-OF-SCOPE *)

Theorem ev_ev__ev : forall n m,
ev (n+m) -> ev n -> ev m.