src/HOL/SMT/Z3.thy
author boehmes
Wed, 12 May 2010 23:53:48 +0200
changeset 36884 88cf4896b980
parent 36350 bc7982c54e37
child 36895 a96f9793d9c5
permissions -rw-r--r--
moved the addition of DLO tactic into the Z3 theory (DLO is required only for Z3 proof reconstruction)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
33010
39f73a59e855 added proof reconstructon for Z3,
boehmes
parents:
diff changeset
     1
(*  Title:      HOL/SMT/Z3.thy
39f73a59e855 added proof reconstructon for Z3,
boehmes
parents:
diff changeset
     2
    Author:     Sascha Boehme, TU Muenchen
39f73a59e855 added proof reconstructon for Z3,
boehmes
parents:
diff changeset
     3
*)
39f73a59e855 added proof reconstructon for Z3,
boehmes
parents:
diff changeset
     4
39f73a59e855 added proof reconstructon for Z3,
boehmes
parents:
diff changeset
     5
header {* Binding to the SMT solver Z3, with proof reconstruction *}
39f73a59e855 added proof reconstructon for Z3,
boehmes
parents:
diff changeset
     6
39f73a59e855 added proof reconstructon for Z3,
boehmes
parents:
diff changeset
     7
theory Z3
36884
88cf4896b980 moved the addition of DLO tactic into the Z3 theory (DLO is required only for Z3 proof reconstruction)
boehmes
parents: 36350
diff changeset
     8
imports SMT_Base "~~/src/HOL/Decision_Procs/Dense_Linear_Order"
33010
39f73a59e855 added proof reconstructon for Z3,
boehmes
parents:
diff changeset
     9
uses
39f73a59e855 added proof reconstructon for Z3,
boehmes
parents:
diff changeset
    10
  "Tools/z3_proof_terms.ML"
39f73a59e855 added proof reconstructon for Z3,
boehmes
parents:
diff changeset
    11
  "Tools/z3_proof_rules.ML"
39f73a59e855 added proof reconstructon for Z3,
boehmes
parents:
diff changeset
    12
  "Tools/z3_proof.ML"
39f73a59e855 added proof reconstructon for Z3,
boehmes
parents:
diff changeset
    13
  "Tools/z3_model.ML"
39f73a59e855 added proof reconstructon for Z3,
boehmes
parents:
diff changeset
    14
  "Tools/z3_interface.ML"
39f73a59e855 added proof reconstructon for Z3,
boehmes
parents:
diff changeset
    15
  "Tools/z3_solver.ML"
39f73a59e855 added proof reconstructon for Z3,
boehmes
parents:
diff changeset
    16
begin
39f73a59e855 added proof reconstructon for Z3,
boehmes
parents:
diff changeset
    17
36884
88cf4896b980 moved the addition of DLO tactic into the Z3 theory (DLO is required only for Z3 proof reconstruction)
boehmes
parents: 36350
diff changeset
    18
setup {*
88cf4896b980 moved the addition of DLO tactic into the Z3 theory (DLO is required only for Z3 proof reconstruction)
boehmes
parents: 36350
diff changeset
    19
  Z3_Proof_Rules.setup #>
88cf4896b980 moved the addition of DLO tactic into the Z3 theory (DLO is required only for Z3 proof reconstruction)
boehmes
parents: 36350
diff changeset
    20
  Z3_Solver.setup #>
88cf4896b980 moved the addition of DLO tactic into the Z3 theory (DLO is required only for Z3 proof reconstruction)
boehmes
parents: 36350
diff changeset
    21
  Arith_Data.add_tactic "Ferrante-Rackoff" (K FerranteRackoff.dlo_tac)
88cf4896b980 moved the addition of DLO tactic into the Z3 theory (DLO is required only for Z3 proof reconstruction)
boehmes
parents: 36350
diff changeset
    22
*}
33010
39f73a59e855 added proof reconstructon for Z3,
boehmes
parents:
diff changeset
    23
39f73a59e855 added proof reconstructon for Z3,
boehmes
parents:
diff changeset
    24
lemmas [z3_rewrite] =
39f73a59e855 added proof reconstructon for Z3,
boehmes
parents:
diff changeset
    25
  refl eq_commute conj_commute disj_commute simp_thms nnf_simps
36350
bc7982c54e37 dropped group_simps, ring_simps, field_eq_simps
haftmann
parents: 33610
diff changeset
    26
  ring_distribs field_simps times_divide_eq_right times_divide_eq_left if_True if_False
