(* Title: HOL/UNITY/Comp/AllocBase.thy Author: Lawrence C Paulson, Cambridge University Computer Laboratory Copyright 1998 University of Cambridge *)
section‹Common Declarations for Chandy and Charpentier's Allocator›
theory AllocBase imports"../UNITY_Main""HOL-Library.Multiset_Order"begin
consts Nclients :: nat (*Number of clients*)
axiomatization NbT :: nat (*Number of tokens in system*) where NbT_pos: "0 < NbT"
abbreviation (input) tokens :: "nat list ==> nat" where "tokens ≡ sum_list"
abbreviation (input) "bag_of ≡ mset"
lemma sum_fun_mono: fixes f :: "nat ==> nat" shows"(∧i. i < n ==> f i ≤ g i) ==> sum f {..≤ sum g {.. by (induct n) (auto simp add: lessThan_Suc add_le_mono)
lemma bag_of_nths_lemma: "(∑i∈ A Int lessThan k. {#if i (∑i∈ A Int lessThan k. {#f i#})" by (rule sum.cong, auto)
lemma bag_of_nths: "bag_of (nths l A) = (∑i∈ A Int lessThan (length l). {# l!i #})" by (rule_tac xs = l in rev_induct)
(simp_all add: nths_append Int_insert_right lessThan_Suc nth_append
bag_of_nths_lemma ac_simps)
lemma bag_of_nths_Un_Int: "bag_of (nths l (A Un B)) + bag_of (nths l (A Int B)) = bag_of (nths l A) + bag_of (nths l B)" apply (subgoal_tac "A Int B Int {.. (A Int {..) apply (simp add: bag_of_nths Int_Un_distrib2 sum.union_inter, blast) done
lemma bag_of_nths_Un_disjoint: "A Int B = {} ==> bag_of (nths l (A Un B)) = bag_of (nths l A) + bag_of (nths l B)" by (simp add: bag_of_nths_Un_Int [symmetric])
lemma bag_of_nths_UN_disjoint [rule_format]: "[| finite I; ∀i∈I. ∀j∈I. i≠j ⟶ A i Int A j = {} |] ==> bag_of (nths l (∪(A ` I))) = (∑i∈I. bag_of (nths l (A i)))" apply (auto simp add: bag_of_nths) unfolding UN_simps [symmetric] apply (subst sum.UNION_disjoint) apply auto done
end
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.9 Sekunden
(vorverarbeitet am 2026-05-03)
¤
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.