hash h. Typed-check process:

null

Added action dependencies lemmas:


System after processing:

null

System Empty registered with actions (init).
[warning>Loaded "Prelude.sp".
<]

name key : message.
global axiom namelength_key {'P:system} @system:(set:'P; equiv:None) :
[len key = namelength_message]


channel c.
abstract one : message
abstract Succ : message->message
abstract (~<) : message -> message -> boolean.

In order to model counter values, we use: * a function Succ modelling the successor of a value; * an order relation ~< modelling the usual order on natural numbers. * an abstract symbol one modelling the constant 1

We axiomatize the order relation ~< defined above in order to be able to reason on counter values.



axiom [any] orderSucc (n:message): n ~< Succ(n).
axiom orderSucc {'P:system} @system:(set:'P; equiv:None) :
forall (n:message), n ~< Succ n

axiom [any] orderTrans (n1,n2,n3:message): n1 ~< n2 && n2 ~< n3 => n1 ~< n3.
axiom orderTrans {'P:system} @system:(set:'P; equiv:None) :
forall (n1,n2,n3:message), n1 ~< n2 && n2 ~< n3 => n1 ~< n3

axiom [any] orderStrict (n1,n2:message): n1 = n2 => not(n1 ~< n2).
axiom orderStrict {'P:system} @system:(set:'P; equiv:None) :
forall (n1,n2:message), n1 = n2 => not (n1 ~< n2)



mutable cpt : message = one.


process A =
let m = h(cpt,key) in
cpt := Succ(cpt);
out(c, m).
process A =
let m : message = h (cpt@τ, key) in cpt := Succ (cpt@τ); out(c,m); null


system ((!_i A)).
Typed-check process:

!_i( A )

Added action dependencies lemmas:

axiom depends_init_A {'P:system[like default]} @system:(set:'P; equiv:None) :
forall (i:index), happens(A(i)) => init < A(i)

System after processing:

!_i(
let m : message = h (cpt@τ, key) in
cpt := Succ (cpt@τ);
A: out(c,m i@τ);
null)

System Empty registered with actions (init).
System default registered with actions (init,A).


lemma counterIncreasePred (t:timestamp):
t > init => cpt@pred(t) ~< cpt@t.
Goal counterIncreasePred :
t > init => cpt@pred t ~< cpt@t

