hwayne / learntla

A TLA+ guide
http://www.learntla.com
Creative Commons Attribution 4.0 International
278 stars 57 forks source link

Bogus example assigning to (constant) bound identifier #57

Closed lemmy closed 6 years ago

lemmy commented 6 years ago

The example below (copied from https://learntla.com/pluscal/behaviors/) is bogus and future Pcal translator versions won't accept it (see screenshot below). The "f" in the either statement is a bound identifier and thus cannot be assigned a value.

---- MODULE flags ----
EXTENDS TLC, Integers
(* --algorithm flags
variables f1 \in BOOLEAN, f2 \in BOOLEAN, f3 \in BOOLEAN
begin
  while TRUE do
    with f \in {f1, f2, f3} do
      either
        f := TRUE;
      or
        f := FALSE;
      end either;
    end with;
  end while;
end algorithm; *)

====

assignmenttoundeclaredvar

hwayne commented 6 years ago

Working on a fixed version

hwayne commented 6 years ago

A stopgap is up for now that is fixed