Effect4

R12: Frontiers name what they awaitreq:R12

Requirement R12: Frontiers name what they awaitabout:req:R12

This page explains requirement R12 in Effect4. It covers what the requirement asks for live frontiers, why distinguishing waiting from deadlocks matters, and how the property is checked.

What the requirement asksabout:req:R12:what-it-asks

Requirement R12 demands that non-terminal machine states explicitly name what they await rather than conflating pauses with failures (docs/core/system-map.md §8, DB-03):

  • Live frontiers: a frontier state represents a live pause waiting for fuel, host replies, or scheduling decisions.
  • Frontier characterization: when execution runs out of decisions, the frontier is empty if and only if the machine is deadlocked (frontier_empty_iff_deadlocked).
  • Deadlock definition: Deadlocked requires no runnable fiber, no armed listener, no pending host request, no active timer, and no compile budget.
  • Fairness draining: a fair decision tape leaves no armed listener at its live end (fairTape_unarmed).

A pause caused by resource exhaustion or external silence must never be reported as an error.

Why it mattersabout:req:R12:why-it-matters

Asynchronous and concurrent systems pause frequently when waiting for external responses or when running out of budgeted time.

If a runtime treated pauses as deadlocks or exceptions, programs would fail prematurely during legitimate long-running tasks.

Naming frontier causes allows external drivers to supply appropriate budget, deliver host replies, and resume paused fibers cleanly.

How it is checkedabout:req:R12:how-it-is-checked

The requirement is checked by proving frontier characterization, deadlock criteria, and fair tape draining theorems:

  • Deadlock characterization is stated by frontier_empty_iff_deadlocked in src/Effect4/Laws/Api/Frontier.lean.
  • Fair tape draining of armed listeners is stated by fairTape_unarmed (src/Effect4/Laws/Machine/Scheduling.lean).
  • Loop frontier characterization under host reply tapes is stated by rows_loop_frontier (src/Effect4/Laws/Api/SessionMeaningLoop.lean).
  • Meaning frontiers under silent hosts are stated by rows_loop_frontier_host in the same file.

The plan on this page gives each theorem's status and the goals it rests on.

fed_accountedmoduloqueue_settledmodulorest_stepgoaljobs_stepgoal
The open part of R12: its planned goals and the theorems proved modulo them. An arrow goes from a node to a node its proof reaches first.
The figure in words
R12 by concept: each concept its nodes are placed at, by tag or by module. An arrow goes where a node's proof reaches a node of another concept.
The figure in words
NodeStatusRests onNearest nodes
fairTape_unarmedproved——
frontier_empty_iff_deadlockedproved——
rows_loop_frontierproved—localWaitC_to_rowsB, funded_replays
rows_loop_frontier_hostproved—localWaitC_to_rowsB, funded_replays
driveState_loopproved—loop_of_iteration
iteration_below_budgetproved——
loop_of_iterationproved——
boundedproved——
complete_uniqueproved——
select_takes_firstproved——
first_run_flagsproved—first_run_inv
first_run_invproved—first_step_inv
first_step_invproved—positive_suspend_step_capacity, first_profile_closed
visit_selects_earliestproved——
visit_stops_iffproved——
quiet_nilproved——
settled_of_ledgerproved—within_one, spent_one, quiet_nil, settled_of_view
settled_of_viewproved——
spent_oneproved——
within_oneproved——
rest_stepgoalrest_stepcheckInput_eq_none_iff
fed_accountedmodulojobs_step, rest_stepaccounted_of_ledger, rest_step, exit_eq, jobs_step, checkInput_eq_none_iff, reached_history, ledger_opened, queueCrew_acquire_once_placed, queue_acquisition_sites, queue_built_program
queue_settledmodulojobs_step, rest_stepsettled_of_ledger, rest_step, exit_eq, jobs_step, checkInput_eq_none_iff, reached_history, ledger_opened, queueCrew_acquire_once_placed, queue_acquisition_sites, queue_built_program
localWaitC_to_rowsBproved—localRunC_compileBO
funded_replaysproved—journal_replays, tape_replays
positive_suspend_step_capacityproved—acceptLoop_length_le
first_profile_closedproved——
checkInput_eq_none_iffproved——
accounted_of_ledgerproved—held_of_shows
exit_eqproved——
jobs_stepgoaljobs_stepcheckInput_eq_none_iff
reached_historyproved——
ledger_openedproved—opened_exit
queueCrew_acquire_once_placedproved—queue_placement, queue_built_program, checkInput_eq_none_iff
queue_acquisition_sitesproved——
queue_built_programproved—queue_elaborates, build_retains, checkInput_eq_none_iff
localRunC_compileBOproved—compilesBO_onExit, compilesBO_matchCause, compilesBO_catchIf, compilesBO_catchCause, compilesBO_select, compilesBO_bind, compilesBO_iterate, compilesBO_exit, compilesBO_suspend, denoteRowsB_straight, denoteRows_straight
journal_replaysproved——
tape_replaysproved——
acceptLoop_length_leproved——
held_of_showsproved—flatMap_offers, filterMap_gave
opened_exitproved—exit_eq
queue_placementproved——
queue_elaboratesproved—queue_refs_nil, queue_main_eq, elaborateModule_no_declarations
build_retainsproved—finishBuild_retains, checkInput_eq_none_iff
compilesBO_onExitproved—at_append
compilesBO_matchCauseproved—at_append
compilesBO_catchIfproved—at_append
compilesBO_catchCauseproved—at_append
compilesBO_selectproved—at_append
compilesBO_bindproved—at_append
compilesBO_iterateproved—at_append
compilesBO_exitproved—denoteRowsB_straight, at_append
compilesBO_suspendproved—at_append
denoteRowsB_straightproved——
denoteRows_straightproved——
flatMap_offersproved——
filterMap_gaveproved——
queue_refs_nilproved——
queue_main_eqproved—queue_main_some, elaboration_eq_getD
elaborateModule_no_declarationsproved——
finishBuild_retainsproved—checkInput_eq_none_iff
at_appendproved——
queue_main_someproved——
elaboration_eq_getDproved——