src/HOL/Tools/Quickcheck/narrowing_generators.ML
changeset 46042 ab32a87ba01a
parent 45923 473b744c23f2
child 46219 426ed18eba43
equal deleted inserted replaced
46035:313be214e40a 46042:ab32a87ba01a
   311       Exn.interruptible_capture (value opts ctxt cookie)
   311       Exn.interruptible_capture (value opts ctxt cookie)
   312         (Code_Target.evaluator thy target naming program deps (vs_ty, t));    
   312         (Code_Target.evaluator thy target naming program deps (vs_ty, t));    
   313   in Exn.release (Code_Thingol.dynamic_value thy (Exn.map_result o postproc) evaluator t) end;
   313   in Exn.release (Code_Thingol.dynamic_value thy (Exn.map_result o postproc) evaluator t) end;
   314 
   314 
   315 (** counterexample generator **)
   315 (** counterexample generator **)
   316   
   316 
       
   317 (* FIXME just one data slot (record) per program unit *)
   317 structure Counterexample = Proof_Data
   318 structure Counterexample = Proof_Data
   318 (
   319 (
   319   type T = unit -> (bool * term list) option
   320   type T = unit -> (bool * term list) option
   320   fun init _ () = error "Counterexample"
   321   fun init _ () = error "Counterexample"
   321 )
   322 )
   328   | map_counterexample f (Universal_Counterexample (t, c)) =
   329   | map_counterexample f (Universal_Counterexample (t, c)) =
   329       Universal_Counterexample (f t, map_counterexample f c)
   330       Universal_Counterexample (f t, map_counterexample f c)
   330   | map_counterexample f (Existential_Counterexample cs) =
   331   | map_counterexample f (Existential_Counterexample cs) =
   331       Existential_Counterexample (map (fn (t, c) => (f t, map_counterexample f c)) cs)
   332       Existential_Counterexample (map (fn (t, c) => (f t, map_counterexample f c)) cs)
   332 
   333 
       
   334 (* FIXME just one data slot (record) per program unit *)
   333 structure Existential_Counterexample = Proof_Data
   335 structure Existential_Counterexample = Proof_Data
   334 (
   336 (
   335   type T = unit -> counterexample option
   337   type T = unit -> counterexample option
   336   fun init _ () = error "Counterexample"
   338   fun init _ () = error "Counterexample"
   337 )
   339 )