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

Re: [tlaplus] Understanding simulation mode



Hello,

here is what "Specifying Systems" says about simulation mode (section 14.3.2):

<begin quote>
In simulation mode, TLC repeatedly constructs and checks individual behaviors of a fixed maximum length. [...] In simulation mode, TLC runs until you stop it.
<end quote>

Unlike in model checking mode, simulation continues even if all states have already been encountered before.

Stephan


On 30 Dec 2019, at 23:49, 'Nicholas Fiorentini' via tlaplus <tlaplus@xxxxxxxxxxxxxxxx> wrote:

Hi there,

I'm learning and experimenting with TLA+. I'm now curious to play with simulation mode. To my understanding, it should be useful to explore a random trace in large models to see, among other things, if the model behave as expected.

I wrote a fair simple model (see below) where I can easily assume the expected behaviour. When I run the model checker, it quickly finish without errors finding ~ 200K states (80K distinct).

Then, when I run the simulation mode, it seems to never finish, and after a while it finds hundred of million of states, and counting. I've also tried reducing the depth to a small number (like 5).

What I'm missing? 


Thanks

---- MODULE simulation ----
EXTENDS TLC, Integers

CONSTANT Controllers, NULL

(*--algorithm labels1
variables
    status = "ready",
    requester = NULL,
    counter = [c \in Controllers |-> 0];

process controller \in Controllers
begin
    Request:
        while TRUE do
            await status = "ready";
            requester := self;
            status := "request";
        end while;
end process;

process executer = "Executer"
begin
    Execute:
        await status = "request";
        counter[requester] := (counter[requester] + 1) % 10; \* to limit a little the number of states
        status := "ready";
        goto Execute;
end process;

end algorithm; *)
====


--
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/4b633b4b-2f02-4bce-88ac-aeccecff19e7%40googlegroups.com.

--
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/F448AE77-D705-458F-806D-E52341A9AA64%40gmail.com.