Theory MemClerkParameters (Isabelle2005: October 2005)

# Theory MemClerkParameters

Up to index of Isabelle/HOL/TLA/Memory

theory MemClerkParameters
imports RPCParameters
uses [MemClerkParameters.ML]
begin

    (*
        File:        MemClerkParameters.thy
        ID:          $Id: MemClerkParameters.thy,v 1.4 2005/09/07 18:22:42 wenzelm Exp $
        Author:      Stephan Merz
        Copyright:   1997 University of Munich

        Theory Name: MemClerkParameters
        Logic Image: TLA

        RPC-Memory example: Parameters of the memory clerk.
    *)

    theory MemClerkParameters
    imports RPCParameters
    begin

    datatype mClkState = clkA | clkB

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

    constdefs
      (* translate a memory call to an RPC call *)
      MClkRelayArg     :: "memOp => rpcOp"
        "MClkRelayArg marg == memcall marg"
      (* translate RPC failures to memory failures *)
      MClkReplyVal     :: "Vals => Vals"
        "MClkReplyVal v == if v = RPCFailure then MemFailure else v"

    ML {* use_legacy_bindings (the_context ()) *}

    end