lemma WCFG_Exit_no_sourcenode [dest]: "prog ⊨ (_Exit_) -et→ n' ==> False" by(induct prog n≡"(_Exit_)" et n' rule:WCFG_induct,auto)
lemma WCFG_Entry_no_targetnode [dest]: "prog ⊨ n -et→ (_Entry_) ==> False" by(induct prog n et n'≡"(_Entry_)" rule:WCFG_induct,auto)
lemma WCFG_sourcelabel_less_num_nodes: "prog ⊨ (_ l _) -et→ n' ==> l < #:prog" proof(induct prog "(_ l _)" et n' arbitrary:l rule:WCFG_induct) case (WCFG_SeqFirst c1 et n' c2) from‹l < #:c1›show ?caseby simp next case (WCFG_SeqConnect c1 et c2) from‹l < #:c1›show ?caseby simp next case (WCFG_SeqSecond c2 n et n' c1) note IH = ‹∧l. n = (_ l _) ==> l < #:c2› from‹n ⊕ #:c1 = (_ l _)›obtain l' where"n = (_ l' _)"by(cases n) auto from IH[OF this] have"l' < #:c2" . with‹n ⊕ #:c1 = (_ l _)›‹n = (_ l' _)›show ?caseby simp next case (WCFG_CondThen c1 n et n' b c2) note IH = ‹∧l. n = (_ l _) ==> l < #:c1› from‹n ⊕ 1 = (_ l _)›obtain l' where"n = (_ l' _)"by(cases n) auto from IH[OF this] have"l' < #:c1" . with‹n ⊕ 1 = (_ l _)›‹n = (_ l' _)›show ?caseby simp next case (WCFG_CondElse c2 n et n' b c1) note IH = ‹∧l. n = (_ l _) ==> l < #:c2› from‹n ⊕ (#:c1 + 1) = (_ l _)›obtain l' where"n = (_ l' _)"by(cases n) auto from IH[OF this] have"l' < #:c2" . with‹n ⊕ (#:c1 + 1) = (_ l _)›‹n = (_ l' _)›show ?caseby simp next case (WCFG_WhileBody c' n et n' b) note IH = ‹∧l. n = (_ l _) ==> l < #:c'› from‹n ⊕ 2 = (_ l _)›obtain l' where"n = (_ l' _)"by(cases n) auto from IH[OF this] have"l' < #:c'" . with‹n ⊕ 2 = (_ l _)›‹n = (_ l' _)›show ?caseby simp next case (WCFG_WhileBodyExit c' n et b) note IH = ‹∧l. n = (_ l _) ==> l < #:c'› from‹n ⊕ 2 = (_ l _)›obtain l' where"n = (_ l' _)"by(cases n) auto from IH[OF this] have"l' < #:c'" . with‹n ⊕ 2 = (_ l _)›‹n = (_ l' _)›show ?caseby simp qed (auto simp:num_inner_nodes_gr_0)
lemma WCFG_targetlabel_less_num_nodes: "prog ⊨ n -et→ (_ l _) ==> l < #:prog" proof(induct prog n et "(_ l _)" arbitrary:l rule:WCFG_induct) case (WCFG_SeqFirst c1 n et c2) from‹l < #:c1›show ?caseby simp next case (WCFG_SeqSecond c2 n et n' c1) note IH = ‹∧l. n' = (_ l _) ==> l < #:c2› from‹n' ⊕ #:c1 = (_ l _)›obtain l' where"n' = (_ l' _)"by(cases n') auto from IH[OF this] have"l' < #:c2" . with‹n' ⊕ #:c1 = (_ l _)›‹n' = (_ l' _)›show ?caseby simp next case (WCFG_CondThen c1 n et n' b c2) note IH = ‹∧l. n' = (_ l _) ==> l < #:c1› from‹n' ⊕ 1 = (_ l _)›obtain l' where"n' = (_ l' _)"by(cases n') auto from IH[OF this] have"l' < #:c1" . with‹n' ⊕ 1 = (_ l _)›‹n' = (_ l' _)›show ?caseby simp next case (WCFG_CondElse c2 n et n' b c1) note IH = ‹∧l. n' = (_ l _) ==> l < #:c2› from‹n' ⊕ (#:c1 + 1) = (_ l _)›obtain l' where"n' = (_ l' _)"by(cases n') auto from IH[OF this] have"l' < #:c2" . with‹n' ⊕ (#:c1 + 1) = (_ l _)›‹n' = (_ l' _)›show ?caseby simp next case (WCFG_WhileBody c' n et n' b) note IH = ‹∧l. n' = (_ l _) ==> l < #:c'› from‹n' ⊕ 2 = (_ l _)›obtain l' where"n' = (_ l' _)"by(cases n') auto from IH[OF this] have"l' < #:c'" . with‹n' ⊕ 2 = (_ l _)›‹n' = (_ l' _)›show ?caseby simp qed (auto simp:num_inner_nodes_gr_0)
lemma WCFG_EntryD: "prog ⊨ (_Entry_) -et→ n' ==> (n' = (_Exit_) ∧ et = (λs. False)\<surd>) ∨ (n' = (_0_) ∧ et = (λs. True)\<surd>)" by(induct prog n≡"(_Entry_)" et n' rule:WCFG_induct,auto)
lemma WCFG_edge_det: "[prog ⊨ n -et→ n'; prog ⊨ n -et'→ n']==> et = et'" proof(induct rule:WCFG_induct) case WCFG_Entry_Exit thus ?caseby(fastforce dest:WCFG_EntryD) next case WCFG_Entry thus ?caseby(fastforce dest:WCFG_EntryD) next case WCFG_Skip thus ?caseby(fastforce elim:WCFG_elims) next case WCFG_LAss thus ?caseby(fastforce elim:WCFG_elims) next case WCFG_LAssSkip thus ?caseby(fastforce elim:WCFG_elims) next case (WCFG_SeqFirst c1 n et n' c2) note IH = ‹c1⊨ n -et'→ n' ==> et = et'› from‹c1⊨ n -et→ n'›‹n' ≠ (_Exit_)›obtain l where"n' = (_ l _)" by (cases n') auto with‹c1⊨ n -et→ n'›have"l < #:c1" by(fastforce intro:WCFG_targetlabel_less_num_nodes) with‹c1;;c2⊨ n -et'→ n'›‹n' = (_ l _)›have"c1⊨ n -et'→ n'" by(fastforce elim:WCFG_elims intro:WCFG_intros dest:label_incr_ge) from IH[OF this] show ?case . next case (WCFG_SeqConnect c1 n et c2) note IH = ‹c1⊨ n -et'→ (_Exit_) ==> et = et'› from‹c1⊨ n -et→ (_Exit_)›‹n ≠ (_Entry_)›obtain l where"n = (_ l _)" by (cases n) auto with‹c1⊨ n -et→ (_Exit_)›have"l < #:c1" by(fastforce intro:WCFG_sourcelabel_less_num_nodes) with‹c1;;c2⊨ n -et'→ (_ 0 _) ⊕ #:c1›‹n = (_ l _)›have"c1⊨ n -et'→ (_Exit_)" by(fastforce elim:WCFG_elims dest:WCFG_targetlabel_less_num_nodes label_incr_ge) from IH[OF this] show ?case . next case (WCFG_SeqSecond c2 n et n' c1) note IH = ‹c2⊨ n -et'→ n' ==> et = et'› from‹c2⊨ n -et→ n'›‹n ≠ (_Entry_)›obtain l where"n = (_ l _)" by (cases n) auto with‹c2⊨ n -et→ n'›have"l < #:c2" by(fastforce intro:WCFG_sourcelabel_less_num_nodes) with‹c1;;c2⊨ n ⊕ #:c1 -et'→ n' ⊕ #:c1›‹n = (_ l _)›have"c2⊨ n -et'→ n'" by -(erule WCFG_elims,(fastforce dest:WCFG_sourcelabel_less_num_nodes label_incr_ge
dest!:label_incr_inj)+) from IH[OF this] show ?case . next case WCFG_CondTrue thus ?caseby(fastforce elim:WCFG_elims) next case WCFG_CondFalse thus ?caseby(fastforce elim:WCFG_elims) next case (WCFG_CondThen c1 n et n' b c2) note IH = ‹c1⊨ n -et'→ n' ==> et = et'› from‹c1⊨ n -et→ n'›‹n ≠ (_Entry_)›obtain l where"n = (_ l _)" by (cases n) auto with‹c1⊨ n -et→ n'›have"l < #:c1" by(fastforce intro:WCFG_sourcelabel_less_num_nodes) with‹if (b) c1 else c2⊨ n ⊕ 1 -et'→ n' ⊕ 1›‹n = (_ l _)› have"c1⊨ n -et'→ n'" by -(erule WCFG_elims,(fastforce dest:label_incr_ge label_incr_inj)+) from IH[OF this] show ?case . next case (WCFG_CondElse c2 n et n' b c1) note IH = ‹c2⊨ n -et'→ n' ==> et = et'› from‹c2⊨ n -et→ n'›‹n ≠ (_Entry_)›obtain l where"n = (_ l _)" by (cases n) auto with‹c2⊨ n -et→ n'›have"l < #:c2" by(fastforce intro:WCFG_sourcelabel_less_num_nodes) with‹if (b) c1 else c2⊨ n ⊕ (#:c1 + 1) -et'→ n' ⊕ (#:c1 + 1)›‹n = (_ l _)› have"c2⊨ n -et'→ n'" by -(erule WCFG_elims,(fastforce dest:WCFG_sourcelabel_less_num_nodes
label_incr_inj label_incr_ge label_incr_simp_rev)+) from IH[OF this] show ?case . next case WCFG_WhileTrue thus ?caseby(fastforce elim:WCFG_elims) next case WCFG_WhileFalse thus ?caseby(fastforce elim:WCFG_elims) next case WCFG_WhileFalseSkip thus ?caseby(fastforce elim:WCFG_elims) next case (WCFG_WhileBody c' n et n' b) note IH = ‹c' ⊨ n -et'→ n' ==> et = et'› from‹c' ⊨ n -et→ n'›‹n ≠ (_Entry_)›obtain l where"n = (_ l _)" by (cases n) auto moreover with‹c' ⊨ n -et→ n'›have"l < #:c'" by(fastforce intro:WCFG_sourcelabel_less_num_nodes) moreover from‹c' ⊨ n -et→ n'›‹n' ≠ (_Exit_)›obtain l' where"n' = (_ l' _)" by (cases n') auto moreover with‹c' ⊨ n -et→ n'›have"l' < #:c'" by(fastforce intro:WCFG_targetlabel_less_num_nodes) ultimatelyhave"c' ⊨ n -et'→ n'"using‹while (b) c' ⊨ n ⊕ 2 -et'→ n' ⊕ 2› by(fastforce elim:WCFG_elims dest:label_incr_start_Node_smaller) from IH[OF this] show ?case . next case (WCFG_WhileBodyExit c' n et b) note IH = ‹c' ⊨ n -et'→ (_Exit_) ==> et = et'› from‹c' ⊨ n -et→ (_Exit_)›‹n ≠ (_Entry_)›obtain l where"n = (_ l _)" by (cases n) auto with‹c' ⊨ n -et→ (_Exit_)›have"l < #:c'" by(fastforce intro:WCFG_sourcelabel_less_num_nodes) with‹while (b) c' ⊨ n ⊕ 2 -et'→ (_0_)›‹n = (_ l _)› have"c' ⊨ n -et'→ (_Exit_)" by -(erule WCFG_elims,auto dest:label_incr_start_Node_smaller) from IH[OF this] show ?case . qed
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.