"Level error in applying operator $Tuple: The level of argument 2 exceeds the maximum level allowed by the operator"

37 views
Skip to first unread message

G.Cordier

unread,
May 6, 2022, 8:28:34 AM5/6/22
to tlaplus
Hi,

When I check a constant expression with the TLA+ Tool box,
(Model > Model Checking Results : Evaluate constant expression),
I get the following error

"Level error in applying operator $Tuple:
The level of argument 2 exceeds the maximum level allowed by the operator"


For instance, if I check the below theorem T,

/// TLA Specs: BEGINNING
EXTENDS Naturals
VARIABLE h

Init == h \in (0 .. 23)
Next == h' = (h+1)%24
Spec == Init /\ [][Next]_h

THEOREM T == Spec => []Init
/// TLA SPECS: END

then I get the error message. I am really puzzled...

Could someone please explain me (1) what  does such error message mean, (2) where does the error come from, (3) how to evaluate theorems and constant expressions?

Thank you very much by advance.

Best

Gabriel

Stephan Merz

unread,
May 6, 2022, 8:37:51 AM5/6/22
to tla...@googlegroups.com
Hello,

constant expressions involve only constant operators, no variables, no primes, no temporal formulas. You can read more about levels of TLA formulas in chapter 16 of "Specifying Systems". You can use that functionality in order to evaluate constant expressions such as

{ 2*i+1 : i \in 0 .. 5 }

What you are really trying to do is check an invariant of a specification. To do that, tell TLC to interpret "Spec" as the specification that you are checking and "Init" as the invariant to check. For example, in the TLA+ Toolbox, create a new model, make sure that Spec appears in the "What is the behavior spec?" section of the Model Overview pane, and add Inv as an invariant in the "What to check?" section of that pane.

Hope this helps,

Stephan

--
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+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tlaplus/57858f0a-8b02-474f-9206-c2118c408ccen%40googlegroups.com.

G.Cordier

unread,
May 6, 2022, 8:58:06 AM5/6/22
to tlaplus
Hello,

Thank you Stephan, this helps, definitely.
Best
Gabriel

Reply all
Reply to author
Forward
0 new messages