Skip to main content

Module wfcheck

Module wfcheck 

Source
Expand description

The well-formedness checks (WellFormed.lean, Microkit.lean): the hypotheses of the flattening theorem and the backends that no typing rule states.

On tast, before the Ccfg: tail_rec (tailRec, which flatten needs) and chan_cycle (Wf2). After it, entered through wellformed: recv_head on the notified graph, guarded_choice on the notified and the protected term; on every graph, protected (where a Sync channel is received). Wf1 is not checked.

A failed tailRec or protected is an error. The rest are warnings: a finding is a program the theorem does not cover, not a rejected one.

Re-exports§

pub use chan_cycle::check_wf2;
pub use protected::check_protected;
pub use tail_rec::check_tail_rec;
pub use wellformed::check_graphs;

Modules§

chan_cycle
Wf2 (WellFormed.lean’s dependsOn): the channel dependency graph is acyclic, as check_wf2.
guarded_choice
The guard rule, the Lean’s Wf3 (choicesWf, Proc.choicesLead), on the typed term of each entry point’s body.
protected
Where a Sync channel is received. Its send is a protected-procedure call, which the kernel answers by invoking the receiver’s protected and waits on until it returns, so:
recv_head
Where the notified graph takes a message. The kernel invokes notified for one message, so:
tail_rec
tailRec (WellFormed.lean): every reference to a process being lowered is in tail position, as check_tail_rec.
wellformed
The entry to the receive and choice checks (check_graphs), their reporter ([Graph]) and the satisfiability procedure behind the guards ([satisfiable]).