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

*From*: loki der quaeler <qua...@xxxxxxxxx>*Date*: Thu, 9 Nov 2017 08:51:25 -0800 (PST)*References*: <c82d6669-8cc2-4fba-83f8-a3276176b7fa@googlegroups.com>

On first blush, i'm not so sure this is a bug. It seems like you are treating state = v like an assignment (like one would do with a programming language) and not an atomic logical evaluation, and so, if that is true, your spec is expecting state to have the value of v when evaluating the conjunct state > 0.

In that bounded _expression_ though, the model-state for an evaluation (not involving next states) is simultaneous; so state (an unfortunately named variable for this sentence) should be thought of as simultaneously being evaluated equal to v and greater than 0 - not set equal to v and then whether it is greater than 0.

(Though i'd appreciate confirmation or correction from Leslie or Markus.)

On Wednesday, November 8, 2017 at 8:35:02 AM UTC-8, Michael Collins wrote:

This appears to be a bug: given a spec like

---------------------------- MODULE

EXTENDS Integers

VARIABLE b

InitOp(state) == \E v \in 0..1 : (state = v /\ state > 0)

Init == InitOp(b)

Next == (*whatever*)

Spec == Init /\ [][Next]_b /\ WF_b(Next)

===================================

The TLC model checker does not find any initial states. We do get the expected initial state [b=1] if we instead define

InitOp(state) == \E v \in 0..1 : (state = v /\ v > 0)

More generally, if S is some finite set, and Predicate(CHOOSE e \in S : TRUE) is false, the model checker fails to find any initial states with

InitOp(state) == \E v \in S : (state = v /\ Predicate(state))

Furthermore, if Predicate(CHOOSE e \in S : TRUE) is true, this generates initial states with b equal to every member of S, even those for which Predicate is false.

We get the expected initial states with

InitOp(state) == \E v \in S : (state = v /\ Predicate(v))

(same behavior on Ubuntu, Mac, and Windows)

**References**:**Apparent bug in operators using \E***From:*Michael Collins

- Prev by Date:
**Re: [tlaplus] Re: Login required for TLA toolbox?** - Next by Date:
**Re: Apparent bug in operators using \E** - Previous by thread:
**Apparent bug in operators using \E** - Next by thread:
**Re: Apparent bug in operators using \E** - Index(es):