| 
52722
 | 
     1  | 
(*  Title:      HOL/SMT_Examples/Boogie.thy
  | 
| 
 | 
     2  | 
    Author:     Sascha Boehme, TU Muenchen
  | 
| 
 | 
     3  | 
*)
  | 
| 
 | 
     4  | 
  | 
| 
 | 
     5  | 
header {* Proving Boogie-generated verification conditions *}
 | 
| 
 | 
     6  | 
  | 
| 
 | 
     7  | 
theory Boogie
  | 
| 
 | 
     8  | 
imports Main
  | 
| 
 | 
     9  | 
begin
  | 
| 
 | 
    10  | 
  | 
| 
 | 
    11  | 
text {*
 | 
| 
 | 
    12  | 
HOL-Boogie and its applications are described in:
  | 
| 
 | 
    13  | 
\begin{itemize}
 | 
| 
 | 
    14  | 
  | 
| 
 | 
    15  | 
\item Sascha B"ohme, K. Rustan M. Leino, and Burkhart Wolff.
  | 
| 
 | 
    16  | 
HOL-Boogie --- An Interactive Prover for the Boogie Program-Verifier.
  | 
| 
 | 
    17  | 
Theorem Proving in Higher Order Logics, 2008.
  | 
| 
 | 
    18  | 
  | 
| 
 | 
    19  | 
\item Sascha B"ohme, Micha{\l} Moskal, Wolfram Schulte, and Burkhart Wolff.
 | 
| 
 | 
    20  | 
HOL-Boogie --- An Interactive Prover-Backend for the Verifying C Compiler.
  | 
| 
 | 
    21  | 
Journal of Automated Reasoning, 2009.
  | 
| 
 | 
    22  | 
  | 
| 
 | 
    23  | 
\end{itemize}
 | 
| 
 | 
    24  | 
*}
  | 
| 
 | 
    25  | 
  | 
| 
 | 
    26  | 
  | 
| 
 | 
    27  | 
  | 
| 
 | 
    28  | 
section {* Built-in types and functions of Boogie *}
 | 
| 
 | 
    29  | 
  | 
| 
 | 
    30  | 
subsection {* Integer arithmetics *}
 | 
| 
 | 
    31  | 
  | 
| 
 | 
    32  | 
text {*
 | 
| 
 | 
    33  | 
The operations @{text div} and @{text mod} are built-in in Boogie, but
 | 
| 
 | 
    34  | 
without a particular semantics due to different interpretations in
  | 
| 
 | 
    35  | 
programming languages. We assume that each application comes with a
  | 
| 
 | 
    36  | 
proper axiomatization.
  | 
| 
 | 
    37  | 
*}
  | 
| 
 | 
    38  | 
  | 
| 
 | 
    39  | 
axiomatization
  | 
| 
 | 
    40  | 
  boogie_div :: "int \<Rightarrow> int \<Rightarrow> int" (infixl "div'_b" 70) and
  | 
| 
 | 
    41  | 
  boogie_mod :: "int \<Rightarrow> int \<Rightarrow> int" (infixl "mod'_b" 70)
  | 
| 
 | 
    42  | 
  | 
| 
 | 
    43  | 
  | 
| 
 | 
    44  | 
  | 
| 
 | 
    45  | 
section {* Setup *}
 | 
| 
 | 
    46  | 
  | 
| 
 | 
    47  | 
ML_file "boogie.ML"
  | 
| 
 | 
    48  | 
  | 
| 
 | 
    49  | 
  | 
| 
 | 
    50  | 
  | 
| 
 | 
    51  | 
section {* Verification condition proofs *}
 | 
| 
 | 
    52  | 
  | 
| 
 | 
    53  | 
declare [[smt_oracle = false]]
  | 
| 
 | 
    54  | 
declare [[smt_read_only_certificates = true]]
  | 
| 
 | 
    55  | 
  | 
| 
 | 
    56  | 
  | 
| 
 | 
    57  | 
declare [[smt_certificates = "Boogie_Max.certs"]]
  | 
| 
 | 
    58  | 
  | 
| 
 | 
    59  | 
setup {* Boogie.boogie_prove "Boogie_Max.b2i" *}
 | 
| 
 | 
    60  | 
  | 
| 
 | 
    61  | 
  | 
| 
 | 
    62  | 
declare [[smt_certificates = "Boogie_Dijkstra.certs"]]
  | 
| 
 | 
    63  | 
  | 
| 
 | 
    64  | 
setup {* Boogie.boogie_prove "Boogie_Dijkstra.b2i" *}
 | 
| 
 | 
    65  | 
  | 
| 
 | 
    66  | 
  | 
| 
 | 
    67  | 
declare [[z3_with_extensions = true]]
  | 
| 
 | 
    68  | 
declare [[smt_certificates = "VCC_Max.certs"]]
  | 
| 
 | 
    69  | 
  | 
| 
 | 
    70  | 
setup {* Boogie.boogie_prove "VCC_Max.b2i" *}
 | 
| 
 | 
    71  | 
  | 
| 
 | 
    72  | 
end
  |