Bit Flags

In this exercise we will model a series of bit flags using a function.

Variables

The spec should contain a single variable bits, which is a function whose domain {1, 2, 3} represents the bit indices and whose range {0, 1} represents the value of each bit.

Initial State

Initially all bits should be set to 0.

Transitions

  • Any bit i whose value is 0 can be flipped to 1.
  • After a bit is set to 1 it should not be changed.
bit-flags
Ready
⌘↵ to submit