Skip to content

Optimization to only ground relevant rule instances interferes with the backend #248

@rkaminsk

Description

@rkaminsk

When grounding the program below, the instance :- a(2). of :- a(X). is wrongly discarded resulting in the superfluous answer set { a(2) }.

>>> from clingo import Function, Control, Number
>>> 
>>> c = Control()
>>> c.configuration.solve.models = "0"
>>> with c.backend() as backend:
...     backend.add_rule([backend.add_atom(Function("a", [Number(1)]))], choice=True)
...     backend.add_rule([backend.add_atom(Function("a", [Number(2)]))], choice=True)
... 
>>> c.add("base", [], ":- a(X).")
>>> c.ground([("base", [])])
>>> c.solve(on_model=print)

a(2)
SAT

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions