Skip to content

feat(validate): EB010 non-trivial well-definedness conditions#52

Open
evdenis wants to merge 4 commits into
mainfrom
feat/wd-eb010
Open

feat(validate): EB010 non-trivial well-definedness conditions#52
evdenis wants to merge 4 commits into
mainfrom
feat/wd-eb010

Conversation

@evdenis

@evdenis evdenis commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

What

A faithful port of Rodin's well-definedness calculus, surfaced as INFO findings
(EB010) through a new --show-info flag on rossi validate.

For every formula the static check accepted, rossi computes its WD lemma
(Rodin's L-operator), simplifies it (Rodin's WDImprover), and reports the
survivors as INFO diagnostics with the message
Well-definedness condition: <lemma> — byte-identical to eventb-checker, which
prints Rodin's Predicate#toString(). Coverage matches eventb-checker: context
axioms/theorems; machine invariants/theorems/variant; event guards/actions/
witnesses (including INITIALISATION).

Default output is unchanged: WD findings are INFO-severity, hidden unless
--show-info is passed, and never affect the exit code.

Commits

  • feat(wd): port Rodin's well-definedness calculus
  • feat(wd): emit EB010 well-definedness findings from the typed model
  • test(wd): pin well-definedness output to the eventb-checker oracle
  • feat(validate): surface EB010 well-definedness via --show-info

Testing

  • wd_oracle_diff gate: WD messages are byte-identical to eventb-checker 1.6
    across the model corpus.
  • cli_test covers default-hidden / --show-info / JSON rule_id: EB010.
  • Pre-commit gate green on every commit.

Part of splitting #50 into reviewable PRs.

Stacked on refactor/typed-model (its op_info module and ScModel are
prerequisites). Review/merge after that PR; the base will retarget to main
once it lands.

Base automatically changed from refactor/typed-model to main June 14, 2026 18:34
evdenis added 4 commits June 14, 2026 22:38
Add the calculus eventb-checker borrows from Rodin to decide whether a
formula is well-defined, as a self-contained rossi-build module:

- computer: the L-operator deriving a formula's WD lemma
- builder: FormulaBuilder smart constructors keeping the lemma in normal
  form
- improve: the WDImprover simplifier dropping trivial/subsumed conjuncts
- normal: binder flattening and capture-aware binder renaming
- render: a Formula#toString renderer, byte-identical to Rodin

The module is the calculus only and is not yet wired to any checker; its
inline unit tests exercise each layer directly.
Drive the calculus over a checked project: for every formula the static
check kept, compute its WD lemma, simplify it, and report the survivors
as INFO diagnostics carrying RuleId::WellDefinedness (EB010), the message
rendered byte-identically to eventb-checker.

Raw component ASTs supply the formulas (the lemma embeds verbatim source
fragments); the typed model supplies the environments and decides which
clauses the check kept, paired by source position rather than label.
Registers EB010 in the rule catalogue.
Add the wd_oracle_diff gate: build each corpus model, run the WD pipeline,
and assert the rendered findings are byte-identical to eventb-checker's
EB010 output. The gate is #[ignore] and skips unless EVENTB_CORPUS_DIR and
the oracle CLI are available.

Factor the corpus plumbing it shares with the other oracle gates
(eventb_checker_bin, oracle_available, collect_zips) into tests/common.
Wire the WD pipeline into `rossi validate`: build the typed model once,
run wd:: over it, and fold the EB010 findings into the results. They are
INFO-severity and, like eventb-checker, dropped from every output format
unless the new --show-info flag is set; the WD pass is skipped entirely
when its rows would be discarded. Text output gains an INFO glyph.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant