Fix integer detection
Clingo treats operations that were assumed to be “invalid” not as processing errors but as operations returning an empty set. This changes how formulas have to be evaluated. This commit implements an explicit function for retrieving the return type of an expression, that is, both the domain of the result as well as whether it’s an empty, unit, or general set with multiple values.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#show p/2.
|
||||
#external integer(n(0)).
|
||||
%#external integer(n(0)).
|
||||
|
||||
{p(1..n, 1..n)}.
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#show prime/1.
|
||||
#external integer(n(0)).
|
||||
%#external integer(n(0)).
|
||||
|
||||
composite(I * J) :- I = 2..n, J = 2..n.
|
||||
prime(N) :- N = 2..n, not composite(N).
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#show in/2.
|
||||
#external integer(n(0)).
|
||||
#external integer(r(0)).
|
||||
%#external integer(n(0)).
|
||||
%#external integer(r(0)).
|
||||
|
||||
{in(1..n, 1..r)}.
|
||||
covered(I) :- in(I, S).
|
||||
|
Reference in New Issue
Block a user