File ‹configuration.ML›

(*  Title:      SpecCheck/configuration.ML
    Author:     Kevin Kappelmann

Configuration options for SpecCheck.
*)

signature SPECCHECK_CONFIGURATION =
sig

  (*maximum number of successful tests before succeeding*)
  val max_success : int Config.T
  (*maximum number of discarded tests per successful test before giving up*)
  val max_discard_ratio : int Config.T
  (*maximum number of shrinks per counterexample*)
  val max_shrinks : int Config.T
  (*number of counterexamples shown*)
  val num_counterexamples : int Config.T
  (*sort counterexamples by size*)
  val sort_counterexamples : bool Config.T
  (*print timing etc. depending on style*)
  val show_stats : bool Config.T

end

structure SpecCheck_Configuration : SPECCHECK_CONFIGURATION =
struct

val max_success = Attrib.setup_config_int bindingspeccheck_max_success (K 100)

val max_discard_ratio = Attrib.setup_config_int bindingspeccheck_max_discard_ratio (K 10)

val max_shrinks = Attrib.setup_config_int bindingspeccheck_max_shrinks (K 10000)

val num_counterexamples = Attrib.setup_config_int bindingspeccheck_num_counterexamples (K 1)

val sort_counterexamples =
  Attrib.setup_config_bool bindingspeccheck_sort_counterexamples (K true)

val show_stats = Attrib.setup_config_bool bindingspeccheck_show_stats (K true)

end