Regarding the OCaml QCheck library (https://github.com/c-cube/qcheck),
say we have a complete generator g: typ Gen.t
for a finite type typ
or a finite subset s: typ -> bool
of typ
, is it possible (with or without resorting to hacky techniques and/or slight modification to the library itself) to perform an exhaustive test (thus a proof!) for a property e.g. forall x
(s.t. s x = true
in the case we are only interested in a subset), prop x = true
, given prop: typ -> bool
always return a value for either any value of the type or the subset we are interested in?
By a "complete generator", I don't have a concrete definition for it but something as the name suggests. Some examples include:
Gen.pure ()
for the typeunit
Gen.int_bound 5
for the subsetfun x -> x >= 0 && x <= 5
of typeint
Gen.oneofl [`mon; `tue; `wed; `thu; `fri; `sat; `sun]
for the type[`mon|`tue|`wed|`thu|`fri|`sat|`sun]