src/HOL/Hoare/Hoare_Syntax.thy
author wenzelm
Sat, 20 Feb 2021 13:42:37 +0100
changeset 73255 7e2a9a8c2b85
parent 72990 db8f94656024
child 74503 403ce50e6a2a
permissions -rw-r--r--
provide naproche-755224402e36;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
72987
b1be35908165 clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
diff changeset
     1
(*  Title:      HOL/Hoare/Hoare_Syntax.thy
b1be35908165 clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
diff changeset
     2
    Author:     Leonor Prensa Nieto & Tobias Nipkow
b1be35908165 clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
diff changeset
     3
    Author:     Walter Guttmann (extension to total-correctness proofs)
72990
db8f94656024 tuned document, notably authors and sections;
wenzelm
parents: 72987
diff changeset
     4
*)
72987
b1be35908165 clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
diff changeset
     5
72990
db8f94656024 tuned document, notably authors and sections;
wenzelm
parents: 72987
diff changeset
     6
section \<open>Concrete syntax for Hoare logic, with translations for variables\<close>
72987
b1be35908165 clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
diff changeset
     7
b1be35908165 clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
diff changeset
     8
theory Hoare_Syntax
b1be35908165 clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
diff changeset
     9
  imports Main
b1be35908165 clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
diff changeset
    10
begin
b1be35908165 clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
diff changeset
    11
b1be35908165 clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
diff changeset
    12
syntax
b1be35908165 clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
diff changeset
    13
  "_assign" :: "idt \<Rightarrow> 'b \<Rightarrow> 'com"  ("(2_ :=/ _)" [70, 65] 61)
b1be35908165 clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
diff changeset
    14
  "_Seq" :: "'com \<Rightarrow> 'com \<Rightarrow> 'com"  ("(_;/ _)" [61,60] 60)
b1be35908165 clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
diff changeset
    15
  "_Cond" :: "'bexp \<Rightarrow> 'com \<Rightarrow> 'com \<Rightarrow> 'com"  ("(1IF _/ THEN _ / ELSE _/ FI)" [0,0,0] 61)
b1be35908165 clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
diff changeset
    16
  "_While" :: "'bexp \<Rightarrow> 'assn \<Rightarrow> 'var \<Rightarrow> 'com \<Rightarrow> 'com"  ("(1WHILE _/ INV {_} / VAR {_} //DO _ /OD)" [0,0,0,0] 61)
b1be35908165 clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
diff changeset
    17
b1be35908165 clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
diff changeset
    18
syntax
b1be35908165 clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
diff changeset
    19
  "_While0" :: "'bexp \<Rightarrow> 'assn \<Rightarrow> 'com \<Rightarrow> 'com"  ("(1WHILE _/ INV {_} //DO _ /OD)" [0,0,0] 61)
b1be35908165 clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
diff changeset
    20
translations
b1be35908165 clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
diff changeset
    21
  "WHILE b INV {x} DO c OD" \<rightharpoonup> "WHILE b INV {x} VAR {0} DO c OD"
b1be35908165 clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
diff changeset
    22
b1be35908165 clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
diff changeset
    23
syntax
b1be35908165 clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
diff changeset
    24
 "_hoare_vars" :: "[idts, 'assn,'com, 'assn] \<Rightarrow> bool"  ("VARS _// {_} // _ // {_}" [0,0,55,0] 50)
b1be35908165 clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
diff changeset
    25
 "_hoare_vars_tc" :: "[idts, 'assn, 'com, 'assn] \<Rightarrow> bool"  ("VARS _// [_] // _ // [_]" [0,0,55,0] 50)
b1be35908165 clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
diff changeset
    26
syntax (output)
b1be35908165 clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
diff changeset
    27
 "_hoare" :: "['assn, 'com, 'assn] \<Rightarrow> bool"  ("{_} // _ // {_}" [0,55,0] 50)
b1be35908165 clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
diff changeset
    28
 "_hoare_tc" :: "['assn, 'com, 'assn] \<Rightarrow> bool"  ("[_] // _ // [_]" [0,55,0] 50)
b1be35908165 clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
diff changeset
    29
b1be35908165 clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
diff changeset
    30
ML_file \<open>hoare_syntax.ML\<close>
b1be35908165 clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
diff changeset
    31
b1be35908165 clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
diff changeset
    32
end