src/HOL/SMT/SMT.thy
author wenzelm
Tue, 10 Nov 2009 23:18:03 +0100
changeset 33604 d4220df6fde2
parent 33472 e88f67d679c4
child 34983 e5cb3a016094
permissions -rw-r--r--
Toplevel.thread provides Isar-style exception output;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
32618
42865636d006 added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff changeset
     1
(*  Title:      HOL/SMT/SMT.thy
42865636d006 added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff changeset
     2
    Author:     Sascha Boehme, TU Muenchen
42865636d006 added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff changeset
     3
*)
42865636d006 added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff changeset
     4
33010
39f73a59e855 added proof reconstructon for Z3,
boehmes
parents: 32618
diff changeset
     5
header {* Bindings to several SMT solvers *}
32618
42865636d006 added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff changeset
     6
42865636d006 added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff changeset
     7
theory SMT
33010
39f73a59e855 added proof reconstructon for Z3,
boehmes
parents: 32618
diff changeset
     8
imports SMT_Base Z3
32618
42865636d006 added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff changeset
     9
uses
42865636d006 added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff changeset
    10
  "Tools/cvc3_solver.ML"
42865636d006 added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff changeset
    11
  "Tools/yices_solver.ML"
42865636d006 added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff changeset
    12
begin
42865636d006 added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff changeset
    13
33010
39f73a59e855 added proof reconstructon for Z3,
boehmes
parents: 32618
diff changeset
    14
setup {* CVC3_Solver.setup #> Yices_Solver.setup *}
32618
42865636d006 added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff changeset
    15
33472
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    16
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    17
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    18
section {* Setup *}
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    19
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    20
text {*
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    21
Without further ado, the SMT solvers CVC3 and Z3 are provided
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    22
remotely via an SMT server. For faster responses, the solver
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    23
environment variables CVC3_SOLVER, YICES_SOLVER, and Z3_SOLVER
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    24
need to point to the respective SMT solver executable.
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    25
*}
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    26
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    27
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    28
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    29
section {* Available configuration options *}
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    30
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    31
text {* Choose the SMT solver to be applied (one of cvc3, yices, or z3): *}
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    32
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    33
declare [[ smt_solver = z3 ]]
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    34
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    35
text {* Restrict the runtime of an SMT solver (in seconds): *}
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    36
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    37
declare [[ smt_timeout = 20 ]]
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    38
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    39
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    40
subsection {* Z3-specific options *}
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    41
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    42
text {* Enable proof reconstruction for Z3: *}
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    43
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    44
declare [[ z3_proofs = false ]]
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    45
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    46
text {* Pass extra command-line arguments to Z3
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    47
to control its behaviour: *}
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    48
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    49
declare [[ z3_options = "" ]]
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    50
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    51
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    52
subsection {* Special configuration options *}
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    53
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    54
text {*
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    55
Trace the problem file, the result of the SMT solver and
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    56
further information: *}
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    57
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    58
declare [[ smt_trace = false ]]
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    59
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    60
text {* Unfold (some) definitions passed to the SMT solver: *}
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    61
32618
42865636d006 added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff changeset
    62
declare [[ smt_unfold_defs = true ]]
33472
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    63
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    64
text {*
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    65
Produce or use certificates (to avoid repeated invocation of an
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    66
SMT solver again and again). The value is an absolute path
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    67
pointing to the problem file. See also the examples. *}
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    68
e88f67d679c4 added documentation for local SMT solver setup and available SMT options,
boehmes
parents: 33010
diff changeset
    69
declare [[ smt_keep = "", smt_cert = "" ]]
32618
42865636d006 added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff changeset
    70
42865636d006 added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff changeset
    71
end