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