query(p24,p,[p,q,r,s],[s],[]). %----------------------------------------------------------- :- table p / 0. :- table q / 0. :- table r / 0. :- table s / 0. p :- tnot(s), q, tnot(r). q :- r, tnot(p). r :- p, tnot(q). s :- tnot(p), tnot(q), tnot(r).