potassco / telingo

🕰️ A solver for temporal programs.
MIT License
22 stars 7 forks source link

telingo not working with clingo 5.6.2 #17

Open cabalar opened 12 months ago

cabalar commented 12 months ago

Hi all,

my students have detected that &tel expressions in telingo are throwing errors if we they use the latest version of clingo, 5.6.2. I tried myself the following line in a file:

&tel{ &true ;> p}.

and run telingo 2.1.1 in two conda environments: one with clingo 5.5.1 and one with 5.6.2. With 5.5.1 I got

telingo version 2.1.1
Reading from kk.lp
Solving...
Solving...
Answer: 1
 State 0:
 State 1:
  p
SATISFIABLE

Models       : 1+
Calls        : 2
Time         : 0.012s (Solving: 0.00s 1st Model: 0.00s Unsat: 0.00s)
CPU Time     : 0.006s

as expected but then with clingo 5.6.2 I get

telingo version 2.1.1
Reading from kk.lp
Traceback (most recent call last):
  File "/Users/cabalar/miniconda3/envs/pepito/lib/python3.6/site-packages/clingo/application.py", line 359, in _pyclingo_application_main
    app.main(Control(control), [_to_str(files[i]) for i in range(size)])
  File "/Users/cabalar/miniconda3/envs/pepito/lib/python3.6/site-packages/telingo/__init__.py", line 171, in main
    future_sigs, program_parts = _tf.transform([f.read() for f in files], b.add)
  File "/Users/cabalar/miniconda3/envs/pepito/lib/python3.6/site-packages/telingo/transformers/__init__.py", line 102, in transform
    _ast.parse_string(i, lambda s: append(transformer.visit(s)))
  File "/Users/cabalar/miniconda3/envs/pepito/lib/python3.6/site-packages/clingo/ast.py", line 1332, in parse_string
    cb_data,
  File "/Users/cabalar/miniconda3/envs/pepito/lib/python3.6/site-packages/clingo/_internal.py", line 71, in _handle_error
    raise handler.error[0](handler.error[1]).with_traceback(handler.error[2])
  File "/Users/cabalar/miniconda3/envs/pepito/lib/python3.6/site-packages/clingo/ast.py", line 1210, in _pyclingo_ast_callback
    callback(AST(ast))
  File "/Users/cabalar/miniconda3/envs/pepito/lib/python3.6/site-packages/telingo/transformers/__init__.py", line 102, in <lambda>
    _ast.parse_string(i, lambda s: append(transformer.visit(s)))
  File "/Users/cabalar/miniconda3/envs/pepito/lib/python3.6/site-packages/telingo/transformers/program.py", line 71, in visit
    return _ast.Transformer.visit(self, x, *args, **kwargs)
  File "/Users/cabalar/miniconda3/envs/pepito/lib/python3.6/site-packages/clingo/ast.py", line 1401, in visit
    return getattr(self, attr)(ast, *args, **kwargs)
  File "/Users/cabalar/miniconda3/envs/pepito/lib/python3.6/site-packages/telingo/transformers/program.py", line 84, in visit_Rule
    rule.head = self.visit(rule.head)
  File "/Users/cabalar/miniconda3/envs/pepito/lib/python3.6/site-packages/telingo/transformers/program.py", line 71, in visit
    return _ast.Transformer.visit(self, x, *args, **kwargs)
  File "/Users/cabalar/miniconda3/envs/pepito/lib/python3.6/site-packages/clingo/ast.py", line 1401, in visit
    return getattr(self, attr)(ast, *args, **kwargs)
  File "/Users/cabalar/miniconda3/envs/pepito/lib/python3.6/site-packages/telingo/transformers/program.py", line 153, in visit_TheoryAtom
    atom, rules = self.__head_transformer.transform(atom)
  File "/Users/cabalar/miniconda3/envs/pepito/lib/python3.6/site-packages/telingo/transformers/head.py", line 567, in transform
    cond.append(_ast.Literal(loc, _ast.Sign.NoSign, _ast.Comparison(_ast.ComparisonOperator.LessEqual, lhs, diff)))
TypeError: Comparison() takes 2 positional arguments but 3 were given
*** ERROR: (telingo): Comparison() takes 2 positional arguments but 3 were given
UNKNOWN

Models       : 0+
Calls        : 1
Time         : 0.014s (Solving: 0.00s 1st Model: 0.00s Unsat: 0.00s)
CPU Time     : 0.006s
rkaminsk commented 12 months ago

Thanks for the report. This has actually already been fixed in the latest development branch. To install the development version, you can use:

conda install -c potassco/label/dev -n pepito telingo

Alternatively, you could also downgrade clingo. This should be fixed with the next release.

See also #15.