33021
c065b9300d44 additional schematic rules for Z3's rewrite rule
boehmes
parents: 33010
diff changeset
    27
33610
43bf5773f92a changed URL of SMT server,
boehmes
parents: 33021
diff changeset
    28
lemma [z3_rewrite]: "(P \<noteq> Q) = (Q = (\<not>P))" by fast
43bf5773f92a changed URL of SMT server,
boehmes
parents: 33021
diff changeset
    29
33021
c065b9300d44 additional schematic rules for Z3's rewrite rule
boehmes
parents: 33010
diff changeset
    30
lemma [z3_rewrite]: "(\<not>False \<longrightarrow> P) = P" by fast
c065b9300d44 additional schematic rules for Z3's rewrite rule
boehmes
parents: 33010
diff changeset
    31
lemma [z3_rewrite]: "(P \<longrightarrow> Q) = (Q \<or> \<not>P)" by fast
c065b9300d44 additional schematic rules for Z3's rewrite rule
boehmes
parents: 33010
diff changeset
    32
lemma [z3_rewrite]: "(\<not>P \<longrightarrow> Q) = (P \<or> Q)" by fast
c065b9300d44 additional schematic rules for Z3's rewrite rule
boehmes
parents: 33010
diff changeset
    33
lemma [z3_rewrite]: "(\<not>P \<longrightarrow> Q) = (Q \<or> P)" by fast
c065b9300d44 additional schematic rules for Z3's rewrite rule
boehmes
parents: 33010
diff changeset
    34
c065b9300d44 additional schematic rules for Z3's rewrite rule
boehmes
parents: 33010
diff changeset
    35
lemma [z3_rewrite]: "(if P then True else False) = P" by simp
c065b9300d44 additional schematic rules for Z3's rewrite rule
boehmes
parents: 33010
diff changeset
    36
lemma [z3_rewrite]: "(if P then False else True) = (\<not>P)" by simp
c065b9300d44 additional schematic rules for Z3's rewrite rule
boehmes
parents: 33010
diff changeset
    37
c065b9300d44 additional schematic rules for Z3's rewrite rule
boehmes
parents: 33010
diff changeset
    38
lemma [z3_rewrite]:
c065b9300d44 additional schematic rules for Z3's rewrite rule
boehmes
parents: 33010
diff changeset
    39
  "0 + (x::int) = x"
c065b9300d44 additional schematic rules for Z3's rewrite rule
boehmes
parents: 33010
diff changeset
    40
  "x + 0 = x"
c065b9300d44 additional schematic rules for Z3's rewrite rule
boehmes
parents: 33010
diff changeset
    41
  "0 * x = 0"
c065b9300d44 additional schematic rules for Z3's rewrite rule
boehmes
parents: 33010
diff changeset
    42
  "1 * x = x"
c065b9300d44 additional schematic rules for Z3's rewrite rule
boehmes
parents: 33010
diff changeset
    43
  "x + y = y + x"
c065b9300d44 additional schematic rules for Z3's rewrite rule
boehmes
parents: 33010
diff changeset
    44
  by auto
c065b9300d44 additional schematic rules for Z3's rewrite rule
boehmes
parents: 33010
diff changeset
    45
c065b9300d44 additional schematic rules for Z3's rewrite rule
boehmes
parents: 33010
diff changeset
    46
lemma [z3_rewrite]:
c065b9300d44 additional schematic rules for Z3's rewrite rule
boehmes
parents: 33010
diff changeset
    47
  "0 + (x::real) = x"
c065b9300d44 additional schematic rules for Z3's rewrite rule
boehmes
parents: 33010
diff changeset
    48
  "x + 0 = x"
c065b9300d44 additional schematic rules for Z3's rewrite rule
boehmes
parents: 33010
diff changeset
    49
  "0 * x = 0"
c065b9300d44 additional schematic rules for Z3's rewrite rule
boehmes
parents: 33010
diff changeset
    50
  "1 * x = x"
c065b9300d44 additional schematic rules for Z3's rewrite rule
boehmes
parents: 33010
diff changeset
    51
  "x + y = y + x"
c065b9300d44 additional schematic rules for Z3's rewrite rule
boehmes
parents: 33010
diff changeset
    52
  by auto
33010
39f73a59e855 added proof reconstructon for Z3,
boehmes
parents:
diff changeset
    53
39f73a59e855 added proof reconstructon for Z3,
boehmes
parents:
diff changeset
    54
end