theory OG_Syntax imports OG_Tactics Quote_Antiquote begin
text\<open>Syntax for commands and for assertions and boolean expressions in
commands \<open>com\<close> and annotated commands \<open>ann_com\<close>.\<close>
translations "\x := a" \ "CONST Basic \\(_update_name x (\_. a))\" "r \x := a" \ "CONST AnnBasic r \\(_update_name x (\_. a))\"
syntax "_AnnCond1" :: "'a assn \ 'a bexp \ 'a ann_com \ 'a ann_com \ 'a ann_com"
(\<open>_ //IF _ /THEN _ /ELSE _ /FI\<close> [90,0,0,0] 61) "_AnnCond2" :: "'a assn \ 'a bexp \ 'a ann_com \ 'a ann_com"
(\<open>_ //IF _ /THEN _ /FI\<close> [90,0,0] 61) "_AnnWhile" :: "'a assn \ 'a bexp \ 'a assn \ 'a ann_com \ 'a ann_com"
(\<open>_ //WHILE _ /INV _ //DO _//OD\<close> [90,0,0,0] 61) "_AnnAwait" :: "'a assn \ 'a bexp \ 'a com \ 'a ann_com"
(\<open>_ //AWAIT _ /THEN /_ /END\<close> [90,0,0] 61) "_AnnAtom" :: "'a assn \ 'a com \ 'a ann_com" (\_//\_\\ [90,0] 61) "_AnnWait" :: "'a assn \ 'a bexp \ 'a ann_com" (\_//WAIT _ END\ [90,0] 61)
"_Cond" :: "'a bexp \ 'a com \ 'a com \ 'a com"
(\<open>(0IF _/ THEN _/ ELSE _/ FI)\<close> [0, 0, 0] 61) "_Cond2" :: "'a bexp \ 'a com \ 'a com" (\IF _ THEN _ FI\ [0,0] 56) "_While_inv" :: "'a bexp \ 'a assn \ 'a com \ 'a com"
(\<open>(0WHILE _/ INV _ //DO _ /OD)\<close> [0, 0, 0] 61) "_While" :: "'a bexp \ 'a com \ 'a com"
(\<open>(0WHILE _ //DO _ /OD)\<close> [0, 0] 61)
translations "IF b THEN c1 ELSE c2 FI"\<rightharpoonup> "CONST Cond \<lbrace>b\<rbrace> c1 c2" "IF b THEN c FI"\<rightleftharpoons> "IF b THEN c ELSE SKIP FI" "WHILE b INV i DO c OD"\<rightharpoonup> "CONST While \<lbrace>b\<rbrace> i c" "WHILE b DO c OD"\<rightleftharpoons> "WHILE b INV CONST undefined DO c OD"
"r IF b THEN c1 ELSE c2 FI"\<rightharpoonup> "CONST AnnCond1 r \<lbrace>b\<rbrace> c1 c2" "r IF b THEN c FI"\<rightharpoonup> "CONST AnnCond2 r \<lbrace>b\<rbrace> c" "r WHILE b INV i DO c OD"\<rightharpoonup> "CONST AnnWhile r \<lbrace>b\<rbrace> i c" "r AWAIT b THEN c END"\<rightharpoonup> "CONST AnnAwait r \<lbrace>b\<rbrace> c" "r \c\" \ "r AWAIT CONST True THEN c END" "r WAIT b END"\<rightleftharpoons> "r AWAIT b THEN SKIP END"
fun Parallel_tr' ts = Syntax.const \<^syntax_const>\_PAR\ $ Parallel_PAR ts; in
[(\<^const_syntax>\<open>Collect\<close>, K assert_tr'),
(\<^const_syntax>\<open>Basic\<close>, K assign_tr'),
(\<^const_syntax>\<open>Cond\<close>, K (bexp_tr' \<^syntax_const>\<open>_Cond\<close>)),
(\<^const_syntax>\<open>While\<close>, K (bexp_tr' \<^syntax_const>\<open>_While_inv\<close>)),
(\<^const_syntax>\<open>AnnBasic\<close>, K annassign_tr'),
(\<^const_syntax>\<open>AnnWhile\<close>, K (annbexp_tr' \<^syntax_const>\<open>_AnnWhile\<close>)),
(\<^const_syntax>\<open>AnnAwait\<close>, K (annbexp_tr' \<^syntax_const>\<open>_AnnAwait\<close>)),
(\<^const_syntax>\<open>AnnCond1\<close>, K (annbexp_tr' \<^syntax_const>\<open>_AnnCond1\<close>)),
(\<^const_syntax>\<open>AnnCond2\<close>, K (annbexp_tr' \<^syntax_const>\<open>_AnnCond2\<close>))] end \<close>
end
¤ Dauer der Verarbeitung: 0.1 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.