such representation would lead to fairly cumbersome operations for checking the availability of positions this is highly undesirable since it is the most frequently executed operation we should therefore choose data representation which makes checking as simple as possible the best recipe is to represent as directly as possible that information which is truly relevant and most often used in our case this is not the position of the queensbut whether or not queen has already been placed along each row and diagonals (we already know that exactly one is placed in each column for < this leads to the following choice of variablesvar xarray of integeraarray of booleanbcarray of boolean where xi denotes the position of the queen in the -th columnaj means "no queen lies in the -th row"bk means "no queen occupies the -th /-diagonalc means "no queen sits on the -th \-diagonal we note that in /-diagonal all fields have the same sums of their coordinates and jand that in \diagonal the coordinate differences - are constant the appropriate solution is shown in the following program queens given these datathe statement setqueen is elaborated to [ :ja[ :falseb[ + :falsec[ - + :false the statement removequeen is refined into [ :trueb[ + :truec[ - + :true the field is safe if it lies in row and in diagonals which are still free henceit can be expressed by the logical expression [jb[ +jc[ - + this allows one to formulate the procedures for enumeration of safe rows for the -th queen by analogy with the preceding example this completes the development of this algorithmthat is shown in full below the computed solution is ( and is shown in fig fig solution to the eight queens problem procedure try (iintegervar doneboolean)var eosbooleanjintegerprocedure next(adens _queens *