(* Title: Aodv.thy License: BSD 2-Clause. See LICENSE. Author: Timothy Bourke, Inria *) section "The AODV protocol" theory Aodv imports Aodv_Data Aodv_Message AWN.AWN_SOS_Labels AWN.AWN_Invariants begin subsection "Data state" record state = ip :: "ip" sn :: "sqn" rt :: "rt" rreqs :: "(ip \ rreqid) set" store :: "store" (* all locals *) msg :: "msg" data :: "data" dests :: "ip \ sqn" pre :: "ip set" rreqid :: "rreqid" dip :: "ip" oip :: "ip" hops :: "nat" dsn :: "sqn" dsk :: "k" osn :: "sqn" sip :: "ip" abbreviation aodv_init :: "ip \ state" where "aodv_init i \ \ ip = i, sn = 1, rt = Map.empty, rreqs = {}, store = Map.empty, msg = (SOME x. True), data = (SOME x. True), dests = (SOME x. True), pre = (SOME x. True), rreqid = (SOME x. True), dip = (SOME x. True), oip = (SOME x. True), hops = (SOME x. True), dsn = (SOME x. True), dsk = (SOME x. True), osn = (SOME x. True), sip = (SOME x. x \ i) \" lemma some_neq_not_eq [simp]: "\((SOME x :: nat. x \ i) = i)" by (subst some_eq_ex) (metis zero_neq_numeral) definition clear_locals :: "state \ state" where "clear_locals \ = \ \ msg := (SOME x. True), data := (SOME x. True), dests := (SOME x. True), pre := (SOME x. True), rreqid := (SOME x. True), dip := (SOME x. True), oip := (SOME x. True), hops := (SOME x. True), dsn := (SOME x. True), dsk := (SOME x. True), osn := (SOME x. True), sip := (SOME x. x \ ip \) \" lemma clear_locals_sip_not_ip [simp]: "\(sip (clear_locals \) = ip \)" unfolding clear_locals_def by simp lemma clear_locals_but_not_globals [simp]: "ip (clear_locals \) = ip \" "sn (clear_locals \) = sn \" "rt (clear_locals \) = rt \" "rreqs (clear_locals \) = rreqs \" "store (clear_locals \) = store \" unfolding clear_locals_def by auto subsection "Auxilliary message handling definitions" definition is_newpkt where "is_newpkt \ \ case msg \ of Newpkt data' dip' \ { \\data := data', dip := dip'\ } | _ \ {}" definition is_pkt where "is_pkt \ \ case msg \ of Pkt data' dip' oip' \ { \\ data := data', dip := dip', oip := oip' \ } | _ \ {}" definition is_rreq where "is_rreq \ \ case msg \ of Rreq hops' rreqid' dip' dsn' dsk' oip' osn' sip' \ { \\ hops := hops', rreqid := rreqid', dip := dip', dsn := dsn', dsk := dsk', oip := oip', osn := osn', sip := sip' \ } | _ \ {}" lemma is_rreq_asm [dest!]: assumes "\' \ is_rreq \" shows "(\hops' rreqid' dip' dsn' dsk' oip' osn' sip'. msg \ = Rreq hops' rreqid' dip' dsn' dsk' oip' osn' sip' \ \' = \\ hops := hops', rreqid := rreqid', dip := dip', dsn := dsn', dsk := dsk', oip := oip', osn := osn', sip := sip' \)" using assms unfolding is_rreq_def by (cases "msg \") simp_all definition is_rrep where "is_rrep \ \ case msg \ of Rrep hops' dip' dsn' oip' sip' \ { \\ hops := hops', dip := dip', dsn := dsn', oip := oip', sip := sip' \ } | _ \ {}" lemma is_rrep_asm [dest!]: assumes "\' \ is_rrep \" shows "(\hops' dip' dsn' oip' sip'. msg \ = Rrep hops' dip' dsn' oip' sip' \ \' = \\ hops := hops', dip := dip', dsn := dsn', oip := oip', sip := sip' \)" using assms unfolding is_rrep_def by (cases "msg \") simp_all definition is_rerr where "is_rerr \ \ case msg \ of Rerr dests' sip' \ { \\ dests := dests', sip := sip' \ } | _ \ {}" lemma is_rerr_asm [dest!]: assumes "\' \ is_rerr \" shows "(\dests' sip'. msg \ = Rerr dests' sip' \ \' = \\ dests := dests', sip := sip' \)" using assms unfolding is_rerr_def by (cases "msg \") simp_all lemmas is_msg_defs = is_rerr_def is_rrep_def is_rreq_def is_pkt_def is_newpkt_def lemma is_msg_inv_ip [simp]: "\' \ is_rerr \ \ ip \' = ip \" "\' \ is_rrep \ \ ip \' = ip \" "\' \ is_rreq \ \ ip \' = ip \" "\' \ is_pkt \ \ ip \' = ip \" "\' \ is_newpkt \ \ ip \' = ip \" unfolding is_msg_defs by (cases "msg \", clarsimp+)+ lemma is_msg_inv_sn [simp]: "\' \ is_rerr \ \ sn \' = sn \" "\' \ is_rrep \ \ sn \' = sn \" "\' \ is_rreq \ \ sn \' = sn \" "\' \ is_pkt \ \ sn \' = sn \" "\' \ is_newpkt \ \ sn \' = sn \" unfolding is_msg_defs by (cases "msg \", clarsimp+)+ lemma is_msg_inv_rt [simp]: "\' \ is_rerr \ \ rt \' = rt \" "\' \ is_rrep \ \ rt \' = rt \" "\' \ is_rreq \ \ rt \' = rt \" "\' \ is_pkt \ \ rt \' = rt \" "\' \ is_newpkt \ \ rt \' = rt \" unfolding is_msg_defs by (cases "msg \", clarsimp+)+ lemma is_msg_inv_rreqs [simp]: "\' \ is_rerr \ \ rreqs \' = rreqs \" "\' \ is_rrep \ \ rreqs \' = rreqs \" "\' \ is_rreq \ \ rreqs \' = rreqs \" "\' \ is_pkt \ \ rreqs \' = rreqs \" "\' \ is_newpkt \ \ rreqs \' = rreqs \" unfolding is_msg_defs by (cases "msg \", clarsimp+)+ lemma is_msg_inv_store [simp]: "\' \ is_rerr \ \ store \' = store \" "\' \ is_rrep \ \ store \' = store \" "\' \ is_rreq \ \ store \' = store \" "\' \ is_pkt \ \ store \' = store \" "\' \ is_newpkt \ \ store \' = store \" unfolding is_msg_defs by (cases "msg \", clarsimp+)+ lemma is_msg_inv_sip [simp]: "\' \ is_pkt \ \ sip \' = sip \" "\' \ is_newpkt \ \ sip \' = sip \" unfolding is_msg_defs by (cases "msg \", clarsimp+)+ subsection "The protocol process" datatype pseqp = PAodv | PNewPkt | PPkt | PRreq | PRrep | PRerr fun nat_of_seqp :: "pseqp \ nat" where "nat_of_seqp PAodv = 1" | "nat_of_seqp PPkt = 2" | "nat_of_seqp PNewPkt = 3" | "nat_of_seqp PRreq = 4" | "nat_of_seqp PRrep = 5" | "nat_of_seqp PRerr = 6" instantiation "pseqp" :: ord begin definition less_eq_seqp [iff]: "l1 \ l2 = (nat_of_seqp l1 \ nat_of_seqp l2)" definition less_seqp [iff]: "l1 < l2 = (nat_of_seqp l1 < nat_of_seqp l2)" instance .. end abbreviation AODV where "AODV \ \_. \clear_locals\ call(PAodv)" abbreviation PKT where "PKT args \ \\. let (data, dip, oip) = args \ in (clear_locals \) \ data := data, dip := dip, oip := oip \\ call(PPkt)" abbreviation NEWPKT where "NEWPKT args \ \\. let (data, dip) = args \ in (clear_locals \) \ data := data, dip := dip \\ call(PNewPkt)" abbreviation RREQ where "RREQ args \ \\. let (hops, rreqid, dip, dsn, dsk, oip, osn, sip) = args \ in (clear_locals \) \ hops := hops, rreqid := rreqid, dip := dip, dsn := dsn, dsk := dsk, oip := oip, osn := osn, sip := sip \\ call(PRreq)" abbreviation RREP where "RREP args \ \\. let (hops, dip, dsn, oip, sip) = args \ in (clear_locals \) \ hops := hops, dip := dip, dsn := dsn, oip := oip, sip := sip \\ call(PRrep)" abbreviation RERR where "RERR args \ \\. let (dests, sip) = args \ in (clear_locals \) \ dests := dests, sip := sip \\ call(PRerr)" fun \\<^sub>A\<^sub>O\<^sub>D\<^sub>V :: "(state, msg, pseqp, pseqp label) seqp_env" where "\\<^sub>A\<^sub>O\<^sub>D\<^sub>V PAodv = labelled PAodv ( receive(\msg' \. \ \ msg := msg' \). ( \is_newpkt\ NEWPKT(\\. (data \, ip \)) \ \is_pkt\ PKT(\\. (data \, dip \, oip \)) \ \is_rreq\ \\. \ \rt := update (rt \) (sip \) (0, unk, val, 1, sip \, {}) \\ RREQ(\\. (hops \, rreqid \, dip \, dsn \, dsk \, oip \, osn \, sip \)) \ \is_rrep\ \\. \ \rt := update (rt \) (sip \) (0, unk, val, 1, sip \, {}) \\ RREP(\\. (hops \, dip \, dsn \, oip \, sip \)) \ \is_rerr\ \\. \ \rt := update (rt \) (sip \) (0, unk, val, 1, sip \, {}) \\ RERR(\\. (dests \, sip \)) ) \ \\\. { \\ dip := dip \ | dip. dip \ qD(store \) \ vD(rt \) }\ \\. \ \ data := hd(\\<^bsub>queue\<^esub>(store \, dip \)) \\ unicast(\\. the (nhop (rt \) (dip \)), \\. pkt(data \, dip \, ip \)). \\. \ \ store := the (drop (dip \) (store \)) \\ AODV() \ \\. \ \ dests := (\rip. if (rip \ vD (rt \) \ nhop (rt \) rip = nhop (rt \) (dip \)) then Some (inc (sqn (rt \) rip)) else None) \\ \\. \ \ rt := invalidate (rt \) (dests \) \\ \\. \ \ store := setRRF (store \) (dests \)\\ \\. \ \ pre := \{ the (precs (rt \) rip) | rip. rip \ dom (dests \) } \\ \\. \ \ dests := (\rip. if ((dests \) rip \ None \ the (precs (rt \) rip) \ {}) then (dests \) rip else None) \\ groupcast(\\. pre \, \\. rerr(dests \, ip \)). AODV() \ \\\. { \\ dip := dip \ | dip. dip \ qD(store \) - vD(rt \) \ the (\\<^bsub>p-flag\<^esub>(store \, dip)) = req }\ \\. \ \ store := unsetRRF (store \) (dip \) \\ \\. \ \ sn := inc (sn \) \\ \\. \ \ rreqid := nrreqid (rreqs \) (ip \) \\ \\. \ \ rreqs := rreqs \ \ {(ip \, rreqid \)} \\ broadcast(\\. rreq(0, rreqid \, dip \, sqn (rt \) (dip \), sqnf (rt \) (dip \), ip \, sn \, ip \)). AODV())" | "\\<^sub>A\<^sub>O\<^sub>D\<^sub>V PNewPkt = labelled PNewPkt ( \\. dip \ = ip \\ deliver(\\. data \).AODV() \ \\. dip \ \ ip \\ \\. \ \ store := add (data \) (dip \) (store \) \\ AODV())" | "\\<^sub>A\<^sub>O\<^sub>D\<^sub>V PPkt = labelled PPkt ( \\. dip \ = ip \\ deliver(\\. data \).AODV() \ \\. dip \ \ ip \\ ( \\. dip \ \ vD (rt \)\ unicast(\\. the (nhop (rt \) (dip \)), \\. pkt(data \, dip \, oip \)).AODV() \ \\. \ \ dests := (\rip. if (rip \ vD (rt \) \ nhop (rt \) rip = nhop (rt \) (dip \)) then Some (inc (sqn (rt \) rip)) else None) \\ \\. \ \ rt := invalidate (rt \) (dests \) \\ \\. \ \ store := setRRF (store \) (dests \)\\ \\. \ \ pre := \{ the (precs (rt \) rip) | rip. rip \ dom (dests \) } \\ \\. \ \ dests := (\rip. if ((dests \) rip \ None \ the (precs (rt \) rip) \ {}) then (dests \) rip else None) \\ groupcast(\\. pre \, \\. rerr(dests \, ip \)).AODV() \ \\. dip \ \ vD (rt \)\ ( \\. dip \ \ iD (rt \)\ groupcast(\\. the (precs (rt \) (dip \)), \\. rerr([dip \ \ sqn (rt \) (dip \)], ip \)). AODV() \ \\. dip \ \ iD (rt \)\ AODV() ) ))" | "\\<^sub>A\<^sub>O\<^sub>D\<^sub>V PRreq = labelled PRreq ( \\. (oip \, rreqid \) \ rreqs \\ AODV() \ \\. (oip \, rreqid \) \ rreqs \\ \\. \ \ rt := update (rt \) (oip \) (osn \, kno, val, hops \ + 1, sip \, {}) \\ \\. \ \ rreqs := rreqs \ \ {(oip \, rreqid \)} \\ ( \\. dip \ = ip \\ \\. \ \ sn := max (sn \) (dsn \) \\ unicast(\\. the (nhop (rt \) (oip \)), \\. rrep(0, dip \, sn \, oip \, ip \)).AODV() \ \\. \ \ dests := (\rip. if (rip \ vD (rt \) \ nhop (rt \) rip = nhop (rt \) (oip \)) then Some (inc (sqn (rt \) rip)) else None) \\ \\. \ \ rt := invalidate (rt \) (dests \) \\ \\. \ \ store := setRRF (store \) (dests \)\\ \\. \ \ pre := \{ the (precs (rt \) rip) | rip. rip \ dom (dests \) } \\ \\. \ \ dests := (\rip. if ((dests \) rip \ None \ the (precs (rt \) rip) \ {}) then (dests \) rip else None) \\ groupcast(\\. pre \, \\. rerr(dests \, ip \)).AODV() \ \\. dip \ \ ip \\ ( \\. dip \ \ vD (rt \) \ dsn \ \ sqn (rt \) (dip \) \ sqnf (rt \) (dip \) = kno\ \\. \ \ rt := the (addpreRT (rt \) (dip \) {sip \}) \\ \\. \ \ rt := the (addpreRT (rt \) (oip \) {the (nhop (rt \) (dip \))}) \\ unicast(\\. the (nhop (rt \) (oip \)), \\. rrep(the (dhops (rt \) (dip \)), dip \, sqn (rt \) (dip \), oip \, ip \)). AODV() \ \\. \ \ dests := (\rip. if (rip \ vD (rt \) \ nhop (rt \) rip = nhop (rt \) (oip \)) then Some (inc (sqn (rt \) rip)) else None) \\ \\. \ \ rt := invalidate (rt \) (dests \) \\ \\. \ \ store := setRRF (store \) (dests \)\\ \\. \ \ pre := \{ the (precs (rt \) rip) | rip. rip \ dom (dests \) } \\ \\. \ \ dests := (\rip. if ((dests \) rip \ None \ the (precs (rt \) rip) \ {}) then (dests \) rip else None) \\ groupcast(\\. pre \, \\. rerr(dests \, ip \)).AODV() \ \\. dip \ \ vD (rt \) \ sqn (rt \) (dip \) < dsn \ \ sqnf (rt \) (dip \) = unk\ broadcast(\\. rreq(hops \ + 1, rreqid \, dip \, max (sqn (rt \) (dip \)) (dsn \), dsk \, oip \, osn \, ip \)). AODV() ) ))" | "\\<^sub>A\<^sub>O\<^sub>D\<^sub>V PRrep = labelled PRrep ( \\. rt \ \ update (rt \) (dip \) (dsn \, kno, val, hops \ + 1, sip \, {}) \ ( \\. \ \ rt := update (rt \) (dip \) (dsn \, kno, val, hops \ + 1, sip \, {}) \ \ ( \\. oip \ = ip \ \ AODV() \ \\. oip \ \ ip \ \ ( \\. oip \ \ vD (rt \)\ \\. \ \ rt := the (addpreRT (rt \) (dip \) {the (nhop (rt \) (oip \))}) \\ \\. \ \ rt := the (addpreRT (rt \) (the (nhop (rt \) (dip \))) {the (nhop (rt \) (oip \))}) \\ unicast(\\. the (nhop (rt \) (oip \)), \\. rrep(hops \ + 1, dip \, dsn \, oip \, ip \)). AODV() \ \\. \ \ dests := (\rip. if (rip \ vD (rt \) \ nhop (rt \) rip = nhop (rt \) (oip \)) then Some (inc (sqn (rt \) rip)) else None) \\ \\. \ \ rt := invalidate (rt \) (dests \) \\ \\. \ \ store := setRRF (store \) (dests \)\\ \\. \ \ pre := \{ the (precs (rt \) rip) | rip. rip \ dom (dests \) } \\ \\. \ \ dests := (\rip. if ((dests \) rip \ None \ the (precs (rt \) rip) \ {}) then (dests \) rip else None) \\ groupcast(\\. pre \, \\. rerr(dests \, ip \)).AODV() \ \\. oip \ \ vD (rt \)\ AODV() ) ) ) \ \\. rt \ = update (rt \) (dip \) (dsn \, kno, val, hops \ + 1, sip \, {}) \ AODV() )" | "\\<^sub>A\<^sub>O\<^sub>D\<^sub>V PRerr = labelled PRerr ( \\. \ \ dests := (\rip. case (dests \) rip of None \ None | Some rsn \ if rip \ vD (rt \) \ the (nhop (rt \) rip) = sip \ \ sqn (rt \) rip < rsn then Some rsn else None) \\ \\. \ \ rt := invalidate (rt \) (dests \) \\ \\. \ \ store := setRRF (store \) (dests \)\\ \\. \ \ pre := \{ the (precs (rt \) rip) | rip. rip \ dom (dests \) } \\ \\. \ \ dests := (\rip. if ((dests \) rip \ None \ the (precs (rt \) rip) \ {}) then (dests \) rip else None) \\ groupcast(\\. pre \, \\. rerr(dests \, ip \)). AODV())" declare \\<^sub>A\<^sub>O\<^sub>D\<^sub>V.simps [simp del, code del] lemmas \\<^sub>A\<^sub>O\<^sub>D\<^sub>V_simps [simp, code] = \\<^sub>A\<^sub>O\<^sub>D\<^sub>V.simps [simplified] fun \\<^sub>A\<^sub>O\<^sub>D\<^sub>V_skeleton where "\\<^sub>A\<^sub>O\<^sub>D\<^sub>V_skeleton PAodv = seqp_skeleton (\\<^sub>A\<^sub>O\<^sub>D\<^sub>V PAodv)" | "\\<^sub>A\<^sub>O\<^sub>D\<^sub>V_skeleton PNewPkt = seqp_skeleton (\\<^sub>A\<^sub>O\<^sub>D\<^sub>V PNewPkt)" | "\\<^sub>A\<^sub>O\<^sub>D\<^sub>V_skeleton PPkt = seqp_skeleton (\\<^sub>A\<^sub>O\<^sub>D\<^sub>V PPkt)" | "\\<^sub>A\<^sub>O\<^sub>D\<^sub>V_skeleton PRreq = seqp_skeleton (\\<^sub>A\<^sub>O\<^sub>D\<^sub>V PRreq)" | "\\<^sub>A\<^sub>O\<^sub>D\<^sub>V_skeleton PRrep = seqp_skeleton (\\<^sub>A\<^sub>O\<^sub>D\<^sub>V PRrep)" | "\\<^sub>A\<^sub>O\<^sub>D\<^sub>V_skeleton PRerr = seqp_skeleton (\\<^sub>A\<^sub>O\<^sub>D\<^sub>V PRerr)" lemma \\<^sub>A\<^sub>O\<^sub>D\<^sub>V_skeleton_wf [simp]: "wellformed \\<^sub>A\<^sub>O\<^sub>D\<^sub>V_skeleton" proof (rule, intro allI) fix pn pn' show "call(pn') \ stermsl (\\<^sub>A\<^sub>O\<^sub>D\<^sub>V_skeleton pn)" by (cases pn) simp_all qed declare \\<^sub>A\<^sub>O\<^sub>D\<^sub>V_skeleton.simps [simp del, code del] lemmas \\<^sub>A\<^sub>O\<^sub>D\<^sub>V_skeleton_simps [simp, code] = \\<^sub>A\<^sub>O\<^sub>D\<^sub>V_skeleton.simps [simplified \\<^sub>A\<^sub>O\<^sub>D\<^sub>V_simps seqp_skeleton.simps] lemma aodv_proc_cases [dest]: fixes p pn shows "p \ ctermsl (\\<^sub>A\<^sub>O\<^sub>D\<^sub>V pn) \ (p \ ctermsl (\\<^sub>A\<^sub>O\<^sub>D\<^sub>V PAodv) \ p \ ctermsl (\\<^sub>A\<^sub>O\<^sub>D\<^sub>V PNewPkt) \ p \ ctermsl (\\<^sub>A\<^sub>O\<^sub>D\<^sub>V PPkt) \ p \ ctermsl (\\<^sub>A\<^sub>O\<^sub>D\<^sub>V PRreq) \ p \ ctermsl (\\<^sub>A\<^sub>O\<^sub>D\<^sub>V PRrep) \ p \ ctermsl (\\<^sub>A\<^sub>O\<^sub>D\<^sub>V PRerr))" by (cases pn) simp_all definition \\<^sub>A\<^sub>O\<^sub>D\<^sub>V :: "ip \ (state \ (state, msg, pseqp, pseqp label) seqp) set" where "\\<^sub>A\<^sub>O\<^sub>D\<^sub>V i \ {(aodv_init i, \\<^sub>A\<^sub>O\<^sub>D\<^sub>V PAodv)}" abbreviation paodv :: "ip \ (state \ (state, msg, pseqp, pseqp label) seqp, msg seq_action) automaton" where "paodv i \ \ init = \\<^sub>A\<^sub>O\<^sub>D\<^sub>V i, trans = seqp_sos \\<^sub>A\<^sub>O\<^sub>D\<^sub>V \" lemma aodv_trans: "trans (paodv i) = seqp_sos \\<^sub>A\<^sub>O\<^sub>D\<^sub>V" by simp lemma aodv_control_within [simp]: "control_within \\<^sub>A\<^sub>O\<^sub>D\<^sub>V (init (paodv i))" unfolding \\<^sub>A\<^sub>O\<^sub>D\<^sub>V_def by (rule control_withinI) (auto simp del: \\<^sub>A\<^sub>O\<^sub>D\<^sub>V_simps) lemma aodv_wf [simp]: "wellformed \\<^sub>A\<^sub>O\<^sub>D\<^sub>V" proof (rule, intro allI) fix pn pn' show "call(pn') \ stermsl (\\<^sub>A\<^sub>O\<^sub>D\<^sub>V pn)" by (cases pn) simp_all qed lemmas aodv_labels_not_empty [simp] = labels_not_empty [OF aodv_wf] lemma aodv_ex_label [intro]: "\l. l\labels \\<^sub>A\<^sub>O\<^sub>D\<^sub>V p" by (metis aodv_labels_not_empty all_not_in_conv) lemma aodv_ex_labelE [elim]: assumes "\l\labels \\<^sub>A\<^sub>O\<^sub>D\<^sub>V p. P l p" and "\p l. P l p \ Q" shows "Q" using assms by (metis aodv_ex_label) lemma aodv_simple_labels [simp]: "simple_labels \\<^sub>A\<^sub>O\<^sub>D\<^sub>V" proof fix pn p assume "p\subterms(\\<^sub>A\<^sub>O\<^sub>D\<^sub>V pn)" thus "\!l. labels \\<^sub>A\<^sub>O\<^sub>D\<^sub>V p = {l}" by (cases pn) (simp_all cong: seqp_congs | elim disjE)+ qed lemma \\<^sub>A\<^sub>O\<^sub>D\<^sub>V_labels [simp]: "(\, p) \ \\<^sub>A\<^sub>O\<^sub>D\<^sub>V i \ labels \\<^sub>A\<^sub>O\<^sub>D\<^sub>V p = {PAodv-:0}" unfolding \\<^sub>A\<^sub>O\<^sub>D\<^sub>V_def by simp lemma aodv_init_kD_empty [simp]: "(\, p) \ \\<^sub>A\<^sub>O\<^sub>D\<^sub>V i \ kD (rt \) = {}" unfolding \\<^sub>A\<^sub>O\<^sub>D\<^sub>V_def kD_def by simp lemma aodv_init_sip_not_ip [simp]: "\(sip (aodv_init i) = i)" by simp lemma aodv_init_sip_not_ip' [simp]: assumes "(\, p) \ \\<^sub>A\<^sub>O\<^sub>D\<^sub>V i" shows "sip \ \ ip \" using assms unfolding \\<^sub>A\<^sub>O\<^sub>D\<^sub>V_def by simp lemma aodv_init_sip_not_i [simp]: assumes "(\, p) \ \\<^sub>A\<^sub>O\<^sub>D\<^sub>V i" shows "sip \ \ i" using assms unfolding \\<^sub>A\<^sub>O\<^sub>D\<^sub>V_def by simp lemma clear_locals_sip_not_ip': assumes "ip \ = i" shows "\(sip (clear_locals \) = i)" using assms by auto text \Stop the simplifier from descending into process terms.\ declare seqp_congs [cong] text \Configure the main invariant tactic for AODV.\ declare \\<^sub>A\<^sub>O\<^sub>D\<^sub>V_simps [cterms_env] aodv_proc_cases [ctermsl_cases] seq_invariant_ctermsI [OF aodv_wf aodv_control_within aodv_simple_labels aodv_trans, cterms_intros] seq_step_invariant_ctermsI [OF aodv_wf aodv_control_within aodv_simple_labels aodv_trans, cterms_intros] end