equal
deleted
inserted
replaced
10 abbreviation "ask == Var(Nil)" (* input history: tokens requested *) |
10 abbreviation "ask == Var(Nil)" (* input history: tokens requested *) |
11 abbreviation "giv == Var([0])" (* output history: tokens granted *) |
11 abbreviation "giv == Var([0])" (* output history: tokens granted *) |
12 abbreviation "rel == Var([1])" (* input history: tokens released *) |
12 abbreviation "rel == Var([1])" (* input history: tokens released *) |
13 abbreviation "tok == Var([2])" (* the number of available tokens *) |
13 abbreviation "tok == Var([2])" (* the number of available tokens *) |
14 |
14 |
15 axioms |
15 axiomatization where |
16 type_assumes: |
16 type_assumes: |
17 "type_of(ask) = list(tokbag) & type_of(giv) = list(tokbag) & |
17 "type_of(ask) = list(tokbag) & type_of(giv) = list(tokbag) & |
18 type_of(rel) = list(tokbag) & type_of(tok) = nat" |
18 type_of(rel) = list(tokbag) & type_of(tok) = nat" and |
19 default_val_assumes: |
19 default_val_assumes: |
20 "default_val(ask) = Nil & default_val(giv) = Nil & |
20 "default_val(ask) = Nil & default_val(giv) = Nil & |
21 default_val(rel) = Nil & default_val(tok) = 0" |
21 default_val(rel) = Nil & default_val(tok) = 0" |
22 |
22 |
23 |
23 |
24 (*Array indexing is translated to list indexing as A[n] == nth(n-1,A). *) |
24 (*Array indexing is translated to list indexing as A[n] == nth(n-1,A). *) |
25 |
25 |
26 definition |
26 definition |