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