src/HOL/Tools/Predicate_Compile/pred_compile_quickcheck.ML
changeset 33143 730a2e8a6ec6
parent 33140 83951822bfd0
child 33149 2c8f1c450b47
equal deleted inserted replaced
33142:edab304696ec 33143:730a2e8a6ec6
    13 structure Predicate_Compile_Quickcheck : PREDICATE_COMPILE_QUICKCHECK =
    13 structure Predicate_Compile_Quickcheck : PREDICATE_COMPILE_QUICKCHECK =
    14 struct
    14 struct
    15 
    15 
    16 val test_ref =
    16 val test_ref =
    17   Unsynchronized.ref (NONE : (unit -> int -> int * int -> term list Predicate.pred * (int * int)) option)
    17   Unsynchronized.ref (NONE : (unit -> int -> int * int -> term list Predicate.pred * (int * int)) option)
       
    18 
    18 val target = "Quickcheck"
    19 val target = "Quickcheck"
    19 
    20 
    20 fun dest_compfuns (Predicate_Compile_Core.CompilationFuns funs) = funs
    21 fun dest_compfuns (Predicate_Compile_Core.CompilationFuns funs) = funs
    21 val mk_predT = #mk_predT (dest_compfuns Predicate_Compile_Core.pred_compfuns)
    22 val mk_predT = #mk_predT (dest_compfuns Predicate_Compile_Core.pred_compfuns)
    22 val mk_rpredT = #mk_predT (dest_compfuns Predicate_Compile_Core.rpred_compfuns)
    23 val mk_rpredT = #mk_predT (dest_compfuns Predicate_Compile_Core.rpred_compfuns)
    62     val intro = Goal.prove (ProofContext.init thy') (map fst vs') [] t tac
    63     val intro = Goal.prove (ProofContext.init thy') (map fst vs') [] t tac
    63     val _ = tracing (Display.string_of_thm ctxt' intro)
    64     val _ = tracing (Display.string_of_thm ctxt' intro)
    64     val thy'' = thy'
    65     val thy'' = thy'
    65       |> Context.theory_map (Predicate_Compile_Preproc_Const_Defs.add_thm intro)
    66       |> Context.theory_map (Predicate_Compile_Preproc_Const_Defs.add_thm intro)
    66       |> Predicate_Compile.preprocess Predicate_Compile_Aux.default_options full_constname
    67       |> Predicate_Compile.preprocess Predicate_Compile_Aux.default_options full_constname
    67       |> Predicate_Compile_Core.add_equations Predicate_Compile_Aux.default_options [full_constname]
    68       (* |> Predicate_Compile_Core.add_equations Predicate_Compile_Aux.default_options [full_constname]*)
    68       (*  |> Predicate_Compile_Core.add_depth_limited_equations Predicate_Compile_Aux.default_options [full_constname]*)
    69       (*  |> Predicate_Compile_Core.add_depth_limited_equations Predicate_Compile_Aux.default_options [full_constname]*)
    69       |> Predicate_Compile_Core.add_quickcheck_equations Predicate_Compile_Aux.default_options [full_constname]
    70       (* |> Predicate_Compile_Core.add_quickcheck_equations Predicate_Compile_Aux.default_options [full_constname] *)
    70     val depth_limited_modes = Predicate_Compile_Core.depth_limited_modes_of thy'' full_constname
    71     val depth_limited_modes = Predicate_Compile_Core.depth_limited_modes_of thy'' full_constname
    71     val modes = Predicate_Compile_Core.generator_modes_of thy'' full_constname  
    72     val modes = Predicate_Compile_Core.generator_modes_of thy'' full_constname  
    72     val prog =
    73     val prog =
    73       if member (op =) modes ([], []) then
    74       if member (op =) modes ([], []) then
    74         let
    75         let