src/HOL/TLA/Memory/RPC.thy
changeset 60592 c9bd1d902f04
parent 60591 e0b77517f9a9
child 62145 5b946c81dfbf
equal deleted inserted replaced
60591:e0b77517f9a9 60592:c9bd1d902f04
     1 (*  Title:      HOL/TLA/Memory/RPC.thy
     1 (*  Title:      HOL/TLA/Memory/RPC.thy
     2     Author:     Stephan Merz, University of Munich
     2     Author:     Stephan Merz, University of Munich
     3 *)
     3 *)
     4 
     4 
     5 section {* RPC-Memory example: RPC specification *}
     5 section \<open>RPC-Memory example: RPC specification\<close>
     6 
     6 
     7 theory RPC
     7 theory RPC
     8 imports RPCParameters ProcedureInterface Memory
     8 imports RPCParameters ProcedureInterface Memory
     9 begin
     9 begin
    10 
    10 
    97   by (force elim!: enabled_mono [temp_use] RPCFail_vis [temp_use])
    97   by (force elim!: enabled_mono [temp_use] RPCFail_vis [temp_use])
    98 
    98 
    99 (* Enabledness of some actions *)
    99 (* Enabledness of some actions *)
   100 lemma RPCFail_enabled: "\<And>p. basevars (rtrner send!p, caller rcv!p, rst!p) \<Longrightarrow>  
   100 lemma RPCFail_enabled: "\<And>p. basevars (rtrner send!p, caller rcv!p, rst!p) \<Longrightarrow>  
   101     \<turnstile> \<not>Calling rcv p \<and> Calling send p \<longrightarrow> Enabled (RPCFail send rcv rst p)"
   101     \<turnstile> \<not>Calling rcv p \<and> Calling send p \<longrightarrow> Enabled (RPCFail send rcv rst p)"
   102   by (tactic {* action_simp_tac (@{context} addsimps [@{thm RPCFail_def},
   102   by (tactic \<open>action_simp_tac (@{context} addsimps [@{thm RPCFail_def},
   103     @{thm Return_def}, @{thm caller_def}, @{thm rtrner_def}]) [exI]
   103     @{thm Return_def}, @{thm caller_def}, @{thm rtrner_def}]) [exI]
   104     [@{thm base_enabled}, @{thm Pair_inject}] 1 *})
   104     [@{thm base_enabled}, @{thm Pair_inject}] 1\<close>)
   105 
   105 
   106 lemma RPCReply_enabled: "\<And>p. basevars (rtrner send!p, caller rcv!p, rst!p) \<Longrightarrow>  
   106 lemma RPCReply_enabled: "\<And>p. basevars (rtrner send!p, caller rcv!p, rst!p) \<Longrightarrow>  
   107       \<turnstile> \<not>Calling rcv p \<and> Calling send p \<and> rst!p = #rpcB  
   107       \<turnstile> \<not>Calling rcv p \<and> Calling send p \<and> rst!p = #rpcB  
   108          \<longrightarrow> Enabled (RPCReply send rcv rst p)"
   108          \<longrightarrow> Enabled (RPCReply send rcv rst p)"
   109   by (tactic {* action_simp_tac (@{context} addsimps [@{thm RPCReply_def},
   109   by (tactic \<open>action_simp_tac (@{context} addsimps [@{thm RPCReply_def},
   110     @{thm Return_def}, @{thm caller_def}, @{thm rtrner_def}]) [exI]
   110     @{thm Return_def}, @{thm caller_def}, @{thm rtrner_def}]) [exI]
   111     [@{thm base_enabled}, @{thm Pair_inject}] 1 *})
   111     [@{thm base_enabled}, @{thm Pair_inject}] 1\<close>)
   112 
   112 
   113 end
   113 end