v(1..6).
e(1,2). e(1,3). e(1,4).
e(2,4). e(2,5). e(2,6).
e(3,1). e(3,4). e(3,5).
e(4,1).
e(5,2). e(5,3). e(5,4). e(5,6).
e(6,2). e(6,3). e(6,5).

{ p(X,Y) } :- e(X,Y).

r(X) :- p(1,X).
r(Y) :- r(X), p(X,Y).

:- 2 {p(X,Y)}, v(X).
:- 2 {p(X,Y)}, v(Y).

:- not r(X), v(X).

#show p/2.

Resource created Tuesday 08 September 2020, 12:30:02 PM.

file: hamilton.lp


Back to top

COMP4418 20T3 (Knowledge Representation and Reasoning) is powered by WebCMS3
CRICOS Provider No. 00098G