@@ -5,7 +5,7 @@ theory Ast
55
66begin
77
8- subsection \<open>Defining the AST and how to step through it. An AST is list of \<^term>\<open>bigblock\<close> . \<close>
8+ subsection \<open>AST definition \<close>
99
1010type_synonym name = string
1111type_synonym label = string
@@ -25,9 +25,15 @@ datatype parsed_structured_cmd
2525and bigblock
2626 = BigBlock "name option" "cmd list" "parsed_structured_cmd option" "transfer_cmd option"
2727
28+
29+ text \<open>A Boogie statement represented as an AST is a list of \<^typ>\<open>bigblock\<close> \<close>
30+
2831type_synonym ast = "bigblock list"
2932
30- text \<open>continuations; used for formalizing Gotos and numbered Breaks\<close>
33+ subsection \<open>AST semantics\<close>
34+
35+ text \<open>We define a continuation-based small-step semantics.\<close>
36+
3137datatype cont
3238 = KStop
3339 | KSeq "bigblock" cont
@@ -81,8 +87,8 @@ fun is_final :: "'a ast_config \<Rightarrow> bool"
8187 "is_final ((BigBlock bb_name [] None None), KStop, s1) = True"
8288 | "is_final other = False"
8389
84- text \<open>function defining the semantics of bigblocks; small -step semantics
85- Note: arrow symbols in the 'syntactic sugar' clash if the exact same syntax is used as in red_cmd\<close>
90+ text \<open>Small -step semantics\<close>
91+
8692inductive red_bigblock :: "'a absval_ty_fun \<Rightarrow> 'm proc_context \<Rightarrow> var_context \<Rightarrow> 'a fun_interp \<Rightarrow> rtype_env \<Rightarrow> ast \<Rightarrow> 'a ast_config \<Rightarrow> 'a ast_config \<Rightarrow> bool"
8793 ( "_,_,_,_,_,_ \<turnstile> (\<langle>_\<rangle> \<longrightarrow>/ _)" [ 51 , 0 , 0 , 0 ] 81 )
8894 for A :: "'a absval_ty_fun" and M :: "'m proc_context" and \<Lambda> :: var_context and \<Gamma> :: "'a fun_interp" and \<Omega> :: rtype_env and T :: ast
0 commit comments