The PAL
Range Editor
The Range editor of the PAL Expression Editor
allows you to declare and set the range for each variable in your constraint.
The PAL Language offers several ways of defining
the range of a variable; these are supported by the Range editor. Declared
variables are made available in the pop-up menus
for the Statement editor.
Note: The first time you use the PAL Expression Editor in your project, you may need to make sure that
the PAL Expression Editor is set up on your constraints. See Configuring the PAL Expression Editor
for more information.
The Range editor offers the following functionality:
- A right-click range menu (Command-click on the
Macintosh) allows you to choose a range type and have the editor generate a
skeleton declaration.
- Double-clicking on the placeholder strings or
arguments supplied by the editor (e.g.,
varName and frameName) opens a window that allows you to define or choose
the name of those arguments.
Range Menu
The Range menu lets you select the type of range you want for your
variable.
Choosing a range type generates the syntax for a range definition, using
placeholder names for the arguments of the range defintion. The placeholder names can be replaced by double-clicking and
entering a real name, as described below.
For set definition (defset), the functionality is currently unimplemented.
The editor will generate the syntax, but it cannot actually be used.
For range definitions (defrange), the range editor generates the following syntax:
- SET is currently unimplemented. Syntax will be generated that cannot
actually be used.
- For FRAME|Without Slot:
(defrange varName :FRAME frameName)
This declares a variable (the replacement for varName) with
values all instances in a class (the replacement for frameName).
- For FRAME|With Slot, the syntax is
(defrange varName :FRAME frameName slotName)
This declares a variable (the replacement for varName) with
values those instances in a class (the replacement for frameName)
which appear as values for a slot (the replacement for slotName).
- For the INTEGER, STRING, SYMBOL, and NUMBER types, the syntax given
defines a variable of the chosen type which is restricted to values of a
specified slot. However, the current implementation actually adds an
extraneous dummy variable, which should be deleted. For example, choosing
SYMBOL gives the syntax:
(defrange varName :SYMBOL symbolName slotName)
In this syntax, symbolName is extraneous.
For example, choosing defrange|FRAME|Without Slot
generates the text:
(defrange varName :FRAME frameName)
where varName and frameName are argument placeholders supplied by the Range editor.
For a list of range types, see Variable Range Definitions.
Double-clicking on a Variable
Double-clicking on a string that has been inserted by the Range editor brings
up the entry method appropriate to the string.
- Double-clicking on a generated variable varName displays the Symbol
entry box. Type the variable name in the entry bar or select from the list
of available symbols. Remember to prepend ? to the variable name for a local
variable and % for global variables. Then click OK.
- Double-clicking on the extraneous variables integerName, stringName,
symbolName, and numberName also displays the Symbol entry box.
- Double-clicking on frameName opens the Select Class dialog
box. Select the class where you want the variable to take its values and
click OK. If you choose a class whose name contains a space, you must
enclose the name in single quotes after selecting it. For example, my
class must be written as 'my class'.
- Double-clicking on slotName opens the Select Slot dialog box. Only
those slots of value type Class that have the selected class as an allowed class are displayed.
(If there are no such slots, a warning dialog is displayed instead.) Select the slot to which you want to restrict the variable and click OK.
If you choose a slot whose name contains a space, you must enclose the name
in single quotes. For example, my slot must be written as 'my
slot'.
The PAL Expression Editor/The Range Editor
Next: The Statement Editor
PAL Table of Contents