src/HOL/TPTP/CASC_Setup.thy
author blanchet
Wed, 13 Jul 2011 22:16:19 +0200
changeset 44669 0349175384f8
parent 44668 eb9be23db2b7
child 44670 6b158ce2b5e2
permissions -rw-r--r--
pull in arithmetic theories
     1 (*  Title:      HOL/ex/CASC_Setup.thy
     2     Author:     Jasmin Blanchette
     3     Copyright   2011
     4 
     5 Setup for Isabelle, Nitpick, and Refute for participating at CASC in the THF and
     6 TNT divisions. This theory file should be loaded by the Isabelle theory files
     7 generated by Geoff Sutcliffe's TPTP2X tool from the original THF0 files.
     8 *)
     9 
    10 theory CASC_Setup
    11 imports Complex_Main
    12 uses "sledgehammer_tactics.ML"
    13 begin
    14 
    15 declare mem_def [simp add]
    16 
    17 declare [[smt_oracle]]
    18 
    19 refute_params [maxtime = 10000, no_assms, expect = genuine]
    20 nitpick_params [timeout = none, card = 1-50, verbose, dont_box, no_assms,
    21                 batch_size = 1, expect = genuine]
    22 
    23 ML {* Proofterm.proofs := 0 *}
    24 
    25 ML {*
    26 fun SOLVE_TIMEOUT seconds name tac st =
    27   let
    28     val result =
    29       TimeLimit.timeLimit (Time.fromSeconds seconds)
    30         (fn () => SINGLE (SOLVE tac) st) ()
    31       handle TimeLimit.TimeOut => NONE
    32         | ERROR _ => NONE
    33   in
    34     (case result of
    35       NONE => (warning ("FAILURE: " ^ name); Seq.empty)
    36     | SOME st' => (warning ("SUCCESS: " ^ name); Seq.single st'))
    37   end
    38 *}
    39 
    40 ML {*
    41 fun isabellep_tac ctxt max_secs =
    42    SOLVE_TIMEOUT (max_secs div 10) "smt" (ALLGOALS (SMT_Solver.smt_tac ctxt []))
    43    ORELSE
    44    SOLVE_TIMEOUT (max_secs div 5) "sledgehammer"
    45        (ALLGOALS (Sledgehammer_Tactics.sledgehammer_as_oracle_tac ctxt))
    46    ORELSE
    47    SOLVE_TIMEOUT (max_secs div 10) "simp" (ALLGOALS (asm_full_simp_tac (simpset_of ctxt)))
    48    ORELSE
    49    SOLVE_TIMEOUT (max_secs div 20) "blast" (ALLGOALS (blast_tac ctxt))
    50    ORELSE
    51    SOLVE_TIMEOUT (max_secs div 10) "auto" (auto_tac ctxt
    52        THEN ALLGOALS (Sledgehammer_Tactics.sledgehammer_as_oracle_tac ctxt))
    53    ORELSE
    54    SOLVE_TIMEOUT (max_secs div 10) "metis"
    55        (ALLGOALS (Metis_Tactics.metis_tac [] ctxt []))
    56    ORELSE
    57    SOLVE_TIMEOUT (max_secs div 10) "fast" (ALLGOALS (fast_tac ctxt))
    58    ORELSE
    59    SOLVE_TIMEOUT (max_secs div 10) "best" (ALLGOALS (best_tac ctxt))
    60    ORELSE
    61    SOLVE_TIMEOUT (max_secs div 10) "force" (ALLGOALS (force_tac ctxt))
    62    ORELSE
    63    SOLVE_TIMEOUT max_secs "fastsimp" (ALLGOALS (fast_simp_tac ctxt))
    64 *}
    65 
    66 method_setup isabellep = {*
    67   Scan.lift (Scan.optional Parse.nat 1) >>
    68     (fn m => fn ctxt => SIMPLE_METHOD (isabellep_tac ctxt m))
    69 *} "combination of Isabelle provers and oracles for CASC"
    70 
    71 end