section‹The Typing Framework for the JVM \label{sec:JVM}›
theory TF_JVM imports"../DFA/Typing_Framework_err" EffectMono BVSpec begin
definition exec :: "jvm_prog ==> nat ==> ty ==> ex_table ==> instr list ==> tyi' err step_type" where "exec G maxs rT et bs ≡ err_step (size bs) (λpc. app (bs!pc) G maxs rT pc (size bs) et) (λpc. eff (bs!pc) G pc et)"
locale JVM_sl = fixes P :: jvm_prog and mxs and mxl0and n fixes Ts :: "ty list"and"is"and xt and Tr
fixes mxl and A and r and f and app and eff and step defines [simp]: "mxl ≡ 1+size Ts+mxl0" defines [simp]: "A ≡ states P mxs mxl" defines [simp]: "r ≡ JVM_SemiType.le P mxs mxl" defines [simp]: "f ≡ JVM_SemiType.sup P mxs mxl"
defines [simp]: "app ≡ λpc. Effect.app (is!pc) P mxs Tr pc (size is) xt" defines [simp]: "eff ≡ λpc. Effect.eff (is!pc) P pc xt" defines [simp]: "step ≡ err_step (size is) app eff"
defines [simp]: "n ≡ size is"
locale start_context = JVM_sl + fixes p and C assumes wf: "wf_prog p P" assumes C: "is_class P C" assumes Ts: "set Ts ⊆ types P"
fixes first :: tyi' and start defines [simp]: "first ≡ Some ([],OK (Class C) # map OK Ts @ replicate mxl0 Err)" defines [simp]: "start ≡ OK first # replicate (size is - 1) (OK None)"
subsection‹Connecting JVM and Framework› lemma (in start_context) semi: "semilat (A, r, f)" using semilat_JVM[OF wf] by (auto simp: JVM_SemiType.le_def JVM_SemiType.sup_def states_def)
lemma (in JVM_sl) step_def_exec: "step ≡ exec P mxs Tr xt is" by (simp add: exec_def)
lemma special_ex_swap_lemma [iff]: "(? X. (? n. X = A n & P n) & Q X) = (? n. Q(A n) & P n)" by blast
lemma ex_in_nlists [iff]: "(∃n. ST ∈ nlists n A ∧ n ≤ mxs) = (set ST ⊆ A ∧ size ST ≤ mxs)" by (unfold nlists_def) auto
lemma singleton_nlists: "(∃n. [Class C] ∈ nlists n (types P) ∧ n ≤ mxs) = (is_class P C ∧ 0 < mxs)" by auto
lemma set_drop_subset: "set xs ⊆ A ==> set (drop n xs) ⊆ A" by (auto dest: in_set_dropD)
lemma (in start_context) first_in_A [iff]: "OK first ∈ A" using Ts C by (force intro!: nlists_appendI simp add: JVM_states_unfold)
lemma (in JVM_sl) wt_method_def2: "wt_method P C' Ts Tr mxs mxl0 is xt τs = (is ≠ [] ∧ size τs = size is ∧ OK ` set τs ⊆ states P mxs mxl ∧ wt_start P C' Ts mxl0 τs ∧ wt_app_eff (sup_state_opt P) app eff τs)" (*<*) by (auto simp: wt_method_def wt_app_eff_def wt_instr_def lesub_def check_types_def) (*>*)
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 und die Messung sind noch experimentell.