Skip to content

fix(eager): fun-abs must check the swap statement does not modify glob A - #1097

Open
namasikanam wants to merge 1 commit into
mainfrom
fix/eager-glob-check
Open

fix(eager): fun-abs must check the swap statement does not modify glob A#1097
namasikanam wants to merge 1 commit into
mainfrom
fix/eager-glob-check

Conversation

@namasikanam

Copy link
Copy Markdown
Collaborator

Summary

eager fun-abs omits a documented side-condition and is unsound: the swapped statement S
is not checked to be independent of / non-modifying glob A for the abstract module A.
With a concrete Shared.g <- 5 as S and an unrestricted abstract A, EC accepts a false
eager judgment that equates two procedures returning 5 (Pr 1) and 0 (Pr 0), giving
1 = 0 via byequiv.

Root cause

t_eager_fun_abs_r / process_fun_abs never emit the conditions (documented in the .mli)
that S reads only globals and does not modify glob A. The sibling eager call
(process_call) does perform these checks; fun-abs was missing them.

Fix (src/phl/ecPhlEager.ml)

Add the glob A-disjointness check for the swap statement in the fun-abs path, mirroring
what eager call already enforces (check_only_global + PV.add_glob / PV.interdep
disjointness against glob A).

Test

tests/eager-glob-check.ec: the swap-across-glob A eager judgment must now fail.

Comment thread tests/eager-glob-check.ec Outdated
t_eager_fun_abs_r omitted the documented side-conditions that the swapped
statement S depends only on globals and does not modify glob A (the sibling
eager call checks these). With a concrete assignment to a global that an
unrestricted abstract A may touch, a false eager judgment was accepted.
Add check_only_global and a s_write/glob-A disjointness check. Adds a
fail-idiom regression test.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@namasikanam
namasikanam force-pushed the fix/eager-glob-check branch from 47d3f90 to 9f62001 Compare August 24, 2026 18:07
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.

2 participants