trait counter.countable {
uses counter.state
countable has increment
countable has decrement
countable has reset
operations is atomic
}
docs {
The counter.countable trait defines operations on a counter. It depends
on counter.state (which provides value, min, max properties).
Operations:
- increment: increase value by 1 (respecting maximum)
- decrement: decrease value by 1 (respecting minimum)
- reset: return value to initial state
The invariant "operations are atomic" ensures that count changes
happen indivisibly - no partial updates.
}