(!**************************************************************** Mosel Example Problems ====================== file k6queens_ka.mos ```````````````````` Placing N queens on an NxN chess board such that they do not attack each other. (c) 2008 Fair Isaac Corporation author: S. Heipcke, March 2005, Sep. 2017 *****************************************************************!) model nqueen uses "kalis","mmsvg" parameters N = 10 ! Number of queens SOL = 10 ! Number of solutions end-parameters forward procedure print_solution(numsol: integer) forward procedure draw_solution(numsol: integer) declarations ROWS = 1..N ! Rows and columns queen: array(ROWS) of cpvar ! Position of queen per row end-declarations ! Defining the decision variables forall(i in ROWS) do 1 <= queen(i); queen(i) <= N end-do ! One queen per column all_different(queen,KALIS_GEN_ARC_CONSISTENCY) ! No two queens on the same diagonal forall(i in ROWS, j in i+1..N) do queen(i) <> queen(j) queen(i) <> queen(j) + j - i queen(j) <> queen(i) + j - i end-do ! Setting enumeration parameters cp_set_branching(assign_var(KALIS_SMALLEST_DOMAIN, KALIS_RANDOM_VALUE, queen)) ! Solve the problem (generate up to SOL solutions) solct:= 0; svgrefresh while (cp_find_next_sol and solct