src/HOL/TLA/Memory/MemClerkParameters.thy
author haftmann
Mon, 04 Nov 2019 20:38:15 +0000
changeset 71042 400e9512f1d3
parent 60592 c9bd1d902f04
permissions -rw-r--r--
proof-of-concept theory for bit operations without a constructivistic representation and a minimal common logical foundation

(*  Title:      HOL/TLA/Memory/MemClerkParameters.thy
    Author:     Stephan Merz, University of Munich
*)

section \<open>RPC-Memory example: Parameters of the memory clerk\<close>

theory MemClerkParameters
imports RPCParameters
begin

datatype mClkState = clkA | clkB

(* types sent on the clerk's send and receive channels are argument types
   of the memory and the RPC, respectively *)
type_synonym mClkSndArgType = "memOp"
type_synonym mClkRcvArgType = "rpcOp"

definition
  (* translate a memory call to an RPC call *)
  MClkRelayArg     :: "memOp \<Rightarrow> rpcOp"
  where "MClkRelayArg marg = memcall marg"

definition
  (* translate RPC failures to memory failures *)
  MClkReplyVal     :: "Vals \<Rightarrow> Vals"
  where "MClkReplyVal v = (if v = RPCFailure then MemFailure else v)"

end