| 3807 |      1 | (*
 | 
|  |      2 |     File:        MemClerkParameters.thy
 | 
| 17309 |      3 |     ID:          $Id$
 | 
| 3807 |      4 |     Author:      Stephan Merz
 | 
|  |      5 |     Copyright:   1997 University of Munich
 | 
|  |      6 | 
 | 
|  |      7 |     Theory Name: MemClerkParameters
 | 
|  |      8 |     Logic Image: TLA
 | 
|  |      9 | 
 | 
|  |     10 |     RPC-Memory example: Parameters of the memory clerk.
 | 
|  |     11 | *)
 | 
|  |     12 | 
 | 
| 17309 |     13 | theory MemClerkParameters
 | 
|  |     14 | imports RPCParameters
 | 
|  |     15 | begin
 | 
| 3807 |     16 | 
 | 
| 17309 |     17 | datatype mClkState = clkA | clkB
 | 
| 3807 |     18 | 
 | 
|  |     19 | types
 | 
|  |     20 |   (* types sent on the clerk's send and receive channels are argument types
 | 
|  |     21 |      of the memory and the RPC, respectively *)
 | 
| 6255 |     22 |   mClkSndArgType   = "memOp"
 | 
|  |     23 |   mClkRcvArgType   = "rpcOp"
 | 
| 3807 |     24 | 
 | 
| 6255 |     25 | constdefs
 | 
| 3807 |     26 |   (* translate a memory call to an RPC call *)
 | 
| 6255 |     27 |   MClkRelayArg     :: "memOp => rpcOp"
 | 
|  |     28 |     "MClkRelayArg marg == memcall marg"
 | 
| 3807 |     29 |   (* translate RPC failures to memory failures *)
 | 
|  |     30 |   MClkReplyVal     :: "Vals => Vals"
 | 
| 6255 |     31 |     "MClkReplyVal v == if v = RPCFailure then MemFailure else v"
 | 
| 3807 |     32 | 
 | 
| 17309 |     33 | ML {* use_legacy_bindings (the_context ()) *}
 | 
|  |     34 | 
 | 
| 3807 |     35 | end
 |