Skip to main content

Module chan_cycle

Module chan_cycle 

Source
Expand description

Wf2 (WellFormed.lean’s dependsOn): the channel dependency graph is acyclic, as check_wf2.

An edge r → s means PD r receives from PD s, so waits for it; a cycle is a circular wait, a deadlock by construction. A unidirectional channel gives one edge, receiver → sender; AsyncBi gives both, so every bidirectional channel fails Wf2. Parallel channels between one ordered pair are one edge: dependency is a relation.

Each cycle is found once, by a DFS from its least PD that enters only greater PDs: O(n · (n + E)), ample at embedded scale; Johnson’s algorithm if graphs grow.

Functions§

check_wf2
Check WF2: the channel dependency graph is acyclic.