Skip to content

builtin: declare :list:member as ArgModeInputOutput (fixes #94) - #95

Open
jdymitarai wants to merge 1 commit into
google:mainfrom
jdymitarai:fix-list-member-mode
Open

jdymitarai wants to merge 1 commit into
google:mainfrom
jdymitarai:fix-list-member-mode

Conversation

@jdymitarai

Copy link
Copy Markdown

Root Cause

In builtin/builtin.go, :list:member was declared with argument modes {ast.ArgModeOutput, ast.ArgModeInput}. The static rule analyzer consequently rejected goals where the member argument is already bound or constant (ANALYSIS ERROR: expected X to be a free variable), even though Decide() in builtin/builtin.go and BoundsAnalyzer.feasibleAlternatives() in analysis/boundscheck.go are explicitly implemented to handle both bound and free member arguments.

Fix

Update :list:member's predicate mode in builtin.go to {ast.ArgModeInputOutput, ast.ArgModeInput}. In addition, fix Windows path separator handling in analysis/validation_test.go (path.Join for embed.FS).

Test Verification

Added bounds check test case in analysis/validation_test.go and an end-to-end stratified program evaluation test TestListMemberBound in engine/seminaivebottomup_test.go. Verified all tests in builtin, analysis, and engine pass (go test -count=1 ./...).

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