Hoare.Graph (hoare v0.2.0)

Copy Markdown View Source

The graph a list of transition modules declares: states as vertices, each transition an edge from every state it leaves to the one it reaches.

The list is explicit, kept wherever the record's transitions are known. Assert on edges/1 so a change to the graph is a deliberate diff, or paste to_mermaid/1 into the docs.

Summary

Functions

The states the transitions name, in first-seen order.

A Mermaid stateDiagram-v2, modules labelled by their last segment.

Types

edge()

@type edge() :: {from :: module(), via :: module(), to :: module()}

Functions

edges(transitions)

@spec edges([module()]) :: [edge()]

states(transitions)

@spec states([module()]) :: [module()]

The states the transitions name, in first-seen order.

to_mermaid(transitions)

@spec to_mermaid([module()]) :: String.t()

A Mermaid stateDiagram-v2, modules labelled by their last segment.