Skip to content

Document named state sets and states written as values of their sets - #512

Merged
CatarinaGamboa merged 1 commit into
mainfrom
docs/502-state-values
Nov 9, 2026
Merged

CatarinaGamboa merged 1 commit into
mainfrom
docs/502-state-values

Conversation

@CatarinaGamboa

Copy link
Copy Markdown
Collaborator

Part of #502 (PR 3, docs). Depends on #511 (and so on #510, #508 and #507). Only the last commit belongs here.

The README's typestate example now names its set and writes states as values of it:

@StateSet(name="connection", value={"unconnected", "bound", "connected", "closed"})
...
@StateRefinement(from="connection(this) == unconnected", to="connection(this) == bound")
public void bind(SocketAddress add);
...
@StateRefinement(from="connection(this) != closed", to="connection(this) == closed")
public void close();

A short paragraph says that the shorthand bound(this) is still accepted, that a to keeps the sets it does not mention, and what the error looks like. That error was checked by running the README example on #511:

State Refinement Error: found connection(socket) == bound but expected connection(socket) == connected

The study exercises live in the study repository and are not changed here.

🤖 Generated with Claude Code

@CatarinaGamboa
CatarinaGamboa force-pushed the docs/502-state-values branch 4 times, most recently from c1d70a5 to f5d9835 Compare November 9, 2026 21:44
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@CatarinaGamboa
CatarinaGamboa merged commit 70472eb into main Nov 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant