[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [tlaplus] TLC help
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
On 7/2/19 12:22 PM, MK Bug wrote:
> 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.
>
> --
> 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
> <mailto:tlaplus+unsubscribe@xxxxxxxxxxxxxxxx>.
> To post to this group, send email to tlaplus@xxxxxxxxxxxxxxxx
> <mailto:tlaplus@xxxxxxxxxxxxxxxx>.
> 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.
--
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 post to this group, send email to tlaplus@xxxxxxxxxxxxxxxx.
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/0bb0e0e2-1412-3353-14ad-27fafd3e8699%40gmail.com.
For more options, visit https://groups.google.com/d/optout.