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