diff -r 25fd656667a7 -r db196b066b97 PIPBasics.thy~ --- a/PIPBasics.thy~ Sat Jan 09 22:19:27 2016 +0800 +++ b/PIPBasics.thy~ Tue Jan 12 08:35:36 2016 +0800 @@ -33,6 +33,13 @@ context valid_trace begin +lemma actor_inv: + assumes "PIP s e" + and "\ isCreate e" + shows "actor e \ runing s" + using assms + by (induct, auto) + lemma ind [consumes 0, case_names Nil Cons, induct type]: assumes "PP []" and "(\s e. valid_trace s \ valid_trace (e#s) \ @@ -1620,6 +1627,52 @@ ultimately show ?thesis by (simp add:cntCS_def) qed +lemma count_rec1 [simp]: + assumes "Q e" + shows "count Q (e#es) = Suc (count Q es)" + using assms + by (unfold count_def, auto) + +lemma count_rec2 [simp]: + assumes "\Q e" + shows "count Q (e#es) = (count Q es)" + using assms + by (unfold count_def, auto) + +lemma count_rec3 [simp]: + shows "count Q [] = 0" + by (unfold count_def, auto) + +lemma cntP_diff_inv: + assumes "cntP (e#s) th \ cntP s th" + shows "isP e \ actor e = th" +proof(cases e) + case (P th' pty) + show ?thesis + by (cases "(\e. \cs. e = P th cs) (P th' pty)", + insert assms P, auto simp:cntP_def) +qed (insert assms, auto simp:cntP_def) + +lemma isP_E: + assumes "isP e" + obtains cs where "e = P (actor e) cs" + using assms by (cases e, auto) + +lemma isV_E: + assumes "isV e" + obtains cs where "e = V (actor e) cs" + using assms by (cases e, auto) (* ccc *) + +lemma cntV_diff_inv: + assumes "cntV (e#s) th \ cntV s th" + shows "isV e \ actor e = th" +proof(cases e) + case (V th' pty) + show ?thesis + by (cases "(\e. \cs. e = V th cs) (V th' pty)", + insert assms V, auto simp:cntV_def) +qed (insert assms, auto simp:cntV_def) + context valid_trace begin