equal
deleted
inserted
replaced
6 section\<open>Distributed Resource Management System: the Client\<close> |
6 section\<open>Distributed Resource Management System: the Client\<close> |
7 |
7 |
8 theory Client imports "../Rename" AllocBase begin |
8 theory Client imports "../Rename" AllocBase begin |
9 |
9 |
10 type_synonym |
10 type_synonym |
11 tokbag = nat \<comment>\<open>tokbags could be multisets...or any ordered type?\<close> |
11 tokbag = nat \<comment> \<open>tokbags could be multisets...or any ordered type?\<close> |
12 |
12 |
13 record state = |
13 record state = |
14 giv :: "tokbag list" \<comment>\<open>input history: tokens granted\<close> |
14 giv :: "tokbag list" \<comment> \<open>input history: tokens granted\<close> |
15 ask :: "tokbag list" \<comment>\<open>output history: tokens requested\<close> |
15 ask :: "tokbag list" \<comment> \<open>output history: tokens requested\<close> |
16 rel :: "tokbag list" \<comment>\<open>output history: tokens released\<close> |
16 rel :: "tokbag list" \<comment> \<open>output history: tokens released\<close> |
17 tok :: tokbag \<comment>\<open>current token request\<close> |
17 tok :: tokbag \<comment> \<open>current token request\<close> |
18 |
18 |
19 record 'a state_d = |
19 record 'a state_d = |
20 state + |
20 state + |
21 dummy :: 'a \<comment>\<open>new variables\<close> |
21 dummy :: 'a \<comment> \<open>new variables\<close> |
22 |
22 |
23 |
23 |
24 (*Array indexing is translated to list indexing as A[n] == A!(n-1). *) |
24 (*Array indexing is translated to list indexing as A[n] == A!(n-1). *) |
25 |
25 |
26 |
26 |