I stumbled upon this bug while playing around with telingo. It seems like released externals are not handled by ProgramObserver, as this code raises a TypeError: '<' not supported between instances of 'TruthValue' and 'TruthValue'
import clingo
import clingox.program
#%%
program = """
#external ext. [false]
aux.
derived :- ext, aux.
"""
#%%
ctl = clingo.Control()
prg = clingox.program.Program()
obs = clingox.program.ProgramObserver(prg)
ctl.register_observer(obs)
#%%
ctl.add('base', [], program)
ctl.ground([('base', [])])
ctl.release_external(clingo.Function('ext'))
#%%
print(prg) # TypeError: '<' not supported between instances of 'TruthValue' and 'TruthValue'
Probably the sort (clingox/program.py:685) needs a partial application s.t. TruthValue are considered equal, or TruthValue also perhaps should implement @total_order/__lt__ etc.?
My relevant library versions (reported by conda) are:
Hello,
I stumbled upon this bug while playing around with telingo. It seems like released externals are not handled by ProgramObserver, as this code raises a
TypeError: '<' not supported between instances of 'TruthValue' and 'TruthValue'
Probably the
sort
(clingox/program.py:685) needs a partial application s.t.TruthValue
are considered equal, orTruthValue
also perhaps should implement@total_order
/__lt__
etc.?My relevant library versions (reported by conda) are:
Best regards