new files for the Allocator
authorpaulson
Tue May 23 12:31:38 2000 +0200 (2000-05-23)
changeset 89281d3bf47a4ecc
parent 8927 1cf815412d78
child 8929 4829556a56f8
new files for the Allocator
src/HOL/UNITY/AllocBase.ML
src/HOL/UNITY/AllocBase.thy
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/HOL/UNITY/AllocBase.ML	Tue May 23 12:31:38 2000 +0200
     1.3 @@ -0,0 +1,24 @@
     1.4 +(*  Title:      HOL/UNITY/AllocBase
     1.5 +    ID:         $Id$
     1.6 +    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
     1.7 +    Copyright   1998  University of Cambridge
     1.8 +
     1.9 +Basis declarations for Chandy and Charpentier's Allocator
    1.10 +*)
    1.11 +
    1.12 +Goal "(ALL i. i<n --> f i <= (g i :: nat)) --> sum_below f n <= sum_below g n";
    1.13 +by (induct_tac "n" 1);
    1.14 +by Auto_tac;
    1.15 +by (dres_inst_tac [("x","n")] spec 1);
    1.16 +by Auto_tac;
    1.17 +by (arith_tac 1);
    1.18 +qed_spec_mp "sum_mono";
    1.19 +
    1.20 +Goal "ALL xs. xs <= ys --> tokens xs <= tokens ys";
    1.21 +by (induct_tac "ys" 1);
    1.22 +by (auto_tac (claset(), simpset() addsimps [prefix_Cons]));
    1.23 +qed_spec_mp "tokens_mono_prefix";
    1.24 +
    1.25 +Goalw [mono_def] "mono tokens";
    1.26 +by (blast_tac (claset() addIs [tokens_mono_prefix]) 1);
    1.27 +qed "mono_tokens";
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/src/HOL/UNITY/AllocBase.thy	Tue May 23 12:31:38 2000 +0200
     2.3 @@ -0,0 +1,24 @@
     2.4 +(*  Title:      HOL/UNITY/AllocBase
     2.5 +    ID:         $Id$
     2.6 +    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
     2.7 +    Copyright   1998  University of Cambridge
     2.8 +
     2.9 +Common declarations for Chandy and Charpentier's Allocator
    2.10 +*)
    2.11 +
    2.12 +AllocBase = Rename + Follows + 
    2.13 +
    2.14 +consts
    2.15 +  NbT      :: nat       (*Number of tokens in system*)
    2.16 +  Nclients :: nat       (*Number of clients*)
    2.17 +
    2.18 +rules
    2.19 +  NbT_pos  "0 < NbT"
    2.20 +
    2.21 +(*This function merely sums the elements of a list*)
    2.22 +consts tokens     :: nat list => nat
    2.23 +primrec 
    2.24 +  "tokens [] = 0"
    2.25 +  "tokens (x#xs) = x + tokens xs"
    2.26 +
    2.27 +end