Closed jinulee-v closed 1 year ago
And if possible, are there any monkey patches/bypasses to obtain a correct string representation?
AFAIK the representation is correct. From (at least) clingo 5.X, semi-colon in the head represents a disjunction but when used in the body semi-colon is a conjunction.
It allows for disambiguating conditions and literals in rule bodies. For an example look at Example 3.14 (p29) of the Clingo Guide: https://github.com/potassco/guide/releases/tag/v2.2.0
In your example, a ,
could have been used. However, I decided to always use ;
because it never leads to ambiguities. If you pass the rule to clingo, you will see that it accepts the rule just fine.
Thank you all for helpful comments. I must have misunderstood the syntax of Clingo ASP!
Hi, I am currently working with python bindings of Clingo. There is a major issue regarding the AST.str() function, which intends to convert the AST object into reparsable, reproducible string representation.
Note that ASP code
p(X) :- r(X), not q(X)
translates top(X) :- r(X); not q(X)
, which is completely different from the best of my knowledge. (comma represents logical AND, while semi-colon represents disjunction) I believe it is a issue in the underlying C library, but I yet have inspected that portion of Clingo and therefore cannot make any suggestions at the moment.clingo 5.4.0 libclingo 5.4.0 libclasp 3.3.5 python clingo bindings(installed via pip) 5.6.2