Names 

NL-names  -  KB-names  - variable names

General topics: Pro/3 home page  -  documentation overview  -  What is Pro/3?

See also: syntaxes - NL syntax

The most fundamental syntax concept is the concept of names. Names are used in three different ways:

  • as name for elements in the knowledge base

  • as "atomic symbols" - a recognizable name not naming any particular element

  • as name for a variable

An element name uniquely identifies a knowledge element, of which there are seven classes:

  • domains

  • data element types

  • entity types

  • predicate types

  • functions

  • inexact rules

NL-names are used in the NL-format (natural language format). KB-names are used in PR-format or internal format. Variable names are used in all formats. NL-names are always associated with a KB-name, and vice versa, almost all KB-names are associated with one or more NL-names (the association can be one-to-many because of different syntactic forms in the NL-format and because of synonyms).

NL-names

There are few restrictions on NL-names which can consist of several words and also include digits and special characters such as hyphens, parenthesis etc. NL-names are case-sensitive. However, you are strongly recommended to observe the following restrictions:

  • Prohibited characters:  [ ] { } ? ! " | ' 

  • Avoid the characters: . , ' ; ~ `

  • Avoid the substring ::

  • Include at least one letter

  • Sentence model names must start with a lower case letter.

Examples:

  • the european union

  • The European Union (EU)

  • banking/insurance

  • corporation 123

USE GOOD NAMES!

Technically speaking there is no inherent knowledge associated with a name in Pro/3. This is radically different from knowledge communicated in true natural language - natural language is intimately intertwined with knowledge and reasoning. For this reason, it is important to use names in Pro/3 which are as intuitive as possible.

It is usually easy to find good intuitive names for data element types and entity types. These objects usually correspond to nouns.  

Predicate types

Predicate types, which typically correspond to verbs, are harder to name with consistent style. Textbook cases would be generic names such as "exists", "is known" and "has". It is usually a good idea to use a wider variety, however no specific guidelines can easily be given.

It is important to note that knowledge in knowledge base is physically organized according to the predicate type (in sentences and sentence rule conclusions). Different predicate types are stored in different chains (see knowledge base internals for details). Of importance is also the restrictions against recursive rules, which could become a problems with a very limited set of predicate types (see recursive rules).

Inexact rules

Inexact rule naming should not impose much problems, although it is of course often difficult to find a name which is not too long  and at the same gives a reasonably good idea of what the rule stands for. Inexact rule evaluation  is an important process in Pro/3 applications, and it is a good idea to use names which aid this process e.g. make names which are meaningful in the certainty rule reasoning drawings (name in red - formal parameter in green):

bike is fuel efficient with grade 0.35 (from 0.7) given model name "XRV750 Africa Twin"

Functions

Functions are generally easy to name. Names should have in mind the syntax for calling functions i.e. such that the function call spells out (as much as possible) the meaning of the function (name in red - formal parameter in green):

what = month name given month number 12?

KB-names

KB-names are single-word names built from letters, digits and underscores. KB-names are case-sensitive. The syntax is:

<lower_case_letter>+ { <letter> | <digit> | _ }*

Note the following restrictions:

  • All one-character KB names are reserved for Pro/3's meta model and system administration (see PRO3-E-LEX.3PR).

  • Double underscores (e.g. iCar__No) are not allowed.

  • The following classes of KB names are reserved for Pro/3: p3_ {<letter>|<digit>|_}*. Generally the following conventions are followed:

    • p3_p.. : predicate types

    • p3_e.. : entity types

    • p3_a.. : data element types

    • p3_r.. : procedures

    • p3_i.. : other identifiers

    • p3_h.. : inexact rules

    • p3_f.. : functions

    • p3_o.. : operators

    • p3_d.. : domains

Variable names

Variable-names are single-word names built from letters, digits and underscores. Variable-names are case-sensitive. The syntax is:

{ <upper_case_letter> | _ } { <letter> | <digit> | _ }*

The following variable names are reserved for Pro/3-generated variables: 

  • <entity_type_kb_name1>_<digit>+<data_element_kb_name> 

  • <function_kb_name1>__<data_element_kb_name>  

  • <certainty_rule_kb_name1>__<data_element_kb_name> 

1 The first letter is always in upper case.

Example

The amount data element type (KB name: dAmount) in the cash flow entity type (KB name: eCFlow) could occur as Pro/3-genefrated variable as:

ECFlow_11dAmt

Variables occur both in NL- and PR-formats. It will be seen from the above syntaxes that this can lead to ambiguities in the NL-format, i.e. variable-names can be confused with NL-names. This is in most cases resolved by the parsing and syntax analysis process, such that any word or sequence or word which can be parsed as a NL-name will be interpreted as such, as long as the syntax analysis in total succeeds. The word will otherwise be interpreted as a variable. To avoid potential problems in this area, it is recommended as much as possible to avoid NL-names starting with upper case letters. 

Example

Citibank is a valid variable name, but could also occur in the KB as a NL-name (e.g. representing the KB-name iCitibank). Pro/3 will always attempt the NL-name interpretation before the variable-name interpretation. One side-effect is that spelling mistakes lead to potential troubles. The KE could type the query which banks with name Citiibank exist? and get as answer all banks in the KB. Why? Because Citiibank only will be interpreted as a variable (there is no Citiibank NL-name), and thus making the query logical equivalent to which banks with name X exist? If the NL-name had been defined as citibank, then a corresponding spelling mistake which banks with name citiibank exist? would have lead to a syntax error and thus be detected.