PURPOSE:

To enter/update/delete or look at a function (including its terminology, declaration and definition). 

Notes:

  • It is normally not recommended to enter or update functions through this window. Rather, write a function in a 3NL source file, and then store it in the KB through the File/Open and File/Process commands. Updates to the function can then be carried out by modifying and reloading the source file.
  • The upper combo control will  list all KE-defined functions (in any segment).
  • In case of multi-lingual models, note that the current terminology is used. You can change the current terminology with the Current Terminology-window.
  • Pro/3 keeps track of inter-dependencies between knowledge nodes (ref. knowledge integrity). Deletion and updating of a sentence model entities might require prior suspension or deletion of dependent entities. Pro/3 will remind you to do this.
  • Two flags might be prefixed to the function name in the upper combo control:
    • * (asterisk) signifies that the function definition/definitions are suspended (normally the definitions should be all suspended or all unsuspended - if there are definitions with different suspension-status then the function name will occur twice in the combo: one with the asterisk prefix and one without. It is recommended in this case to use the Record window to set the same suspension status for all function definitions).
    • + (plus) signifies that the function declaration sentence is missing - you should enter this e.g. through a Sentence-window or from a 3NL source file, before you attempt to select the function in the Function window.

ENTER NEW FUNCTION:

Type the function NL name in the upper combo control. You can also overtype the name of an existing function (if displayed). Type/select the following controls and finally press Save New.

  • Deterministic: Check whether or not the function is deterministic.
  • Domain: Select the domain of the function's return value.
  • KB name: Enter the KB name (unique).
  • Realm name: Enter a new or existing realm name.
  • Segment: Enter a new segment or select an existing segment.
  • Parameters:

Data element types are selected from the right-side listbox with the Add-button. If you need to enter a new data element type or look up an existing data element type, use the Look up data element-button. The Refresh-button is used to refresh the right-side listbox (i.e. include data element types just added).

The Remove-button removes the elected data element type from the left-side listbox. The Move Up and Move Down buttons change the sequence of the selected data element types. Note that this sequence is significant.

Function Definition:

The function definition (or definitions) is shown as list of text lines in the big listbox to the right. Each text line represents a statement (ended by ; or ! if is the last statement in a definition). New lines are entered in the edit field and inserted by using any of the three Insert-buttons. Lines can be removed with the Remove Line-button. Existing lines can be edited i.e. moved from the big listbox to the edit field with the Edit Line-button.

Press Save New to insert the function in the KB. Note that a function in this context consists of

  • one or two terminological sentences
  • one function declaration sentence
  • one or more function definitions (each corresponding to a record)

UPDATE FUNCTION:

Select a function from the upper combo control. You can change the contents of any non-protected control. Press Update-button to update the function. Notes:

  • You cannot change the NL name (i.e. the contents of the upper combo). Changing the NL name in the upper combo will be regarded as entering a new function.
  • References to the function in rules and functions might become invalid if the domain or parameter domain(s) are changed. This must be avoided. Delete all relevant references to the function before changing the domain or parameter domains.

DELETE FUNCTION:

Select a function from the upper combo control. Then press Delete-button. Note:

  • References to the function in rules and functions will become invalid if the function is deleted. This must be avoided. Delete all relevant references to the function before deleting the function itself.

LOOK AT FUNCTION:

Select a function from the upper combo control. Then select another function or close the window.

The XML/NL-button opens a text editor with the function in XML (NL) format. The XML/PR-button opens a text editor window with the function in XML (PR) format. All directly dependent knowledge nodes will be displayed if the Display dependents-button is pressed.