src/Tools/quickcheck.ML
changeset 45449 eeffd04cd899
parent 45419 10ba32c347b0
child 45666 d83797ef0d2d
equal deleted inserted replaced
45448:018f8959c7a6 45449:eeffd04cd899
    20   val no_assms : bool Config.T
    20   val no_assms : bool Config.T
    21   val report : bool Config.T
    21   val report : bool Config.T
    22   val timing : bool Config.T
    22   val timing : bool Config.T
    23   val quiet : bool Config.T
    23   val quiet : bool Config.T
    24   val timeout : real Config.T
    24   val timeout : real Config.T
       
    25   val allow_function_inversion : bool Config.T;
    25   val finite_types : bool Config.T
    26   val finite_types : bool Config.T
    26   val finite_type_size : int Config.T
    27   val finite_type_size : int Config.T
    27   val set_active_testers: string list -> Context.generic -> Context.generic
    28   val set_active_testers: string list -> Context.generic -> Context.generic
    28   datatype expectation = No_Expectation | No_Counterexample | Counterexample;
    29   datatype expectation = No_Expectation | No_Counterexample | Counterexample;
    29   datatype test_params = Test_Params of {default_type: typ list, expect : expectation};
    30   datatype test_params = Test_Params of {default_type: typ list, expect : expectation};
   169 val no_assms = Attrib.setup_config_bool @{binding quickcheck_no_assms} (K false)
   170 val no_assms = Attrib.setup_config_bool @{binding quickcheck_no_assms} (K false)
   170 val report = Attrib.setup_config_bool @{binding quickcheck_report} (K true)
   171 val report = Attrib.setup_config_bool @{binding quickcheck_report} (K true)
   171 val timing = Attrib.setup_config_bool @{binding quickcheck_timing} (K false)
   172 val timing = Attrib.setup_config_bool @{binding quickcheck_timing} (K false)
   172 val quiet = Attrib.setup_config_bool @{binding quickcheck_quiet} (K false)
   173 val quiet = Attrib.setup_config_bool @{binding quickcheck_quiet} (K false)
   173 val timeout = Attrib.setup_config_real @{binding quickcheck_timeout} (K 30.0)
   174 val timeout = Attrib.setup_config_real @{binding quickcheck_timeout} (K 30.0)
       
   175 val allow_function_inversion =
       
   176   Attrib.setup_config_bool @{binding quickcheck_allow_function_inversion} (K false)
   174 val finite_types = Attrib.setup_config_bool @{binding quickcheck_finite_types} (K true)
   177 val finite_types = Attrib.setup_config_bool @{binding quickcheck_finite_types} (K true)
   175 val finite_type_size = Attrib.setup_config_int @{binding quickcheck_finite_type_size} (K 3)
   178 val finite_type_size = Attrib.setup_config_int @{binding quickcheck_finite_type_size} (K 3)
   176 
   179 
   177 datatype test_params = Test_Params of
   180 datatype test_params = Test_Params of
   178   {default_type: typ list, expect : expectation};
   181   {default_type: typ list, expect : expectation};
   406   | parse_test_param ("expect", [arg]) = apsnd (map_test_params ((apsnd o K) (read_expectation arg)))
   409   | parse_test_param ("expect", [arg]) = apsnd (map_test_params ((apsnd o K) (read_expectation arg)))
   407   | parse_test_param ("report", [arg]) = apsnd (Config.put_generic report (read_bool arg))
   410   | parse_test_param ("report", [arg]) = apsnd (Config.put_generic report (read_bool arg))
   408   | parse_test_param ("quiet", [arg]) = apsnd (Config.put_generic quiet (read_bool arg))
   411   | parse_test_param ("quiet", [arg]) = apsnd (Config.put_generic quiet (read_bool arg))
   409   | parse_test_param ("timeout", [arg]) = apsnd (Config.put_generic timeout (read_real arg))
   412   | parse_test_param ("timeout", [arg]) = apsnd (Config.put_generic timeout (read_real arg))
   410   | parse_test_param ("finite_types", [arg]) = apsnd (Config.put_generic finite_types (read_bool arg))
   413   | parse_test_param ("finite_types", [arg]) = apsnd (Config.put_generic finite_types (read_bool arg))
       
   414   | parse_test_param ("allow_function_inversion", [arg]) =
       
   415       apsnd (Config.put_generic allow_function_inversion (read_bool arg))
   411   | parse_test_param ("finite_type_size", [arg]) =
   416   | parse_test_param ("finite_type_size", [arg]) =
   412     apsnd (Config.put_generic finite_type_size (read_nat arg))
   417     apsnd (Config.put_generic finite_type_size (read_nat arg))
   413   | parse_test_param (name, _) = (fn (testers, genctxt) =>
   418   | parse_test_param (name, _) = (fn (testers, genctxt) =>
   414     if valid_tester_name genctxt name then
   419     if valid_tester_name genctxt name then
   415       (insert (op =) name testers, genctxt)  
   420       (insert (op =) name testers, genctxt)