Next: Keyboard Accelerators
Up: Variable Matrix
Previous: Variable Matrix
Each column label has an identical menu which concerns the whole
matrix, not only the column:
The menu items have the following meaning:
- Label - when grace_label/0
or grace_minimize/1
is called and this item
is on, Grace will label this matrix. Otherwise the matrix will
not be modified and Grace assumes that these variables do not have
to be instantiated to find a solution.\
This is useful e.g. when the program contains auxiliary variables
which should be displayed, but not labelled directly.
It mirrors the label
option.
- Lookahead matrix - whenever a variable from this matrix
is going to be labelled, lookahead is applied to the whole matrix,
similar to pressing the LOOKAHEAD button.
It mirrors the lookahead
option.
- Lookahead selected - whenever a variable from this
matrix is selected for labelling, a lookahead is applied to this variable
before it obtains a label.
This has no effect on the search itself, because inconsistent
values are removed from the domain during labelling anyway.
The difference is that with lookahead they are removed immediately
and the real search space size is displayed more precisely.
It mirrors the lookahead_var
option.
- Font size - a cascade menu
for the size of the font used to display the
matrix.
It also directly affects the matrix size.
The items in this menu are set by the option font_sizes
and selected by the option font_size
.
When the right mouse button is pressed on a variable field,
the elements window
is displayed which shows the whole variable domain
and its size.
This is useful when the domain text is too long to fit
into the variable field:
The Value field is used when the variable is interactively modified:
while holding down the right mouse button, the user can type a value
on the keyboard, which is displayed in the Value
field:
When the right mouse button is released, Grace tries to bind
the variable to this value.
If it succeeds, this is interpreted as a new manual labelling
step and the variable is instantiated:
On backtracking,
this value will be removed from the variable domain,
i.e. a binary choice point is created:
If the binding fails although the value is present in the variable
domain, this value is simply removed from its domain without treating this
as a new labelling step, because this modification is deterministic.
If the value does not occur in the variable domain, nothing happens.
The left mouse button pressed over a variable field displays
a menu:
The menu items have the following meaning:
- Select - select this variable for the next labelling step.
- Select and step - select this variable and execute one
labelling step.
- Make choice - modify this variable manually.
When this item is selected, a window is displayed which allows
to type in any domain and to specify whether the variable
has to be inside or outside this domain:
The window displays the current variable domain and its size.
The user can type into the field New value a value
or a domain in the Prolog format,
e.g. 2, 6, 14 or 6..8, 14.
Pressing the = button or typing a newline will
label the concerned variable with the entered domain.
On backtracking, the selected values will be removed from the domain
and the variable will thus be constrained to be outside this domain.
Pressing the # button will reverse the two alternatives - first
the variable will be constrained to be
outside this domain and on backtracking inside it.
Pressing Cancel will abort the modification.
- Lookahead - apply lookahead to the variable, i.e. remove all
values in its domain which cause a failure when they
are used to instantiate the variable.
- Constraint list - the constraints window
is displayed which contains all constraints
(i.e. suspensions) in which this variable occurs:
The window is a Tk listbox, it can be scrolled by dragging the
middle mouse button.
While this window is displayed, Grace does not accept
any other user actions (except listing constraints
of other variables),
the user has to press the Quit button or type
'q' to continue with the program
(in next Grace versions, this window
will be used to select expressions to display).
- Breakpoints - the three items below allow to set and remove
breakpoints on a given variable.
When stop when modified is selected,
a deamon is attached to the variable which causes
the program to stop when it executes in run mode
and when the domain of this variable is modified.
Stop when ground causes the program to stop
as soon as the variable is instantiated.
The fields of variables with a breakpoint are displayed
in a different colour.
When a variable breakpoint is hit,
the execution stops and a message about
the variable being modified is displayed in the status line.
NOTE: The breakpoints are set in a pure Prolog way,
which means that on backtracking they disappear.
Similarly, when a breakpoint is removed manually,
it will reappear when the program backtracks past this point.
Next: Keyboard Accelerators
Up: Variable Matrix
Previous: Variable Matrix
Micha Meier
Tue Jul 2 10:07:34 MET DST 1996