(*check*) fun neq (x,y) = not(x=y); infix neq fun nq (r1:int,c1:int) (r2:int,c2:int) = (c1 neq c2) andalso (abs(r1-r2) neq abs(c1-c2)); fun check bp (rk,ck) [] = true |check bp (rk,ck) ((rp,cp)::p) = bp (rk,ck) (rp,cp) andalso check bp (rk,ck) p;