Y, Z < Y," . and "not (pref(A,C), cl" /> Y, Z < Y," . and "not (pref(A,C), cl" /> Y, Z < Y," . and "not (pref(A,C), cl"/>

Clingo Syntax Error, unexpeced ">" and "!="

51 Views Asked by At

The error occurs on line "not pref(A,C), clockwise(A,C), path(A,C,Z), pref(A,B), clockwise(A,B), path(A,B,W), W > Y, Z < Y," . and "not (pref(A,C), clockwise(A,C), selects(C,A,_), C != B),"

I am try to use basic arithmetic operation in Clingo. Since I have no experience, I don't know how to fix this syntax error. I assume that logic is true.

as(1..3).

clockwise(1,2).
clockwise(2,3).
clockwise(3,1).

path(1,2,20).
path(2,3,30).
path(3,1,40).
path(1,3,310).
path(3,2,230).

pref(1,2).
pref(2,3).
pref(3,1).

selects(1,2,20).
selects(2,3,30).
selects(3,1,40).

gadget :-
    selects(2,3,230),
    not selects(3,1,310),
    not selects(1,2,20),
    selects(3,1,30),
    selects(1,2,40).

selects(A,X,Y) :-
    pref(A,B),
    clockwise(A,B),
    path(A,B,Y),
    not pref(A,C), clockwise(A,C), path(A,C,Z), pref(A,B), clockwise(A,B), path(A,B,W), W > Y, Z < Y,
    not selects(A,B,Z), Z > Y),
    not gadget, selects(A,_,Z), Z > Y,
    not selects(_,A,Z), Z > Y),
    not gadget, selects(_,A,Z), Z > Y,
    not selects(A,X,Z), Z < Y.

prefers(A,B) :-
    selects(B,A,_),
    not (pref(A,C), clockwise(A,C), selects(C,A,_), C != B),
    not (gadget, selects(C,A,_), selects(B,C,_)),
    not (pref(A,B), selects(_,A,_), not selects(B,A,_)),
    not (gadget, selects(_,A,_), selects(B,C,_), selects(C,D,_), selects(D,E,_), selects(E,F,_), selects(F,G,_), selects(G,H,_), selects(H,I,_), selects(I,B,_)).

:- selects(A,X,Y), selects(B,X,Z), A != B, Y > Z, not gadget.
0

There are 0 best solutions below