src/HOL/Library/Refute.thy
author paulson <lp15@cam.ac.uk>
Mon Feb 22 14:37:56 2016 +0000 (2016-02-22)
changeset 62379 340738057c8c
parent 60500 903bb1495239
child 63432 ba7901e94e7b
permissions -rw-r--r--
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
wenzelm@50530
     1
(*  Title:      HOL/Library/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@60500
     8
section \<open>Refute\<close>
wenzelm@14589
     9
nipkow@15131
    10
theory Refute
blanchet@54556
    11
imports Main
wenzelm@46950
    12
keywords "refute" :: diag and "refute_params" :: thy_decl
nipkow@15131
    13
begin
wenzelm@14589
    14
blanchet@49985
    15
ML_file "refute.ML"
wenzelm@14589
    16
wenzelm@46960
    17
refute_params
wenzelm@46960
    18
 [itself = 1,
wenzelm@46960
    19
  minsize = 1,
wenzelm@46960
    20
  maxsize = 8,
wenzelm@46960
    21
  maxvars = 10000,
wenzelm@46960
    22
  maxtime = 60,
wenzelm@46960
    23
  satsolver = auto,
wenzelm@46960
    24
  no_assms = false]
wenzelm@46960
    25
wenzelm@60500
    26
text \<open>
wenzelm@14589
    27
\small
wenzelm@14589
    28
\begin{verbatim}
webertj@14350
    29
(* ------------------------------------------------------------------------- *)
webertj@14350
    30
(* REFUTE                                                                    *)
webertj@14350
    31
(*                                                                           *)
webertj@14350
    32
(* We use a SAT solver to search for a (finite) model that refutes a given   *)
webertj@14350
    33
(* HOL formula.                                                              *)
webertj@14350
    34
(* ------------------------------------------------------------------------- *)
webertj@14350
    35
webertj@14350
    36
(* ------------------------------------------------------------------------- *)
webertj@14457
    37
(* NOTE                                                                      *)
webertj@14350
    38
(*                                                                           *)
webertj@14457
    39
(* I strongly recommend that you install a stand-alone SAT solver if you     *)
webertj@14463
    40
(* want to use 'refute'.  For details see 'HOL/Tools/sat_solver.ML'.  If you *)
webertj@15293
    41
(* have installed (a supported version of) zChaff, simply set 'ZCHAFF_HOME'  *)
webertj@15293
    42
(* in 'etc/settings'.                                                        *)
webertj@14350
    43
(* ------------------------------------------------------------------------- *)
webertj@14350
    44
webertj@14350
    45
(* ------------------------------------------------------------------------- *)
webertj@14350
    46
(* USAGE                                                                     *)
webertj@14350
    47
(*                                                                           *)
webertj@14350
    48
(* See the file 'HOL/ex/Refute_Examples.thy' for examples.  The supported    *)
webertj@14350
    49
(* parameters are explained below.                                           *)
webertj@14350
    50
(* ------------------------------------------------------------------------- *)
webertj@14350
    51
webertj@14350
    52
(* ------------------------------------------------------------------------- *)
webertj@14350
    53
(* CURRENT LIMITATIONS                                                       *)
webertj@14350
    54
(*                                                                           *)
webertj@14350
    55
(* 'refute' currently accepts formulas of higher-order predicate logic (with *)
webertj@14350
    56
(* equality), including free/bound/schematic variables, lambda abstractions, *)
webertj@16870
    57
(* sets and set membership, "arbitrary", "The", "Eps", records and           *)
webertj@22058
    58
(* inductively defined sets.  Constants are unfolded automatically, and sort *)
webertj@22058
    59
(* axioms are added as well.  Other, user-asserted axioms however are        *)
webertj@22058
    60
(* ignored.  Inductive datatypes and recursive functions are supported, but  *)
webertj@22058
    61
(* may lead to spurious countermodels.                                       *)
webertj@14463
    62
(*                                                                           *)
webertj@14808
    63
(* The (space) complexity of the algorithm is non-elementary.                *)
webertj@14350
    64
(*                                                                           *)
webertj@16870
    65
(* Schematic type variables are not supported.                               *)
webertj@14350
    66
(* ------------------------------------------------------------------------- *)
webertj@14350
    67
webertj@14350
    68
(* ------------------------------------------------------------------------- *)
webertj@14350
    69
(* PARAMETERS                                                                *)
webertj@14350
    70
(*                                                                           *)
blanchet@34120
    71
(* The following global parameters are currently supported (and required,    *)
blanchet@34120
    72
(* except for "expect"):                                                     *)
webertj@14350
    73
(*                                                                           *)
webertj@14350
    74
(* Name          Type    Description                                         *)
webertj@14350
    75
(*                                                                           *)
webertj@14350
    76
(* "minsize"     int     Only search for models with size at least           *)
webertj@14350
    77
(*                       'minsize'.                                          *)
webertj@14350
    78
(* "maxsize"     int     If >0, only search for models with size at most     *)
webertj@14350
    79
(*                       'maxsize'.                                          *)
webertj@14350
    80
(* "maxvars"     int     If >0, use at most 'maxvars' boolean variables      *)
webertj@14350
    81
(*                       when transforming the term into a propositional     *)
webertj@14350
    82
(*                       formula.                                            *)
webertj@14808
    83
(* "maxtime"     int     If >0, terminate after at most 'maxtime' seconds.   *)
webertj@14808
    84
(*                       This value is ignored under some ML compilers.      *)
webertj@14457
    85
(* "satsolver"   string  Name of the SAT solver to be used.                  *)
blanchet@34120
    86
(* "no_assms"    bool    If "true", assumptions in structured proofs are     *)
blanchet@34120
    87
(*                       not considered.                                     *)
blanchet@34120
    88
(* "expect"      string  Expected result ("genuine", "potential", "none", or *)
blanchet@34120
    89
(*                       "unknown").                                         *)
webertj@14457
    90
(*                                                                           *)
webertj@14808
    91
(* The size of particular types can be specified in the form type=size       *)
webertj@14808
    92
(* (where 'type' is a string, and 'size' is an int).  Examples:              *)
webertj@14808
    93
(* "'a"=1                                                                    *)
webertj@14808
    94
(* "List.list"=2                                                             *)
webertj@14350
    95
(* ------------------------------------------------------------------------- *)
webertj@14350
    96
webertj@14350
    97
(* ------------------------------------------------------------------------- *)
webertj@14350
    98
(* FILES                                                                     *)
webertj@14350
    99
(*                                                                           *)
wenzelm@39048
   100
(* HOL/Tools/prop_logic.ML     Propositional logic                           *)
wenzelm@39048
   101
(* HOL/Tools/sat_solver.ML     SAT solvers                                   *)
wenzelm@39048
   102
(* HOL/Tools/refute.ML         Translation HOL -> propositional logic and    *)
wenzelm@39048
   103
(*                             Boolean assignment -> HOL model               *)
wenzelm@39048
   104
(* HOL/Refute.thy              This file: loads the ML files, basic setup,   *)
wenzelm@39048
   105
(*                             documentation                                 *)
wenzelm@39048
   106
(* HOL/SAT.thy                 Sets default parameters                       *)
wenzelm@39048
   107
(* HOL/ex/Refute_Examples.thy  Examples                                      *)
webertj@14350
   108
(* ------------------------------------------------------------------------- *)
wenzelm@14589
   109
\end{verbatim}
wenzelm@60500
   110
\<close>
webertj@14350
   111
webertj@14350
   112
end