# HG changeset patch # User oheimb # Date 947001943 -3600 # Node ID dce06445aafdf3edbc2e2e1c62330c9845c21eb3 # Parent c3790c6b4470a99712b9cbe611fd7655eb481d31 new arg type for max_spec etc. diff -r c3790c6b4470 -r dce06445aafd src/HOL/MicroJava/J/JTypeSafe.ML --- a/src/HOL/MicroJava/J/JTypeSafe.ML Mon Jan 03 17:33:34 2000 +0100 +++ b/src/HOL/MicroJava/J/JTypeSafe.ML Tue Jan 04 17:05:43 2000 +0100 @@ -123,7 +123,7 @@ Goalw [wf_java_prog_def] "\\ wf_java_prog G; a' \\ Null; (h, l)\\\\(G, lT); \ -\ max_spec G T (mn,pTsa) = {((mda,rTa),pTs')}; xc\\|xh; xh\\|h; \ +\ max_spec G C (mn,pTsa) = {((mda,rTa),pTs')}; xc\\|xh; xh\\|h; \ \ list_all2 (conf G h) pvs pTsa;\ \ (md, rT, pns, lvars, blk, res) = \ \ the (method (G,fst (the (h (the_Addr a')))) (mn, pTs'));\ @@ -131,7 +131,7 @@ \ (G, lT)\\blk\\ \\ h\\|xi \\ (xi, xl)\\\\(G, lT); \ \ \\lT. (xi, xl)\\\\(G, lT) \\ (\\T. (G, lT)\\res\\T \\ \ \ xi\\|h' \\ (h', xj)\\\\(G, lT) \\ (x' = None \\ G,h'\\v\\\\T)); \ -\ G,xh\\a'\\\\RefT T \\ \\ \ +\ G,xh\\a'\\\\Class C \\ \\ \ \ xc\\|h' \\ (h', l)\\\\(G, lT) \\ (x' = None \\ G,h'\\v\\\\rTa)"; by( dtac (insertI1 RSN (2,(equalityD2 RS subsetD))) 1); by( dtac (max_spec2appl_meths RS appl_methsD) 1); @@ -325,7 +325,7 @@ qed "exec_type_sound"; Goal "\\G=prg E; wf_java_prog G; G\\(x,s) -e\\a'\\ Norm s'; a' \\ Null;\ -\ s\\\\E; E\\e\\RefT T; m_head G T sig \\ None\\ \\ \ +\ s\\\\E; E\\e\\Class C; m_head G C sig \\ None\\ \\ \ \ method (G,fst (the (heap s' (the_Addr a')))) sig \\ None"; by( dtac eval_type_sound 1); by( atac 1); diff -r c3790c6b4470 -r dce06445aafd src/HOL/MicroJava/J/WellType.ML --- a/src/HOL/MicroJava/J/WellType.ML Mon Jan 03 17:33:34 2000 +0100 +++ b/src/HOL/MicroJava/J/WellType.ML Tue Jan 04 17:05:43 2000 +0100 @@ -5,13 +5,11 @@ *) Goalw [m_head_def] -"\\ m_head G T sig = Some (md,rT); wf_prog wf_mb G; G\\Class T''\\RefT T\\ \\ \ +"\\ m_head G C sig = Some (md,rT); wf_prog wf_mb G; G\\Class T''\\Class C\\ \\ \ \\\md' rT' b'. method (G,T'') sig = Some (md',rT',b') \\ G\\rT'\\rT"; by( forward_tac [widen_Class_RefT] 1); by( etac exE 1); -by( hyp_subst_tac 1); by( asm_full_simp_tac (simpset() delsimps [split_paired_Ex]) 1); -by( rewtac option_map_def); by( strip_tac1 1); by( split_all_tac 1); by( dtac widen_Class_Class 1); @@ -21,12 +19,10 @@ Goal -"\\m_head G T sig = Some (md,rT); G\\Class T''\\RefT T; wf_prog wf_mb G\\ \\ \ +"\\m_head G C sig = Some (md,rT); G\\Class T''\\Class C; wf_prog wf_mb G\\ \\ \ \ \\T' rT' b. method (G,T'') sig = Some (T',rT',b) \\ \ \ G\\rT'\\rT \\ G\\Class T''\\Class T' \\ wf_mhead G sig rT' \\ wf_mb G T' (sig,rT',b)"; -by( dtac widen_methd 1); -by( atac 1); -by( atac 1); +by( datac widen_methd 2 1); by( Clarsimp_tac 1); by( dtac method_wf_mdecl 1); by( atac 1); @@ -36,17 +32,17 @@ val m_head_Object = prove_goalw thy [m_head_def] -"\\x. wf_prog wf_mb G \\ m_head G (ClassT Object) sig = None" (K [Asm_simp_tac 1]); +"\\x. wf_prog wf_mb G \\ m_head G Object sig = None" (K [Asm_simp_tac 1]); Addsimps [m_head_Object]; val max_spec2appl_meths = prove_goalw thy [max_spec_def] - "x \\ max_spec G rT sig \\ x \\ appl_methds G rT sig" + "x \\ max_spec G C sig \\ x \\ appl_methds G C sig" (fn _ => [Fast_tac 1]) RS mp; val appl_methsD = prove_goalw thy [appl_methds_def] -"(mh,pTs')\\appl_methds G rT (mn, pTs) \\ \ -\ m_head G rT (mn, pTs') = Some mh \\ list_all2 (\\T T'. G\\T\\T') pTs pTs'" +"(mh,pTs')\\appl_methds G C (mn, pTs) \\ \ +\ m_head G C (mn, pTs') = Some mh \\ list_all2 (\\T T'. G\\T\\T') pTs pTs'" (K [Fast_tac 1]) RS mp; val is_type_typeof = prove_goal thy diff -r c3790c6b4470 -r dce06445aafd src/HOL/MicroJava/J/WellType.thy --- a/src/HOL/MicroJava/J/WellType.thy Mon Jan 03 17:33:34 2000 +0100 +++ b/src/HOL/MicroJava/J/WellType.thy Tue Jan 04 17:05:43 2000 +0100 @@ -36,26 +36,26 @@ more_spec :: "'c prog \\ (ty \\ 'x) \\ ty list \\ (ty \\ 'x) \\ ty list \\ bool" - m_head :: "'c prog \\ ref_ty \\ sig \\ (ty \\ ty) option" - appl_methds :: "'c prog \\ ref_ty \\ sig \\ ((ty \\ ty) \\ ty list) set" - max_spec :: "'c prog \\ ref_ty \\ sig \\ ((ty \\ ty) \\ ty list) set" + m_head :: "'c prog \\ cname \\ sig \\ (ty \\ ty) option" + appl_methds :: "'c prog \\ cname \\ sig \\ ((ty \\ ty) \\ ty list) set" + max_spec :: "'c prog \\ cname \\ sig \\ ((ty \\ ty) \\ ty list) set" defs - m_head_def "m_head G t sig \\ case t of NullT \\ None | ClassT C \\ + m_head_def "m_head G C sig \\ option_map (\\(md,(rT,mb)). (Class md,rT)) (method (G,C) sig)" more_spec_def "more_spec G \\ \\((d,h),pTs). \\((d',h'),pTs'). G\\d\\d' \\ list_all2 (\\T T'. G\\T\\T') pTs pTs'" (* applicable methods, cf. 15.11.2.1 *) - appl_methds_def "appl_methds G T \\ \\(mn, pTs). {(mh,pTs') |mh pTs'. - m_head G T (mn, pTs') = Some mh \\ + appl_methds_def "appl_methds G C \\ \\(mn, pTs). {(mh,pTs') |mh pTs'. + m_head G C (mn, pTs') = Some mh \\ list_all2 (\\T T'. G\\T\\T') pTs pTs'}" (* maximally specific methods, cf. 15.11.2.2 *) - max_spec_def "max_spec G rT sig \\ {m. m \\appl_methds G rT sig \\ - (\\m'\\appl_methds G rT sig. + max_spec_def "max_spec G C sig \\ {m. m \\appl_methds G C sig \\ + (\\m'\\appl_methds G C sig. more_spec G m' m \\ m' = m)}" consts @@ -129,9 +129,9 @@ (* cf. 15.11.1, 15.11.2, 15.11.3 *) - Call "\\E\\a\\RefT t; + Call "\\E\\a\\Class C; E\\ps[\\]pTs; - max_spec (prg E) t (mn, pTs) = {((md,rT),pTs')}\\ \\ + max_spec (prg E) C (mn, pTs) = {((md,rT),pTs')}\\ \\ E\\a..mn({pTs'}ps)\\rT" (* well-typed expression lists *)