Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,7 @@ RUN pip install flashtext && \
# b/149905611 The geopandas tests are broken with the version 0.7.0
pip install geopandas==0.6.3 && \
pip install nnabla && \
conda install -c potassco clingo -y && \
/tmp/clean-layer.sh

# Tesseract and some associated utility packages
Expand Down
20 changes: 20 additions & 0 deletions tests/test_clingo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import unittest

from clingo import Control

class TestClingo(unittest.TestCase):
def test_solve(self):
cc = Control()

cc.add('base', [], '''
a(X) :- not b(X), d(X).
b(X) :- not a(X), d(X).''')
cc.add('base', [], "d(1;2;3).")
cc.ground([("base",[])])

out = {}
def onmodel(m):
out['out'] = str(m)
cc.solve(on_model = onmodel)

self.assertEqual('d(1) d(2) d(3) b(1) b(2) b(3)', out['out'])