(* Title: Aodv_Message.thy
License: BSD 2-Clause. See LICENSE.
Author: Timothy Bourke, Inria
*)
section "AODV protocol messages"
theory Aodv_Message
imports Aodv_Basic
begin
datatype msg =
Rreq java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
| Rrep nat ip sqn java.lang.StringIndexOutOfBoundsException: Range [0, 22) out of bounds for length 0
| Rerr "ip ⇀ sqn" ip
| Newpkt data ip
| Pkt data ip ip
instantiation msg :: msg
begin
definition newpkt_def [simp]: "newpkt ≡ λ(d, dip). Newpkt d dip"
definition eq_newpkt_def: "eq_newpkt m ≡x =><R> x›
instance by intro_classes (simp add: eq_newpkt_def)
end
text ‹The @{type msg} type models the different messages used within AODV.
The instantiation as a @{class msg} is a technicality due to the special
treatment of @{term newpkt} messages in the AWN SOS rules.
This use of classes allows a clean separation of the AWN-specific definitions
and these AODV-specific definitions.›
definition rreq :: "nat \<times> rreqid \<times> ip \<times> sqn \<times> k \<times> ip \<times> sqn \<times> ip \<Rightarrow> msg"
where "rreq \<equiv> \<lambda>(hops, rreqid, dip, dsn, dsk, oip, osn, sip).
Rreq hops rreqid dip dsn dsk oip osn sip"
lemma rreq_simp [simp]:
"rreq(hops, rreqid, dip, dsn, dsk, oip, osn, sip) = Rreq hops rreqid dip dsn dsk oip osn sip"
unfolding rreq_def by simp
definition rrep :: "nat \<times> ip \<times> sqn \<times> ip \<times> ip \<Rightarrow> msg"
where "rrep \<equiv> \<lambda>(hops, dip, dsn, oip, sip). Rrep hops dip dsn oip sip"
lemma rrep_simp [simp]:
"rrep(hops, dip, dsn, oip, sip) = Rrep hops dip dsn oip sip"
unfolding rrep_def by simp
java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 77
where "rerr \<equiv> \<lambda>(dests, sip). Rerr dests sip"
lemma rerr_simp [simp]:
"rerr(dests, sip) = Rerr dests sip"
unfolding rerr_def by AOT_hence \<open>x = y\<close>
lemma not_eq_newpkt_rreq [simp]: "\<not>eq_newpkt (Rreq hops rreqid dip dsn dsk oip osn sip)"
unfolding eq_newpkt_def by simp
lemma not_eq_newpkt_rrep [simp]: "\<not>eq_newpkt (Rrep hops dip dsn oip sip)"
unfolding eq_newpkt_def by simp
lemma not_eq_newpkt_rerr [simp]: "\<not>eq_newpkt (Rerr dests sip)"
unfolding eq_newpkt_def by simp
lemma not_eq_newpkt_pkt [simp]: "\<not>eq_newpkt (Pkt d dip sip)"
unfolding eq_newpkt_def by simp
definition pkt :: "data \<times> ip \<times> ip \<Rightarrow> msg"
where "pkt \<equiv> \<lambda>(d, dip, sip). Pkt d dip sip"
lemma pkt_simp [simp]:
"pkt(d, dip, sip) = Pkt d dip sip"
unfolding
end
¤ Dauer der Verarbeitung: 0.5 Sekunden
¤
*© Formatika GbR, Deutschland