The basic execution unit for a program running under Grace is a (normal) labelling step . The predicate grace_label/0 is roughly defined as
grace_label :- registered_variables(Vars), label(Vars). label([]). label(Vars) :- select_variable(Vars, Var), handle_user_input, select_value(Var, Vars, RestVars), label(RestVars).
One step is the execution between two consecutive calls of the predicate handle_user_input/0 above, it consists of a successful labelling of a variable and successful selection of the next one to label. Note that if no value can be found for the selected variable, the labelling predicate backtracks to the last variable and tries to find a new value for it. This process is repeated until a value is found for one of the previously selected variables.
Grace first performs an automated selection of the next labelled variable, then it stops and gives the control to the user. In this way, the user can see the variable selected by Grace and either accept it or override by a manual selection.