anthem/examples/permutations.lp
Patrick Lühne 2245e139b2
Reimplement integer variable detection
This is a reimplementation of the integer variable detection procedure.
The idea is to iteratively assume variables to be noninteger, and to
prove that this would lead to a false or erroneous result. If the proof
is successful, the variable is integer as a consequence.
2018-04-20 16:37:48 +02:00

14 lines
207 B
Plaintext

#show p/2.
#external integer(n(0)).
{p(1..n, 1..n)}.
:- p(X, Y1), p(X, Y2), Y1 != Y2.
:- p(X1, Y), p(X2, Y), X1 != X2.
q1(X) :- p(X, _).
q2(Y) :- p(_, Y).
:- not q1(X), X = 1..n.
:- not q2(Y), Y = 1..n.