TLC help

88 views
Skip to first unread message

MK Bug

unread,
Jul 2, 2019, 6:22:39 AM7/2/19
to tla...@googlegroups.com
Hi,

I am new in TLA+ Please share the difference between the invariant and properties.

When to specify model using invariant and when to specify model using properties.

A detailed understanding is needed.

Thanks in advance for your help.

Martin

unread,
Jul 2, 2019, 6:40:20 AM7/2/19
to tla...@googlegroups.com
Hi Malaika,

A property is statement about your specification that can be true or false and
which may change over time. An invariant is a property that is always true.
Consider the following specification:

VARIABLE x
Init == x = 0
Next == IF x = 0 THEN x' = 1 ELSE x' = 0
Spec == Init /\ [][Next]_x

Even == x % 2 = 0
Nonneg == x >= 0

Then both Even and Nonneg are properties of the specification, but only the
second one is true in all states. You can find a counter example to the first by
creating a new model, setting Even as an invariant and running the model
checker. If you try the same for Nonneg, TLC will exhaust all states and confirm
it is an invariant.

cheers,
Martin
> --
> 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
> <mailto:tlaplus+u...@googlegroups.com>.
> To post to this group, send email to tla...@googlegroups.com
> <mailto:tla...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/tlaplus.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/tlaplus/CA%2BkanULUzDWqiTPdZoVreA-P%2B%2BHn%2BJwFstNBaUeYQP16h42CxQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/tlaplus/CA%2BkanULUzDWqiTPdZoVreA-P%2B%2BHn%2BJwFstNBaUeYQP16h42CxQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

Stephan Merz

unread,
Jul 2, 2019, 7:43:02 AM7/2/19
to tla...@googlegroups.com
I am assuming that you refer to the model checking pane of the Toolbox. A "property" is a formula involving temporal operators that TLC can check (see section 14.2 of Specifying Systems) whereas an "invariant" is a state predicate that will be checked at every state.

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 post to this group, send email to tla...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages