Theory RPCParameters
section ‹RPC-Memory example: RPC parameters›
theory RPCParameters
imports MemoryParameters
begin
datatype rpcOp = memcall memOp | othercall Vals
datatype rpcState = rpcA | rpcB
axiomatization RPCFailure :: Vals and BadCall :: Vals
where
RFNoMemVal: "RPCFailure ∉ MemVal" and
NotAResultNotRF: "NotAResult ≠ RPCFailure" and
OKNotRF: "OK ≠ RPCFailure" and
BANotRF: "BadArg ≠ RPCFailure"
definition IsLegalRcvArg :: "rpcOp ⇒ bool"
where "IsLegalRcvArg ra ==
case ra of (memcall m) ⇒ True
| (othercall v) ⇒ False"
definition RPCRelayArg :: "rpcOp ⇒ memOp"
where "RPCRelayArg ra ==
case ra of (memcall m) ⇒ m
| (othercall v) ⇒ undefined"
lemmas [simp] = RFNoMemVal NotAResultNotRF OKNotRF BANotRF
NotAResultNotRF [symmetric] OKNotRF [symmetric] BANotRF [symmetric]
end