This web page provides supplemental materials for the following paper:
The final AGENTS.md file discussed in the paper is reproduced below.
# Project Layout
- `primary-source` — the papers we're building on
- `prosa` — our checkout of the Prosa library for real-time theory in Rocq (modify this at will)
# Human-Agent Collaboration
This is a human-agent collaboration. The human user needs to be kept up-to-date. ASK for confirmation before make sweeping changes or generating large amounts of code.
# Build, Test, and Development Commands
When compiling Prosa, use `make -j8` to ensure sufficient parallelism.
Run `make lint` and `make proof-length` after code additions.
Do NOT bother with `make validate` during development. It just slows you down.
When pausing for review, run `make htmlpretty` to ensure the user can read the up-to-date spec in a browser.
# Literate Programming
Most importantly, Prosa follows a **literate programming** approach: ALWAYS document _intent_ in comments alongside the formalization, in a way that reads naturally to a human reader with limited Rocq experience. *Every* lemma, definition, hypothesis, section, etc. should be preceded by a comment. Span sentences across multiple comments by ending the first comment with "..." and continuing subsequent comments with "...".
Use `prosa/results/transfer_schedulability/criterion.v` as a good reference for how comments should be used in Prosa.
Avoid paraphrasing math in comments.
Comments should focus on explaining intent and the bigger picture.
Write comments in the voice of a **friendly museum tour guide** welcoming an interested audience with limited Rocq experience. Use warm, natural prose that gives readers intuition for what is happening formally and why it matters.
Build a connected discussion: introduce the purpose of each step, relate it to what we have already established, and explain how it helps us move toward the result. Use gentle transitions such as "We can now...", "To put these pieces together...", or "The intuition is..." where they fit naturally. Give key ideas room to breathe with short sentences and paragraphs, and explain technical terms when they first become relevant. Keep the discussion precise and focused on understanding, without forced cheerfulness or decorative metaphors.
Before finishing, read the comments in sequence as a reader would: they should form an inviting explanation of the argument.
Avoid negative comments: explain intent and what some element of the spec accomplishes, but do NOT comment on what it doesn't do.
# Coding Style & Naming Conventions
Follow `prosa/doc/guidelines.md`.
Try to keep proof scripts as short as possible.
Aim to make the diff minimal. Remove any unnecessary changes.
Optimize for readability for Coq non-experts: use explicit hypotheses, descriptive names, short sections, and generous comments.
Prefer ssreflect style (`move`, `apply:`, `case:`, `elim:`) over standard Coq tactics.
State lemmas with explicit `forall` binders.
Use `H_` prefixes for section-level hypotheses, `job_` and `task_` prefixes for parameters, `valid_*` or `respects_*` for validity predicates, CamelCase for sections/typeclasses, and snake_case for definitions and lemmas.
Assumptions moved into the context in proof scripts should use ALL-CAPS acronyms, like `ARR`, `IN`, `TSK`, etc.
# Proof Style: Work Backward from the Goal
**Write backward-directed ssreflect proofs from the outset.** Start with the conclusion, apply the lemma that establishes it, and discharge the resulting premises. Use `rewrite` to expose a goal's structure and `move` views to unpack assumptions.
- Apply existing lemmas directly with `apply:` or `exact:`; rewrite with equalities directly instead of first naming copies with `have`.
- Omit lemma arguments that Rocq can infer from the goal or discharge from the context. For example, prefer `exact: in_arrivals_implies_arrived.` to `exact: in_arrivals_implies_arrived IN.`. Supply explicit arguments only when needed to select an instantiation, and check that the shortened proof compiles.
- State independently used conclusions as separate, descriptively named lemmas, so callers can apply the needed fact directly instead of selecting conjuncts with `proj1` or `proj2`. Reuse existing individual facts where possible; if a shared proof establishes several properties together, keep that proof local and expose only the individual facts needed by callers.
- Use `have` sparingly for a substantive intermediate fact that is reused or makes the proof materially clearer. Avoid chains of `have` statements that accumulate task membership, validity assumptions, arrival facts, and arithmetic consequences before addressing the goal.
- Changing `have FACT := ...` to `move: (...) => FACT` does not make a proof backward-directed. Change the proof structure, not just the tactic spelling.
- Prefer short applications and standard arithmetic rewrites over reconstructing a pen-and-paper argument. Keep the script readable; avoid dense tactic tricks or extra helper lemmas introduced merely to shorten a proof.
- Before presenting a proof, review each intermediate assertion and remove those that can be replaced by direct application or rewriting. Inspect the generalized theorem type to ensure automation has not introduced unnecessary section hypotheses.