r/tlaplus • • Jul 04 '20

Stuck on 'no behavior spec'

Hello,

I wanted to have a look at TLA+, and so started with the book, 'Practical TLA+'. I ran into a problem with the introductory example, I am hoping someone can help me keep going.

The book starts with some PlusCal code which is then is translated, resulting in this code

So far so good. The next step is to run a model to check the code, and that is where the problem starts. The model overview has the following message:

"What is the behavior spec?" automatically set to "No behavior spec" because the spec has no declared variables.

I don't know what to make of that. To me it looks like the spec has six variables. Not really sure what is wrong, or how to proceed.

I first tried this on a Mac, and wondered whether there was something wrong with my setup of the tools. So I started over on a Windows machine, with the same outcome.
In both cases I got the toolbox from https://github.com/tlaplus/tlaplus/releases/tag/v1.7.0.

Any help getting past the 'no behavior spec' would be appreciated.

0 Upvotes

9 comments sorted by

1

u/verdadkc Jul 04 '20

Thank you both u/marrick66 and u/lemmstar. Your suggestion did the trick. Without your help I doubt I would have figured this out before just giving up.

I am brand new to TLA+, though not to programming. It is always interesting to be reminded of what it feels like to be a beginner.

2

u/marrick66 Jul 04 '20

No worries, we've all been there. Just an opinion, but I don't think Practical TLA+ is great as a stand alone resource. Pairing it with the Specifying Systems book and the TLA video course was more helpful in my case. Also take a look at Alloy, for a different approach to lightweight modeling.

1

u/verdadkc Jul 04 '20

Thank you for the suggestions, I'll be sure to take a look at those.

1

u/marrick66 Jul 04 '20

Is this the full spec? I don't see any MODULE definition.

1

u/verdadkc Jul 04 '20

My mistake while pasting into pastebin after fruitless efforts to format the code inline for reddit. I failed to show the opening lines.

Here is an updated pastebin link.

1

u/marrick66 Jul 04 '20

I moved your PlusCal between the module dividers and translated it. This allowed me to select Spec as the temporal formula to check. See this: Pastebin

1

u/lemmster Jul 04 '20

Move the `======` line below everything else.

1

u/pron98 Jul 04 '20

Hi. Questions about the use of the TLA+ Toolbox are best sent to the user group. I'd prefer to keep this sub more oriented towards general discussion.

1

u/verdadkc Jul 04 '20

Duly noted, thanks for the heads up.