src/HOL/SMT_Examples/Boogie.thy
author Walther Neuper <walther.neuper@jku.at>
Mon, 15 Mar 2021 10:04:17 +0100
changeset 60174 21d482c9ab68
parent 60166 7d6f46b7fc10
child 60199 f2a13c9ed039
permissions -rw-r--r--
Isabelle2020->21: th_load with constant string

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