[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tlaplus] TCP Protocl model satisfies



Hey, I start to learn the TLA+ and the PlusCal, so I search on the Internet some cool question about it and i found something like that:

Build a model of TCP Protocol

The model satisfies requirements R1, R2:

R1: Any sent packet finally has to be received.

R2: There is infinitely many packets  sent through the system

So i start to try to write down the algorithem but i can undersatnd how to apporch it, i know that this two are easy but, still something missing:
this is what i already write:

---- MODULE TCP ----

EXTENDS Naturals, Sequences
CONSTANTS N
VARIABLES seq, ack, state

Init == /\ seq = <<>>
        /\ ack = <<>>
        /\ state = 0
       
Send(x) == /\ state = 0
           /\ seq' = Append(seq, x)
           /\ state' = 1
           
Recv(x) == /\ state = 1
           /\ x \in seq
           /\ ack' = Append(ack, x)
           /\ state' = 0
Spec == Init /\ [][Send(N) \/ Recv(N)]_<<seq, ack, state>>

So now i want to try to satisify the system with the two properties, can some one help me please with that. Thanks :)

--
You received this message because you are subscribed to the Google Groups "tlaplus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tlaplus+unsubscribe@xxxxxxxxxxxxxxxx.
To view this discussion on the web visit https://groups.google.com/d/msgid/tlaplus/704dee58-6f70-4398-adc3-86c58949fdf6n%40googlegroups.com.