[ library(visualize_tree) | Reference Manual | Alphabetic Index ]

# number_variables(+Handle, +L, -Terms)

Create a list of terms for a search routine, numbering the variables

Handle
  a handle to an opaque data structure for the viualization
L
  a list of variables to be assigned
Terms
  a variable, will be unified to a list of terms

## Description

This predicate is used to number the variables before the search, so that the visualizer knows at each step which variable is currently assigned.

## Examples

    top(N,L):-
        length(L,N),
        L :: 1..N,
        alldifferent(L),
        create_visualization([],Handle),
        add_visualizer(Handle,vector(L),[]),
        number_variables(Handle,L,Terms),
        root(Handle),
        search(Terms,1,first_fail,
               tree_indomain(Handle,_),complete,[]),
        solution(Handle),
        close_visualization(Handle).

## See Also

number_variables / 4, name_variables / 4