src/Tools/quickcheck.ML
changeset 42089 904897d0c5bd
parent 42088 8d00484551fe
child 42159 234ec7011e5d
equal deleted inserted replaced
42088:8d00484551fe 42089:904897d0c5bd
    17   val timing : bool Config.T
    17   val timing : bool Config.T
    18   val quiet : bool Config.T
    18   val quiet : bool Config.T
    19   val timeout : real Config.T
    19   val timeout : real Config.T
    20   val finite_types : bool Config.T
    20   val finite_types : bool Config.T
    21   val finite_type_size : int Config.T
    21   val finite_type_size : int Config.T
    22   datatype report = Report of
       
    23     { iterations : int, raised_match_errors : int,
       
    24       satisfied_assms : int list, positive_concl_tests : int }
       
    25   datatype expectation = No_Expectation | No_Counterexample | Counterexample;
    22   datatype expectation = No_Expectation | No_Counterexample | Counterexample;
    26   datatype test_params = Test_Params of {default_type: typ list, expect : expectation};
    23   datatype test_params = Test_Params of {default_type: typ list, expect : expectation};
    27   val test_params_of : Proof.context -> test_params
    24   val test_params_of : Proof.context -> test_params
    28   val map_test_params : (typ list * expectation -> typ list * expectation)
    25   val map_test_params : (typ list * expectation -> typ list * expectation)
    29     -> Context.generic -> Context.generic
    26     -> Context.generic -> Context.generic
       
    27   datatype report = Report of
       
    28     { iterations : int, raised_match_errors : int,
       
    29       satisfied_assms : int list, positive_concl_tests : int }
       
    30   (* registering generators *)
    30   val add_generator:
    31   val add_generator:
    31     string * (Proof.context -> term * term list -> int -> term list option * report option)
    32     string * (Proof.context -> term * term list -> int -> term list option * report option)
    32       -> Context.generic -> Context.generic
    33       -> Context.generic -> Context.generic
    33   val add_batch_generator:
    34   val add_batch_generator:
    34     string * (Proof.context -> term list -> (int -> term list option) list)
    35     string * (Proof.context -> term list -> (int -> term list option) list)
    35       -> Context.generic -> Context.generic
    36       -> Context.generic -> Context.generic
       
    37   (* quickcheck's result *)
    36   datatype result =
    38   datatype result =
    37     Result of
    39     Result of
    38      {counterexample : (string * term) list option,
    40      {counterexample : (string * term) list option,
    39       evaluation_terms : (term * term) list option,
    41       evaluation_terms : (term * term) list option,
    40       timings : (string * int) list,
    42       timings : (string * int) list,
    41       reports : (int * report) list}
    43       reports : (int * report) list}
       
    44   val counterexample_of : result -> (string * term) list option
       
    45   val timings_of : result -> (string * int) list
    42   (* testing terms and proof states *)
    46   (* testing terms and proof states *)
    43   val test_term: Proof.context -> bool * bool -> term * term list -> result
    47   val test_term: Proof.context -> bool * bool -> term * term list -> result
    44   val test_goal_terms:
    48   val test_goal_terms:
    45     Proof.context -> bool * bool -> (string * typ) list -> (term * term list) list  
    49     Proof.context -> bool * bool -> (string * typ) list -> (term * term list) list  
    46       -> result list
    50       -> result list
    47   val quickcheck: (string * string list) list -> int -> Proof.state -> (string * term) list option
    51   val quickcheck: (string * string list) list -> int -> Proof.state -> (string * term) list option
    48   
       
    49   (* testing a batch of terms *)
    52   (* testing a batch of terms *)
    50   val test_terms: Proof.context -> term list -> (string * term) list option list option
    53   val test_terms: Proof.context -> term list -> (string * term) list option list option
    51 end;
    54 end;
    52 
    55 
    53 structure Quickcheck : QUICKCHECK =
    56 structure Quickcheck : QUICKCHECK =