src/HOL/UNITY/AllocBase.thy
author paulson
Fri, 14 Jul 2000 14:47:15 +0200
changeset 9336 9ae89b9ce206
parent 9109 0085c32a533b
child 10265 4e004b548049
permissions -rw-r--r--
moved sublist from UNITY/AllocBase to List
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
8928
1d3bf47a4ecc new files for the Allocator
paulson
parents:
diff changeset
     1
(*  Title:      HOL/UNITY/AllocBase
1d3bf47a4ecc new files for the Allocator
paulson
parents:
diff changeset
     2
    ID:         $Id$
1d3bf47a4ecc new files for the Allocator
paulson
parents:
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
1d3bf47a4ecc new files for the Allocator
paulson
parents:
diff changeset
     4
    Copyright   1998  University of Cambridge
1d3bf47a4ecc new files for the Allocator
paulson
parents:
diff changeset
     5
1d3bf47a4ecc new files for the Allocator
paulson
parents:
diff changeset
     6
Common declarations for Chandy and Charpentier's Allocator
8989
8791e3304748 sublist and some lemmas about it
paulson
parents: 8974
diff changeset
     7
9024
b1f37f6819c4 new constant bag_of
paulson
parents: 8989
diff changeset
     8
add_path "../Induct";
b1f37f6819c4 new constant bag_of
paulson
parents: 8989
diff changeset
     9
time_use_thy "AllocBase";
8928
1d3bf47a4ecc new files for the Allocator
paulson
parents:
diff changeset
    10
*)
1d3bf47a4ecc new files for the Allocator
paulson
parents:
diff changeset
    11
9024
b1f37f6819c4 new constant bag_of
paulson
parents: 8989
diff changeset
    12
AllocBase = Rename + Follows + 
8928
1d3bf47a4ecc new files for the Allocator
paulson
parents:
diff changeset
    13
1d3bf47a4ecc new files for the Allocator
paulson
parents:
diff changeset
    14
consts
1d3bf47a4ecc new files for the Allocator
paulson
parents:
diff changeset
    15
  NbT      :: nat       (*Number of tokens in system*)
1d3bf47a4ecc new files for the Allocator
paulson
parents:
diff changeset
    16
  Nclients :: nat       (*Number of clients*)
1d3bf47a4ecc new files for the Allocator
paulson
parents:
diff changeset
    17
1d3bf47a4ecc new files for the Allocator
paulson
parents:
diff changeset
    18
rules
1d3bf47a4ecc new files for the Allocator
paulson
parents:
diff changeset
    19
  NbT_pos  "0 < NbT"
1d3bf47a4ecc new files for the Allocator
paulson
parents:
diff changeset
    20
1d3bf47a4ecc new files for the Allocator
paulson
parents:
diff changeset
    21
(*This function merely sums the elements of a list*)
1d3bf47a4ecc new files for the Allocator
paulson
parents:
diff changeset
    22
consts tokens     :: nat list => nat
1d3bf47a4ecc new files for the Allocator
paulson
parents:
diff changeset
    23
primrec 
1d3bf47a4ecc new files for the Allocator
paulson
parents:
diff changeset
    24
  "tokens [] = 0"
1d3bf47a4ecc new files for the Allocator
paulson
parents:
diff changeset
    25
  "tokens (x#xs) = x + tokens xs"
1d3bf47a4ecc new files for the Allocator
paulson
parents:
diff changeset
    26
9024
b1f37f6819c4 new constant bag_of
paulson
parents: 8989
diff changeset
    27
consts
b1f37f6819c4 new constant bag_of
paulson
parents: 8989
diff changeset
    28
  bag_of :: 'a list => 'a multiset
b1f37f6819c4 new constant bag_of
paulson
parents: 8989
diff changeset
    29
b1f37f6819c4 new constant bag_of
paulson
parents: 8989
diff changeset
    30
primrec
b1f37f6819c4 new constant bag_of
paulson
parents: 8989
diff changeset
    31
  "bag_of []     = {#}"
b1f37f6819c4 new constant bag_of
paulson
parents: 8989
diff changeset
    32
  "bag_of (x#xs) = {#x#} + bag_of xs"
b1f37f6819c4 new constant bag_of
paulson
parents: 8989
diff changeset
    33
8928
1d3bf47a4ecc new files for the Allocator
paulson
parents:
diff changeset
    34
end