Repository navigation
Drop path conditions that expected does not depend on from Found - #487
CatarinaGamboa wants to merge 1 commit into
Conversation
Codex review, round 1(Codex v0.164.0,
|
|
Round 1, my response:
|
Codex review, round 2(On commit 0a207e9, same setup as round 1.)
No findings, so there is nothing to fix or decline, and the review loop ends here. |
0a207e9 to
39c531f
Compare
A generated boolean binder (a path condition such as #if_condition) whose variable and refinement share no term with Expected, directly or through other facts, and that no other row mentions, is removed as a step of the Binder pass. The original chain the panel steps back to keeps it. The linking helpers (factsOf, linkedTerms, termsOf, termName, linkedToExpected) move from RefinementError to VCSimplificationUtils, so the simplified chain, the message and the counterexample link facts the same way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
39c531f to
c95bb86
Compare
Codex review, round 1(Codex v0.164.0,
|
|
Round 1, my response:
|
Codex review, round 2(On commit c95bb86, same setup as round 1.)
Codex had no findings, so the review loop ends here. |
Refs #375.
Follow-up to #476 and #485, approved by the PM. The simplified Found (the last step the VS Code panel shows) no longer lists path conditions that Expected does not depend on.
Problem
#485 trims the message to the facts linked to Expected. The panel's last step still listed every
if/loop guard, so the message and the panel disagreed. In the study exercises:expected redoable(undoManager) but could not prove it, but the panel still shows twoswitchguards.baseline || extended, which says nothing aboutwParam.Rule
A binder of a generated boolean (a path condition such as
#if_condition) is dropped when both hold:Rows that are not generated booleans are never dropped by this rule; the message still trims those (#485), so the message is always a subset of the panel's last step. Without expected terms (
NeededVariables.NONE), nothing is dropped.Each removal is a step of the existing
Binderpass. Stepping back in the panel still shows the original facts: the root of theVCSimplificationResultorigin chain keeps every dropped guard. I checked this for the A1_56 shape (each guard is its ownBinderstep and the root has both), andTestGeneratedNamesnow reads the original Found, so it checks it on every run.One source for the linking.
factsOf,linkedTerms,termsOf,termNameandlinkedToExpectedmoved fromRefinementErrortoVCSimplificationUtils, so simplification no longer needs anything from diagnostics.RefinementError(message and counterexample),StateRefinementError(message) andNeededVariables(panel) now all use them.VCSimplificationUtilshad its owntermsOfthat named applications bytoString(). Now applications over variables are named as in the SMT model (size(x)), which the counterexample needs, and the other applications are named as written (f(1)). All tests pass with that change.The "could not prove it" frame, the shortcut that keeps Found as written when every fact is linked, and the counterexample are unchanged.
Before / after (the panel's last step)
The rows below are the simplified chain exactly as
VCImplication.toString()prints it, fromorigin/mainand this branch.A1_56 (JabRef
EditAction, line 69). The message is unchanged on both:expected redoable(undoManager¹⁴¹) but could not prove it.A1_01 (dcm4che
SlideRecoder, line 131). The message is unchanged:found startTiling(wParam²⁹⁷) && startCompression(wParam²⁹⁷) but expected compressionExplicit(wParam²⁹⁷).A guard Expected depends on stays (
ErrorCounterexampleLinkedPathCondition). The message is unchanged:!(port < 0) && timeout¹⁰ == port - 1 is not a subtype of timeout¹⁰ >= 0.retries > 3is dropped.port < 0is linked throughtimeout == port - 1and stays.In all three cases the original step still shows every guard.
No screenshots: the
liquidjava-devharness has no panel-capture script yet, and the extension server would need this verifier built into it, so I skipped them.Tests
VCBinderSimplificationTesthas 4 new tests. Each fails without the change.removesPathConditionsExpectedDoesNotDependOn: the A1_56 shape, including a negated disjunction.keepsPathConditionExpectedDependsOnThroughAnotherRow: a guard linked throughy == x - 10stays while an unlinked one goes.keepsPathConditionAnotherRowMentions: a guard whose variable a ternary row uses stays.keepsPathConditionsExpectedNames: a guard whose own variable Expected names stays, and so does a guard on a call Expected names (f(1), Codex round 1).Changed:
TestGeneratedNamesnow reads the original Found instead of the simplified one, because the simplified one no longer has the guards whose names it checks. Only line 54 changes: it is nowisNull == #operation_result && #if_condition == isNull && #if_condition && x == 0, the alias as written before simplification.mvn test: 702 tests, 0 failures.Size: +192 / −108 over 7 files. About 90 of the removed lines are the helpers that moved out of
RefinementError.🤖 Generated with Claude Code