Proof.
[goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: t:timestamp
----------------------------------------
t > init => cpt@pred t ~< cpt@t


intro Hc.
[> Line 37: (intro) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: t:timestamp[const]
Hc: t > init
----------------------------------------
cpt@pred t ~< cpt@t


case t => //.
[> Line 39: ((case);(intro)) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: t:timestamp[const]
Hc: t > init
----------------------------------------
(exists (i:index), t = A(i)) => cpt@pred t ~< cpt@t


use orderSucc with cpt@pred(t) => //.
[> Line 40: ((have);(intro)) [goal> lemma counterIncreasePred is proved


Qed.
lemma counterIncreasePred @system:(set:default; equiv:None) :
forall (t:timestamp), t > init => cpt@pred t ~< cpt@t
Exiting proof mode.



lemma counterIncrease (t,t':timestamp):
t' < t => cpt@t' ~< cpt@t.
Goal counterIncrease :
t' < t => cpt@t' ~< cpt@t

Proof.
[goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: t,t':timestamp
----------------------------------------
t' < t => cpt@t' ~< cpt@t


induction t.
[> Line 46: (induction) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: t':timestamp[const]
----------------------------------------
forall (t:timestamp),
(forall (t0:timestamp), t0 < t => t' < t0 => cpt@t' ~< cpt@t0) =>
t' < t => cpt@t' ~< cpt@t



intro t Hind Ht.
[> Line 47: (intro) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: t,t':timestamp[const]
Hind: forall (t0:timestamp), t0 < t => t' < t0 => cpt@t' ~< cpt@t0
Ht: t' < t
----------------------------------------
cpt@t' ~< cpt@t


assert (t' < pred(t) || t' = pred(t)) as H0 => //.
[> Line 48: ((have);(intro)) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: t,t':timestamp[const]
H0: t' < pred t || t' = pred t
Hind: forall (t0:timestamp), t0 < t => t' < t0 => cpt@t' ~< cpt@t0
Ht: t' < t
----------------------------------------
cpt@t' ~< cpt@t


use counterIncreasePred with t => //.
[> Line 48: ((have);(intro)) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: t,t':timestamp[const]
H: cpt@pred t ~< cpt@t
H0: t' < pred t || t' = pred t
Hind: forall (t0:timestamp), t0 < t => t' < t0 => cpt@t' ~< cpt@t0
Ht: t' < t
----------------------------------------
cpt@t' ~< cpt@t


case H0 => //.
[> Line 50: ((case);(intro)) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: t,t':timestamp[const]
H: cpt@pred t ~< cpt@t
H0: t' < pred t
Hind: forall (t0:timestamp), t0 < t => t' < t0 => cpt@t' ~< cpt@t0
Ht: t' < t
----------------------------------------
cpt@t' ~< cpt@t


use Hind with pred(t) => //.
[> Line 50: ((have);(intro)) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: t,t':timestamp[const]
H: cpt@pred t ~< cpt@t
H0: t' < pred t
H1: cpt@t' ~< cpt@pred t
Hind: forall (t0:timestamp), t0 < t => t' < t0 => cpt@t' ~< cpt@t0
Ht: t' < t
----------------------------------------
cpt@t' ~< cpt@t


by apply orderTrans _ (cpt@pred(t)).
[> Line 52: by (apply) [goal> lemma counterIncrease is proved


Qed.
lemma counterIncrease @system:(set:default; equiv:None) :
forall (t,t':timestamp), t' < t => cpt@t' ~< cpt@t
Exiting proof mode.



lemma reach (tau:timestamp): att(frame@tau) <> h(cpt@tau,key).
Goal reach :
att (frame@tau) <> h (cpt@tau, key)

Proof.
[goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: tau:timestamp
----------------------------------------
att (frame@tau) <> h (cpt@tau, key)


intro Eq; euf Eq.
[> Line 56: ((intro);(euf)) Indirect bad occurrences of key key, and messages authenticated by it
in other actions:
cpt@pred (A(i)) auth. by key
(collision with cpt@tau auth. by key)
in action A(i)
in term (happens(A(i)), m i@A(i))

Total: 1 occurrence
0 of them are subsumed by another
1 occurrence remaining

[goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: tau:timestamp[const]
Eq: att (frame@tau) = h (cpt@tau, key)
----------------------------------------
(exists (i:index), A(i) <= tau && cpt@tau = cpt@pred (A(i))) => false


intro [i [H1 H2]].
[> Line 58: (intro) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: i:index[const],tau:timestamp[const]
Eq: att (frame@tau) = h (cpt@tau, key)
H1: A(i) <= tau
H2: cpt@tau = cpt@pred (A(i))
----------------------------------------
false


assert (pred(A(i)) < tau) => //.
[> Line 59: ((have);(intro)) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: i:index[const],tau:timestamp[const]
Clt: pred (A(i)) < tau
Eq: att (frame@tau) = h (cpt@tau, key)
H1: A(i) <= tau
H2: cpt@tau = cpt@pred (A(i))
----------------------------------------
false


use counterIncrease with tau, pred(A(i)) => //.
[> Line 60: ((have);(intro)) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: i:index[const],tau:timestamp[const]
Clt: pred (A(i)) < tau
Eq: att (frame@tau) = h (cpt@tau, key)
H: cpt@pred (A(i)) ~< cpt@tau
H1: A(i) <= tau
H2: cpt@tau = cpt@pred (A(i))
----------------------------------------
false


use orderStrict with cpt@tau, cpt@pred(A(i)) => //.
[> Line 61: ((have);(intro)) [goal> lemma reach is proved


Qed.
lemma reach @system:(set:default; equiv:None) :
forall (tau:timestamp), att (frame@tau) <> h (cpt@tau, key)
Exiting proof mode.

Press the left and right arrows to do and undo an instruction.

Alternatively, you can double-click on an instruction.

This zone shows a Squirrel file. You can double-click on a comment to collapse it for better readabilility.

This zone shows the output given by Squirrel.

This zone shows the output of the previous instruction, to help identifying the change caused by the instruction.

Previously: