src/HOL/Refute.thy
author wenzelm
Thu Mar 15 22:08:53 2012 +0100 (2012-03-15)
changeset 46950 d0181abdbdac
parent 40178 00152d17855b
child 46960 f19e5837ad69
permissions -rw-r--r--
declare command keywords via theory header, including strict checking outside Pure;
webertj@14350
     1
(*  Title:      HOL/Refute.thy
webertj@14350
     2
    Author:     Tjark Weber
webertj@22058
     3
    Copyright   2003-2007
webertj@14350
     4
webertj@14350
     5
Basic setup and documentation for the 'refute' (and 'refute_params') command.
webertj@14350
     6
*)
webertj@14350
     7
wenzelm@14589
     8
header {* Refute *}
wenzelm@14589
     9
nipkow@15131
    10
theory Refute
blanchet@40178
    11
imports Hilbert_Choice List Sledgehammer
wenzelm@46950
    12
keywords "refute" :: diag and "refute_params" :: thy_decl
wenzelm@39048
    13
uses "Tools/refute.ML"
nipkow@15131
    14
begin
wenzelm@14589
    15
wenzelm@14589
    16
setup Refute.setup
wenzelm@14589
    17
wenzelm@14589
    18
text {*
wenzelm@14589
    19
\small
wenzelm@14589
    20
\begin{verbatim}
webertj@14350
    21
(* ------------------------------------------------------------------------- *)
webertj@14350
    22
(* REFUTE                                                                    *)
webertj@14350
    23
(*                                                                           *)
webertj@14350
    24
(* We use a SAT solver to search for a (finite) model that refutes a given   *)
webertj@14350
    25
(* HOL formula.                                                              *)
webertj@14350
    26
(* ------------------------------------------------------------------------- *)
webertj@14350
    27
webertj@14350
    28
(* ------------------------------------------------------------------------- *)
webertj@14457
    29
(* NOTE                                                                      *)
webertj@14350
    30
(*                                                                           *)
webertj@14457
    31
(* I strongly recommend that you install a stand-alone SAT solver if you     *)
webertj@14463
    32
(* want to use 'refute'.  For details see 'HOL/Tools/sat_solver.ML'.  If you *)
webertj@15293
    33
(* have installed (a supported version of) zChaff, simply set 'ZCHAFF_HOME'  *)
webertj@15293
    34
(* in 'etc/settings'.                                                        *)
webertj@14350
    35
(* ------------------------------------------------------------------------- *)
webertj@14350
    36
webertj@14350
    37
(* ------------------------------------------------------------------------- *)
webertj@14350
    38
(* USAGE                                                                     *)
webertj@14350
    39
(*                                                                           *)
webertj@14350
    40
(* See the file 'HOL/ex/Refute_Examples.thy' for examples.  The supported    *)
webertj@14350
    41
(* parameters are explained below.                                           *)
webertj@14350
    42
(* ------------------------------------------------------------------------- *)
webertj@14350
    43
webertj@14350
    44
(* ------------------------------------------------------------------------- *)
webertj@14350
    45
(* CURRENT LIMITATIONS                                                       *)
webertj@14350
    46
(*                                                                           *)
webertj@14350
    47
(* 'refute' currently accepts formulas of higher-order predicate logic (with *)
webertj@14350
    48
(* equality), including free/bound/schematic variables, lambda abstractions, *)
webertj@16870
    49
(* sets and set membership, "arbitrary", "The", "Eps", records and           *)
webertj@22058
    50
(* inductively defined sets.  Constants are unfolded automatically, and sort *)
webertj@22058
    51
(* axioms are added as well.  Other, user-asserted axioms however are        *)
webertj@22058
    52
(* ignored.  Inductive datatypes and recursive functions are supported, but  *)
webertj@22058
    53
(* may lead to spurious countermodels.                                       *)
webertj@14463
    54
(*                                                                           *)
webertj@14808
    55
(* The (space) complexity of the algorithm is non-elementary.                *)
webertj@14350
    56
(*                                                                           *)
webertj@16870
    57
(* Schematic type variables are not supported.                               *)
webertj@14350
    58
(* ------------------------------------------------------------------------- *)
webertj@14350
    59
webertj@14350
    60
(* ------------------------------------------------------------------------- *)
webertj@14350
    61
(* PARAMETERS                                                                *)
webertj@14350
    62
(*                                                                           *)
blanchet@34120
    63
(* The following global parameters are currently supported (and required,    *)
blanchet@34120
    64
(* except for "expect"):                                                     *)
webertj@14350
    65
(*                                                                           *)
webertj@14350
    66
(* Name          Type    Description                                         *)
webertj@14350
    67
(*                                                                           *)
webertj@14350
    68
(* "minsize"     int     Only search for models with size at least           *)
webertj@14350
    69
(*                       'minsize'.                                          *)
webertj@14350
    70
(* "maxsize"     int     If >0, only search for models with size at most     *)
webertj@14350
    71
(*                       'maxsize'.                                          *)
webertj@14350
    72
(* "maxvars"     int     If >0, use at most 'maxvars' boolean variables      *)
webertj@14350
    73
(*                       when transforming the term into a propositional     *)
webertj@14350
    74
(*                       formula.                                            *)
webertj@14808
    75
(* "maxtime"     int     If >0, terminate after at most 'maxtime' seconds.   *)
webertj@14808
    76
(*                       This value is ignored under some ML compilers.      *)
webertj@14457
    77
(* "satsolver"   string  Name of the SAT solver to be used.                  *)
blanchet@34120
    78
(* "no_assms"    bool    If "true", assumptions in structured proofs are     *)
blanchet@34120
    79
(*                       not considered.                                     *)
blanchet@34120
    80
(* "expect"      string  Expected result ("genuine", "potential", "none", or *)
blanchet@34120
    81
(*                       "unknown").                                         *)
webertj@14457
    82
(*                                                                           *)
wenzelm@17721
    83
(* See 'HOL/SAT.thy' for default values.                                     *)
webertj@14808
    84
(*                                                                           *)
webertj@14808
    85
(* The size of particular types can be specified in the form type=size       *)
webertj@14808
    86
(* (where 'type' is a string, and 'size' is an int).  Examples:              *)
webertj@14808
    87
(* "'a"=1                                                                    *)
webertj@14808
    88
(* "List.list"=2                                                             *)
webertj@14350
    89
(* ------------------------------------------------------------------------- *)
webertj@14350
    90
webertj@14350
    91
(* ------------------------------------------------------------------------- *)
webertj@14350
    92
(* FILES                                                                     *)
webertj@14350
    93
(*                                                                           *)
wenzelm@39048
    94
(* HOL/Tools/prop_logic.ML     Propositional logic                           *)
wenzelm@39048
    95
(* HOL/Tools/sat_solver.ML     SAT solvers                                   *)
wenzelm@39048
    96
(* HOL/Tools/refute.ML         Translation HOL -> propositional logic and    *)
wenzelm@39048
    97
(*                             Boolean assignment -> HOL model               *)
wenzelm@39048
    98
(* HOL/Refute.thy              This file: loads the ML files, basic setup,   *)
wenzelm@39048
    99
(*                             documentation                                 *)
wenzelm@39048
   100
(* HOL/SAT.thy                 Sets default parameters                       *)
wenzelm@39048
   101
(* HOL/ex/Refute_Examples.thy  Examples                                      *)
webertj@14350
   102
(* ------------------------------------------------------------------------- *)
wenzelm@14589
   103
\end{verbatim}
wenzelm@14589
   104
*}
webertj@14350
   105
webertj@14350
   106
end