Twice the amount of variables needed
Maintainers usually reply within 1 day
@AbdallahS is already working on this.
Since Apr 22, 2026.
Assessment
This issue has not been assessed yet.
Description
For the well known example:
#const int_domain_size = 10000.
variable_declare(assign_x, x, fromFacts).
variable_domain(x, val(int, 1..int_domain_size)).
in direct.lp you have the rules:
_se_value(variable(X),V) :- direct_query(variable(X)), _se_assign(NAME,variable(X),E2), _se_value(E2,V), usc_active(NAME).
this is the reason we have double the variables, as it grounds to:
_se_value(variable(x),val(int,10000)):-_se_assign(_label_anonymous,variable(x),val(int,10000)),direct_query(variable(x)).
_se_value(variable(x),val(int,9999)):-_se_assign(_label_anonymous,variable(x),val(int,9999)),direct_query(variable(x)).
_se_value(variable(x),val(int,9998)):-_se_assign(_label_anonymous,variable(x),val(int,9998)),direct_query(variable(x)).
...
we have 2 literals in the body, 1 literal in the head, that means that clasp probably introduces a variable for the whole body.
Is this rule correct like this? And more interesting, what means direct_query(variable(X)). This is a dynamic predicate and can't be optimized away, and is produced by the rule:
direct_query(X) :- _se_assign(NAME,X,E).
which produces
direct_query(variable(x)):-_se_assign(_label_anonymous,variable(x),val(int,9998)).
direct_query(variable(x)):-_se_assign(_label_anonymous,variable(x),val(int,9999)).
direct_query(variable(x)):-_se_assign(_label_anonymous,variable(x),val(int,10000)).
...
Non of this is detected as deterministic. I'm not sure what the semantics of direct_query is, but maybe we could so something to define it "deterministically".
In short: I think this is the reason why we have twice the amount of predicates we need, but I do not know what is going on there because of the lack of my semantic knowledge
- Dominant language
- Python
- Stars
- 4
- Forks
- 0
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 19
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from potassco/constraint-handler
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
potassco/constraint-handler#276 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
potassco/constraint-handler#216 · 6 comments ·
Maintainers usually reply within 1 day
-
constraint-handler 2
Difficulty 5/5 Over a week Newbie friendliness 25/100
potassco/constraint-handler#491 · 2 comments ·
Maintainers usually reply within 1 day
-
Multiple definitions that agree with each otherPossibly taken @AbdallahS claimed this 1 day ago. Openconstraint-handler 2
potassco/constraint-handler#490 · 1 assignee ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
potassco/constraint-handler#489 ·
Maintainers usually reply within 1 day
All issues in potassco/constraint-handler
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
521xueweihan/HelloGitHub#4729 ·
-
auto-reported bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
needs-triage type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
pollen-robotics/reachy_mini_conversation_app#631 ·
Maintainers usually reply within 7 days
-
stix-atlas.json: the same relationship id is used for several different mitigates relationshipsOpen
Difficulty 2/5 1-3 hours Newbie friendliness 76/100