#define N 8 #define FREE N int row[N]; int down[2*N]; int up[2*N]; int top; // Top of the trail stack int qu[N]; 2lp_main() { initial_markings(); solve_queens(); output(); } initial_markings() { and(int k=0;k=j;k--) // Untrail label(qu[k],k,FREE); check_free(i,j); //Check row i and diagonals label(i,j,j); // Place j in row i qu[j] = i; // Trail this fact top = j; // Advance top of trail stack } } output() { and(int i=0;i