Skip to content

Commit

Permalink
when using clingo module, only put in model the shown atoms
Browse files Browse the repository at this point in the history
When using .symbols method, many selections are available. Before this
commit, we asked for everything.
What interests us is the sole clingo output. Hence this commit.
  • Loading branch information
Aluriak committed Oct 30, 2019
1 parent 8add344 commit 3137577
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ the official module can be used by clyngor if it is available.
- 0.4.0 (todo)
- see [further ideas](#Further-ideas)
- 0.3.24
- when using clingo module, the models contains only the output atoms, not everything
- access to the answer set number with `.with_answer_number`
- parsing and string reproduction of nested atoms such as `a((a("g(2,3)",(2)),))` is now correctly handled and tested
- fix the `models.command` output when clingo module is used
Expand Down
2 changes: 1 addition & 1 deletion clyngor/answers.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ def __compute_answers(self):
with self._solver.solve(**kwargs) as models:
for model in models:
answer_set = set((a.name, utils.clingo_value_to_python(a.arguments))
for a in model.symbols(atoms=True))
for a in model.symbols(shown=True))
yield answer_set, model.cost, model.optimality_proven, model.number

@property
Expand Down

0 comments on commit 3137577

Please sign in to comment.