The PAL Language offers a way to express constraint statements in a logical way. A PAL statement is composed of a set of embedded predicate and functional expressions that involve variables ranging over a set of values (range definitions), and that ultimately return true or false on each particular instanciation of variables. The Statement editor of the The PAL Expression Editor allows you to create statements in an interactive way. Based on user selections, the Statement editor creates skeletal statements involving predicates, variables, and functions. The user then fills the arguments in step-by-step.
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 Statement editor offers the following functionality:
When the Statement window first opens for a new constraint or query, the window contains the string (Predicate).
You should always begin a constraint statement as follows:
Note: A new query should start with findall or find n. Due to a known bug, the Statement editor does not currently support the selection of findall and find n predicates. You can edit existing query statements, or enter findall or find n manually.
The placeholder arguments supplied by the Statement editor are italicized. Everything in italics needs to be replaced before the statement is complete. Double-clicking on a replaceable string displays a selection window. You can click on any of the following to replace it:
Any, Class, Facet, Frame, Function, Instance, Integer, Number, Predicate, Slot, and Symbol.
Note: Even after one of these terms has been replaced with a specific instance, it is possible to edit it later by double-clicking. For example, when Predicate has been replaced with forall, double-clicking on forall will open the Predicate selection window.
Note: In the Statement editor, the term Symbol does not denote a symbol in the sense of a Protégé value type. Instead, it means a symbol in the logical language, i.e., an atomic value.
The dialogs you get by clicking on a replaceable string are of three types:
Select Type Dialog
Type-specific Dialogs
Integer, Number, or Symbol Dialogs
Double-clicking on Any displays a window that allows you to choose the type of term you want.
Selecting :ANY does not do anything; it merely keeps the window open. Selecting any other type displays the selection window for that type.
All other term types, including Class, Facet, Frame, Function, Instance, Predicate, and Slot, have at least three areas. These areas appear, for example, in the dialog for Predicate shown here:
The Integer, Number, and Symbol windows have an additional entry bar at the top of the window.
The Editing Buttons offer the following functionality:
Check Syntax: Verifies the syntax of the current statement. Validation errors are shown in the pane at the bottom of the Statement window. These errors are similar to those shown when verifying constraints at the Constraints tab. | |
Format: Formats the statement indentation. | |
Add Parentheses: Adds parentheses around the highlighted text. | |
Remove Parentheses: Removes parentheses around the highlighted text. For this button to work, the highlight must begin and end on the beginning and end of a correct pair of parentheses. | |
Cut: Removes the highlighted text and copies it to the clipboard. | |
Copy: Copies the highlighted text to the clipboard. | |
Paste: Inserts the contents of the clipboard at the cursor. | |
Delete: Deletes the highlighted text. |
The PAL Expression Editor/The Statement Editor
Next: Creating a Sample Constraint