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