Set Warnings "-extraction-opaque-accessed,-extraction".
Set Warnings "-notation-overridden,-parsing".
Definition resultSuccessful (r : Result) : bool :=
match r with
| MkResult (Some res) expected _ _ _ _ _ =>
res == expected
| _ => true
end.
Definition successful qp :=
match qp with
| MkProp (MkRose res _) => resultSuccessful res
end.
(* Maps a Checker to a Prop *)
(* begin semCheckerSize *)
Definition semCheckerSize (c : Checker) (s : nat): Prop :=
successful @: semGenSize c s \subset [set true].
(* end semCheckerSize *)
(* ZP: Do we want to define semChecker in terms of semCheckerSize? *)
(* begin semChecker *)
Definition semChecker (c : Checker) : Prop := forall s, semCheckerSize c s.
(* end semChecker *)
(* Maps a Checkable to a Prop i.e. gives an equivalent proposition to the property under test *)
(* begin semCheckableSize *)
Definition semCheckableSize {A} `{Checkable A} (a : A) (s : nat) : Prop :=
semCheckerSize (checker a) s.
(* end semCheckableSize *)
(* begin semCheckable *)
Definition semCheckable {A} `{Checkable A} (a : A) : Prop := semChecker (checker a).
(* end semCheckable *)

(* CH: This is the definition of Checker I would like to use *)
(* ZP : For now semCheckerSize has a similar definition and semChecker is defined in terms of semCheckerSize *)
Lemma semChecker_def3 c :
semChecker c <-> (successful @: semGen c \subset [set true]).