Theory JVMCFG
chapter ‹A Control Flow Graph for Jinja Byte Code›
section ‹Formalizing the CFG›
theory JVMCFG imports "../StaticInter/BasicDefs" Jinja.BVExample begin
declare lesub_list_impl_same_size [simp del]
declare nlistsE_length [simp del]
subsection ‹Type definitions›
subsubsection ‹Wellformed Programs›
definition "wf_jvmprog = {(P, Phi). wf_jvm_prog⇘Phi⇙ P}"
typedef wf_jvmprog = "wf_jvmprog"
proof
show "(E, Phi) ∈ wf_jvmprog"
unfolding wf_jvmprog_def by (auto intro: wf_prog)
qed
hide_const Phi E
abbreviation PROG :: "wf_jvmprog ⇒ jvm_prog"
where "PROG P ≡ fst(Rep_wf_jvmprog(P))"
abbreviation TYPING :: "wf_jvmprog ⇒ ty⇩P"
where "TYPING P ≡ snd(Rep_wf_jvmprog(P))"
lemma wf_jvmprog_is_wf_typ: "wf_jvm_prog⇘TYPING P⇙ (PROG P)"
using Rep_wf_jvmprog [of P]
by (auto simp: wf_jvmprog_def split_beta)
lemma wf_jvmprog_is_wf: "wf_jvm_prog (PROG P)"
using wf_jvmprog_is_wf_typ unfolding wf_jvm_prog_def
by blast
subsubsection ‹Interprocedural CFG›
type_synonym jvm_method = "wf_jvmprog × cname × mname"