Next-state involving existential quantifier using PlusCal?

136 views
Skip to first unread message

Elliott Jin

unread,
Jul 25, 2016, 5:07:18 PM7/25/16
to tlaplus
Hello,

I'm trying to specify a cache consistency protocol in PlusCal, and I'm having trouble with the step "the writer writes an arbitrary value to the database".

In TLA+, I would simply include the following conjunct:
  • \E value \in Values \cup {Deleted} : db_value' = value
Is there a way to generate the same result in PlusCal?  I already tried the following:
  • \E value \in Values \cup {Deleted} : db_value := value;
    • This seems to generate \E' = [\E EXCEPT !value \in Values \cup {Deleted} : db_value = value]
  • db_value := CHOOSE value \in Values \cup {Deleted} : TRUE;
    • The semantics of using CHOOSE seems to be different than the semantics of using an existential quantifier
Thanks!
-Elliott

Leslie Lamport

unread,
Jul 25, 2016, 5:46:30 PM7/25/16
to tlaplus
with (value \in Values \cup {Deleted})
  { db_value := value }

Elliott Jin

unread,
Jul 25, 2016, 6:00:35 PM7/25/16
to tlaplus
Thanks, this worked perfectly!
Reply all
Reply to author
Forward
0 new messages