src/HOL/SMT.thy
changeset 40162 7f58a9a843c2
parent 39483 9f0e5684f04b
child 40274 6486c610a549
equal deleted inserted replaced
40161:539d07b00e5f 40162:7f58a9a843c2
    17   ("Tools/SMT/z3_proof_tools.ML")
    17   ("Tools/SMT/z3_proof_tools.ML")
    18   ("Tools/SMT/z3_proof_literals.ML")
    18   ("Tools/SMT/z3_proof_literals.ML")
    19   ("Tools/SMT/z3_proof_reconstruction.ML")
    19   ("Tools/SMT/z3_proof_reconstruction.ML")
    20   ("Tools/SMT/z3_model.ML")
    20   ("Tools/SMT/z3_model.ML")
    21   ("Tools/SMT/z3_interface.ML")
    21   ("Tools/SMT/z3_interface.ML")
    22   ("Tools/SMT/z3_solver.ML")
    22   ("Tools/SMT/smt_setup_solvers.ML")
    23   ("Tools/SMT/cvc3_solver.ML")
       
    24   ("Tools/SMT/yices_solver.ML")
       
    25 begin
    23 begin
    26 
    24 
    27 
    25 
    28 
    26 
    29 subsection {* Triggers for quantifier instantiation *}
    27 subsection {* Triggers for quantifier instantiation *}
   122 use "Tools/SMT/z3_proof_parser.ML"
   120 use "Tools/SMT/z3_proof_parser.ML"
   123 use "Tools/SMT/z3_proof_tools.ML"
   121 use "Tools/SMT/z3_proof_tools.ML"
   124 use "Tools/SMT/z3_proof_literals.ML"
   122 use "Tools/SMT/z3_proof_literals.ML"
   125 use "Tools/SMT/z3_proof_reconstruction.ML"
   123 use "Tools/SMT/z3_proof_reconstruction.ML"
   126 use "Tools/SMT/z3_model.ML"
   124 use "Tools/SMT/z3_model.ML"
   127 use "Tools/SMT/z3_solver.ML"
   125 use "Tools/SMT/smt_setup_solvers.ML"
   128 use "Tools/SMT/cvc3_solver.ML"
       
   129 use "Tools/SMT/yices_solver.ML"
       
   130 
   126 
   131 setup {*
   127 setup {*
   132   SMT_Solver.setup #>
   128   SMT_Solver.setup #>
   133   Z3_Proof_Reconstruction.setup #>
   129   Z3_Proof_Reconstruction.setup #>
   134   Z3_Solver.setup #>
   130   SMT_Setup_Solvers.setup
   135   CVC3_Solver.setup #>
       
   136   Yices_Solver.setup
       
   137 *}
   131 *}
   138 
   132 
   139 
   133 
   140 
   134 
   141 subsection {* Configuration *}
   135 subsection {* Configuration *}
   168 (given in seconds) to restrict their runtime.  A value greater than
   162 (given in seconds) to restrict their runtime.  A value greater than
   169 120 (seconds) is in most cases not advisable.
   163 120 (seconds) is in most cases not advisable.
   170 *}
   164 *}
   171 
   165 
   172 declare [[ smt_timeout = 20 ]]
   166 declare [[ smt_timeout = 20 ]]
       
   167 
       
   168 text {*
       
   169 In general, the binding to SMT solvers runs as an oracle, i.e, the SMT
       
   170 solvers are fully trusted without additional checks.  The following
       
   171 option can cause the SMT solver to run in proof-producing mode, giving
       
   172 a checkable certificate.  This is currently only implemented for Z3.
       
   173 *}
       
   174 
       
   175 declare [[ smt_oracle = false ]]
       
   176 
       
   177 text {*
       
   178 Each SMT solver provides several commandline options to tweak its
       
   179 behaviour.  They can be passed to the solver by setting the following
       
   180 options.
       
   181 *}
       
   182 
       
   183 declare [[ cvc3_options = "", yices_options = "", z3_options = "" ]]
       
   184 
       
   185 text {*
       
   186 Enable the following option to use built-in support for datatypes and
       
   187 records.  Currently, this is only implemented for Z3 running in oracle
       
   188 mode.
       
   189 *}
       
   190 
       
   191 declare [[ smt_datatypes = false ]]
   173 
   192 
   174 
   193 
   175 
   194 
   176 subsection {* Certificates *}
   195 subsection {* Certificates *}
   177 
   196 
   211 @{text smt_trace} should be set to @{text true}.
   230 @{text smt_trace} should be set to @{text true}.
   212 *}
   231 *}
   213 
   232 
   214 declare [[ smt_trace = false ]]
   233 declare [[ smt_trace = false ]]
   215 
   234 
   216 
   235 text {*
   217 
   236 From the set of assumptions given to the SMT solver, those assumptions
   218 subsection {* Z3-specific options *}
   237 used in the proof are traced when the following option is set to
   219 
   238 @{term true}.  This only works for Z3 when it runs in non-oracle mode
   220 text {*
   239 (see options @{text smt_solver} and @{text smt_oracle} above).
   221 Z3 is the only SMT solver whose proofs are checked (or reconstructed)
   240 *}
   222 in Isabelle (all other solvers are implemented as oracles).  Enabling
   241 
   223 or disabling proof reconstruction for Z3 is controlled by the option
   242 declare [[ smt_trace_used_facts = false ]]
   224 @{text z3_proofs}. 
       
   225 *}
       
   226 
       
   227 declare [[ z3_proofs = true ]]
       
   228 
       
   229 text {*
       
   230 From the set of assumptions given to Z3, those assumptions used in
       
   231 the proof are traced when the option @{text z3_trace_assms} is set to
       
   232 @{term true}.
       
   233 *}
       
   234 
       
   235 declare [[ z3_trace_assms = false ]]
       
   236 
       
   237 text {*
       
   238 Z3 provides several commandline options to tweak its behaviour.  They
       
   239 can be configured by writing them literally as value for the option
       
   240 @{text z3_options}.
       
   241 *}
       
   242 
       
   243 declare [[ z3_options = "" ]]
       
   244 
       
   245 text {*
       
   246 The following configuration option may be used to enable mapping of
       
   247 HOL datatypes and records to native datatypes provided by Z3.
       
   248 *}
       
   249 
       
   250 declare [[ z3_datatypes = false ]]
       
   251 
   243 
   252 
   244 
   253 
   245 
   254 subsection {* Schematic rules for Z3 proof reconstruction *}
   246 subsection {* Schematic rules for Z3 proof reconstruction *}
   255 
   247