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

*From*: Smruti Padhy <smruti.padhy@xxxxxxxxx>*Date*: Sat, 24 Apr 2021 07:19:18 -0700 (PDT)*References*: <90b306a3-c413-4b09-810e-98aedb44d91fn@googlegroups.com> <BA49039D-022B-486C-B57A-D7DFC676F265@gmail.com> <d9af2d7a-f150-422f-956a-98b6b69f7843n@googlegroups.com> <A085D874-3F90-4D91-B89C-28C06ED3AB4D@gmail.com> <189be644-18f8-40ae-9584-b552fc0c5842n@googlegroups.com> <4EB026AA-BF8D-40F8-BEB4-9B9670804FAC@gmail.com>

Hi Stephan,

Thank you so much for the detailed explanation and the updated spec example. Now I understand how to define and set state constraints options in TLC. I did not see or aware of the state constraint option in TLC additional spec before this conversation. Thanks again for taking the time to explain that to me.

Best,

Smruti

-- On Friday, April 23, 2021 at 2:07:11 AM UTC-5 Stephan Merz wrote:

Hello Smruti,for checking if an invariant Inv is inductive you model check Inv for the specificationInv /\ [][Next]_varsi.e. you replace the initial condition of your original specification by the invariant.In order for this to work, the invariant should begin with a typing invariant that contains conjuncts x \in S for each variable, and S must be a set that TLC can enumerate. In particular, Nat cannot be enumerated and you will need to override it by an interval 0 .. N for some value N.Then, in order to make sure that values stay within that interval despite incrementation, you need to add a state constraint that ensures that states for which some Nat-valued variable or record component reaches N are discarded. For example, add a constraint "clock < N" so that TLC will never try to increment the clock in a state where clock = N.By increasing the bound N, you increase your confidence in the result of (bounded) verification.A corresponding variant of your spec is attached. In order to check that the invariant is inductive, do the following:- Instantiate the constant largestNat by some value, say 10.- In the model overview pane, indicate temporal formula CheckInductiveSpec as the behavior spec and InductiveInvariant as the invariant to be checked.- In the additional spec options, add the predicate StateConstraint as (you guessed it) the state constraint and add a definition override Nat <- 0 .. largestNat.Now run TLC. You'll see that all states are found when evaluating the initial state predicate (InductiveInvariant) whereas the actions do not generate any new states, confirming that the invariant is indeed inductive.–––This technique works for "small" state spaces. The note [1] mentioned by Karolis Petrauskas describes a technique for probabilistic invariant checking when state spaces are too big.Regards,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+unsubscribe@xxxxxxxxxxxxxxxx.

To view this discussion on the web visit https://groups.google.com/d/msgid/tlaplus/fea20d98-fe85-4082-954f-5a99ee24d35dn%40googlegroups.com.

**References**:**[tlaplus] TLAPS proof of increment and update***From:*Smruti Padhy

**Re: [tlaplus] TLAPS proof of increment and update***From:*Stephan Merz

**Re: [tlaplus] TLAPS proof of increment and update***From:*Smruti Padhy

**Re: [tlaplus] TLAPS proof of increment and update***From:*Stephan Merz

**Re: [tlaplus] TLAPS proof of increment and update***From:*Smruti Padhy

**Re: [tlaplus] TLAPS proof of increment and update***From:*Stephan Merz

- Prev by Date:
**Re: [tlaplus] TLAPS proof of increment and update** - Next by Date:
**[tlaplus] About WF and SF operators' semantics** - Previous by thread:
**Re: [tlaplus] TLAPS proof of increment and update** - Next by thread:
**[tlaplus] Overriding operator which is used in a temporal property** - Index(es):