feat(proofs): close lemma_build_yields_symmetric + vmodel_chain_two_steps#228
Open
feat(proofs): close lemma_build_yields_symmetric + vmodel_chain_two_steps#228
Conversation
…teps
Verus side: replace the assume(...) bridge in lemma_build_yields_symmetric
with explicit `assert forall|...| ... implies ... by { ... }` blocks for
both directions of backlink_symmetric. To make the spec-fn-side and the
requires-side share a common SMT trigger pattern, the corresponding
inner term accesses on backlink_symmetric (g.forward[src][i],
g.backward[tgt][j], etc.) now carry matching `#[trigger]` annotations.
The explicit skolemization in the assert-forall is what actually drives
the instantiation; the trigger pin guarantees the SMT pattern matches.
Rocq side: vmodel_chain_two_steps was Admitted with a note that the
prior statement was under-constrained — the proof needed to identify
the anonymous link target t1 from a1's r1-link with the named parameter
a2, and there was no premise forcing that. We pick option (2) from the
prior note: existentially quantify the intermediate. The resulting
theorem is what the V-model chain actually says ("a r1+r2 chain from
a1 lands at some downstream artifact") and admits a direct proof:
extract t1 from rule_satisfied/r1, use rule_target_kind r1 =
rule_source_kind r2 plus rule_satisfied/r2 to get t2, then close with
reach_direct + reach_trans.
Verifies: REQ-004
link_valid hands us [art_id t = link_target l], but reach_direct's has_link_to needs [link_target l = art_id t] (the obligation flips direction in the constructor's argument). Wrap the assumption in [symmetry]. Verifies: REQ-004
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'Rivet Criterion Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.
| Benchmark suite | Current: 5494d54 | Previous: 92ad95d | Ratio |
|---|---|---|---|
query/10000 |
154678 ns/iter (± 626) |
109024 ns/iter (± 1298) |
1.42 |
This comment was automatically generated by workflow using github-action-benchmark.
📐 Rivet artifact deltaNo artifact changes in this PR. Code-only changes (renderer, CLI wiring, tests) don't touch the artifact graph. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes the two remaining proof gaps in rivet's formal verification (REQ-004 follow-ups):
Gap 1 (Verus):
lemma_build_yields_symmetricassume(backlink_symmetric(g, s))bridge with explicitassert forall|...| ... implies ... by { ... }blocks for both directions ofbacklink_symmetric.#[trigger]annotations onbacklink_symmetric's inner term accesses so the spec-fn-side and the requires-side share a common SMT trigger pattern.assert forallis what actually drives the instantiation; the matching triggers guarantee the SMT pattern bridges.Gap 2 (Rocq):
vmodel_chain_two_stepsAdmittedwith a note observing the prior statement was under-constrained: there was no premise forcing the anonymous r1-link targett1to equal the named parametera2.a1lands at some downstream artifact."t1viaartifact_satisfies_rule s a1 r1, userule_target_kind r1 = rule_source_kind r2plusrule_satisfied s r2to push through tot2, then close withreach_direct+reach_trans. RealProof. ... Qed.CI status note
GitHub Actions has been backlogged at the time of this PR — Test, Verus, and Rocq jobs have all sat in
QUEUEDfor ~50+ minutes after PR creation with no runner pickup. The Verus and Rocq jobs are gated onneeds: [test], so they cannot start until the runner queue moves. The proofs were verified by careful manual inspection against the spec definitions:reachableconstructors and thelink_valid/artifact_satisfies_ruledefinitions;symmetrycorrectly bridges the direction mismatch betweenart_id t = link_target l(fromlink_valid) andlink_target l = art_id t(required byhas_link_to).assert forallskolemization produces the same instantiation pattern. If CI surfaces a residual SMT issue (most likely a missed trigger normalization), the next iteration will add explicit witness extraction inside theby { }blocks (e.g.,let j = choose|j: int| ...).Test plan
lemma_build_yields_symmetrichaving noassume(...)for the postconditionvmodel_chain_two_stepsending inQed.🤖 Generated with Claude Code