Reject underivable queries in incremental ABA skeptical preferred - #101
Merged
Merged
Conversation
In an assumption-free framework with no rule for q, supported(q) is not a ground atom. is_skeptically_accepted_preferred still passed it to clingo as a false assumption; clingo reports UNSAT for an assumption on an absent atom (potassco/clingo#671), which the counterexample search read as skeptical acceptance. An ungrounded query is now answered directly: no assumption set derives it, so the answer is False with a preferred extension as counterexample. The credulous helpers get the same guard. Native, SAT and support-reference routes were already correct; the ASP and auto acceptance routes inherited the incremental bug. Closes #72 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V4tAVyyKcs1sYcsEzL7Bzg
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.
Fixes #72: the incremental ASP route for skeptical preferred ABA acceptance accepted literals that nothing can derive.
Root cause
In an assumption-free framework with no rule for
q,supported(q)is never grounded.AbaIncrementalSolver.is_skeptically_accepted_preferredstill passed it to clingo as a false assumption when searching for a counterexample. Clingo reports UNSAT for an assumption on an absent atom (potassco/clingo#671). The counterexample search (Lehtonen et al. 2021, Sec 4.2.3: UNSAT means skeptically accepted) read that UNSAT as acceptance. The correct answer is False: the only preferred extension is{}, and its closure does not containq(Bondarenko et al. 1997, Th(T), p.69).Fix
_is_grounded(ctl, symbol)checksctl.symbolic_atomsfor the query atom.False, with a preferred extension as the counterexample.Routes checked
A probe over 336 checks compared every route with the native reference on four assumption-free and small frameworks, across complete, preferred and stable semantics, credulous and skeptical tasks, and every language literal. The routes covered were:
solve_aba_with_backendwithaspandsupport_reference, each withsimplifyon and off;solve_aba_acceptancewithnative,sat,aspandauto.Before the fix, 4 checks failed: all were skeptical preferred on the assumption-free framework, via the ASP routes and
auto(which dispatches to ASP here). Native, SAT and support-reference were already correct. After the fix, all 336 checks pass.Tests (
tests/structured/aba/test_aba_skeptical_underivable.py)simplifyon and off: the answer isFalse, the counterexample is{}, and there are at most 2 solver calls. Both cases failed before the fix.-> q, every route acceptsq.Closes #72
🤖 Generated with Claude Code
https://claude.ai/code/session_01V4tAVyyKcs1sYcsEzL7Bzg