src/HOL/Mutabelle/MutabelleExtra.thy
author haftmann
Mon, 05 Jul 2010 16:46:23 +0200
changeset 37719 271ecd4fb9f9
parent 34965 3b4762c1052c
child 39324 05452dd66b2b
permissions -rw-r--r--
moved "open" operations from Heap.thy to Array.thy and Ref.thy
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
34965
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
     1
theory MutabelleExtra
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
     2
imports Complex_Main SML_Quickcheck
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
     3
(*
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
     4
  "~/Downloads/Jinja/J/TypeSafe"
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
     5
  "~/Downloads/Jinja/J/Annotate"
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
     6
  (* FIXME "Example" *)
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
     7
  "~/Downloads/Jinja/J/execute_Bigstep"
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
     8
  "~/Downloads/Jinja/J/execute_WellType"
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
     9
  "~/Downloads/Jinja/JVM/JVMDefensive"
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
    10
  "~/Downloads/Jinja/JVM/JVMListExample"
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
    11
  "~/Downloads/Jinja/BV/BVExec"
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
    12
  "~/Downloads/Jinja/BV/LBVJVM"
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
    13
  "~/Downloads/Jinja/BV/BVNoTypeError"
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
    14
  "~/Downloads/Jinja/BV/BVExample"
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
    15
  "~/Downloads/Jinja/Compiler/TypeComp"
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
    16
*)
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
    17
(*"~/Downloads/NormByEval/NBE"*)
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
    18
uses "mutabelle.ML"
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
    19
     "mutabelle_extra.ML"
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
    20
begin
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
    21
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
    22
ML {* val old_tr = !Output.tracing_fn *}
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
    23
ML {* val old_wr = !Output.writeln_fn *}
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
    24
ML {* val old_pr = !Output.priority_fn *}
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
    25
ML {* val old_wa = !Output.warning_fn *}
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
    26
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
    27
quickcheck_params [size = 5, iterations = 1000]
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
    28
(*
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
    29
nitpick_params [timeout = 5 s, sat_solver = MiniSat, no_overlord, verbose, card = 1-5, iter = 1,2,4,8,12]
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
    30
refute_params [maxtime = 10, minsize = 1, maxsize = 5, satsolver = jerusat]
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
    31
*)
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
    32
ML {* Auto_Counterexample.time_limit := 10 *}
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
    33
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
    34
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
    35
text {* Uncomment the following ML code to check the counterexample generation with all theorems of Complex_Main. *}
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
    36
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
    37
ML {*
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
    38
(*
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
    39
      MutabelleExtra.random_seed := 1.0;
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
    40
      MutabelleExtra.thms_of true @{theory Complex_Main}
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
    41
      |> MutabelleExtra.take_random 1000000
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
    42
      |> (fn thms => List.drop (thms, 1000))
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
    43
      |> (fn thms => MutabelleExtra.mutate_theorems_and_write_report
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
    44
             @{theory} [MutabelleExtra.quickcheck_mtd "SML",
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
    45
                        MutabelleExtra.quickcheck_mtd "code"
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
    46
                        (*MutabelleExtra.refute_mtd,
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
    47
                        MutabelleExtra.nitpick_mtd*)] thms "/tmp/muta.out")
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
    48
*)
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
    49
 *}
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
    50
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
    51
ML {* Output.tracing_fn := old_tr *}
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
    52
ML {* Output.writeln_fn := old_wr *}
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
    53
ML {* Output.priority_fn := old_pr *}
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
    54
ML {* Output.warning_fn := old_wa *}
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
    55
3b4762c1052c adding Mutabelle to repository
bulwahn
parents:
diff changeset
    56
end