|
|||||||||||||||
First of all - where do facts and rules come from? Facts and rules come from a knowledge engineer (KE for short), who either is an expert in the area of interest, or has access to such an expert. The KE formulates the knowledge so that Pro/3 can make use of it, and make use of it in a way that makes the system produce something useful. This means that he or she also needs to know Pro/3 - its knowledge representation concepts, its inference methods and the practical facilities included in the system. | |||||||||||||||
What is a fact? |
|||||||||||||||
A fact in Pro/3 is called a
sentence,
and consistent with that, a fact can be expressed as a natural language
sentence. Two types of natural language sentences correspond to Pro/3
facts. These are (i) sentences with a subject and a predicate and (ii)
sentences with a subject, an object and a predicate.
Facts are either asserted (entered) by the KE, or concluded (derived) from other facts by rules (sentence rules). |
|||||||||||||||
|
|||||||||||||||
An essential aspect of a fact is that it does not contain variables. | |||||||||||||||
|
|||||||||||||||
Subject and objects are called
entities in Pro/3. An entity belongs to an entity type. Entity
types in the above examples are exchange rate, bike, manufacturer and
retail price.
Entity types consist of a fixed number of one or more data element
types. bike and manufacturer have one data element type (model
and respectively), exchange rate and retail price
have two (currency and per US$ rate; price and currency).
Data elements are actual values of
data element types (GBP, 0.56, "RSV Mille R" etc).
Note that the set of data element types for an entity type always it is the same, e.g. a retail price-entity will always have a price and currency whenever it occurs in a sentence in Pro/3 (e.g. the sentence the retail price with price 6,500 and currency GBP is published for the bike with model "M900 Monster Dark" with year 2001 is invalid since the currency data element is missing from retail price). |
|||||||||||||||
|
|||||||||||||||
Data element types are open sets of values (data elements) belonging to certain subsets of values such as strings, integers, numbers, dates and many other. The price data element type is an integer, model is a string (note the quotes), while name is an identifier (no quotes). Note that the same data element type can be used in different entity types (in the examples, currency is used both in the exchange rate and retail price entity types). | |||||||||||||||
|
|||||||||||||||
Predicate types are either unary
or binary. Unary predicate types can only be used in subject-predicate
sentences, while binary can be used only in subject-predicate-object
sentences. The makes and is published for predicate types in
the examples are binary, while is current and has UK
specifications
are unary. Note that a predicate type always is unary or always is binary. It
cannot be unary in one sentence and binary in another.
Like entity types, predicate types can also have data element types. The is published for predicate type has one data element type (year), while the has UK specifications predicate type has eight! The makes and is current predicate types do not have any data element types. Note that when the predicate type does have data element types, then they are always used (similar to entity types). |
|||||||||||||||
It will be seen from the examples
that sentences can be modeled in various ways. They can be unary or binary,
they may use predicate types with or without data element types, and can
use entity types with a single data element type or with many.
The process
of defining data element types, entity types and predicate types is called
sentence modeling in Pro/3.
It is important to come up with a good model - to achieve an intuitive natural language interface among other things. However, variations in the style of sentence modeling do usually not constrain the formulation of rules. |
|||||||||||||||
The ordered set (combination) of entity types and
predicate type (in a sentence) is referred as the sentence's sentence type.
The sentence types in the examples are exchange rate is current, bike
has UK specifications, manufacturer makes bike and retail price is
published for bike. Sentence types play an important role in
organizing sentences, and is a key concept in sentence rules.
A sentence group is practically the same as the sentence's predicate type, i.e. all sentences (sentence types) with the same predicate type. |
|||||||||||||||
The natural language style representation of facts shown in the examples above are not practical inside the knowledge base. A format more suited for processing by an inference engine is required. The internal format is the same as used in PROLOG-language facts: | |||||||||||||||
|
|||||||||||||||
The entity types in a sentence correspond to the functor-concept in PROLOG. | |||||||||||||||
The names used for predicate types
and entity types in natural language are generally not acceptable in the
internal PROLOG format exchange rate, for example, consists of two
words which is not allowed for an identifier in PROLOG syntax. Pro/3, on
the other hand, does not impose much constraints on names.
The expressiveness at the natural language level is resolved by requiring each natural language name to have a corresponding internal name. This two-level naming structure has the additional advantage that Pro/3 models can have multiple natural language interfaces e.g. one English language interface and one Danish. It also allows for use of natural language synonyms. Note the difference in the internal representation of names (identifiers) and strings: Kawasaki and 4-stroke are represented internally as (iKawasaki and i4Stroke) while "Ninja ZX-7R" has the same representation externally and internally. |
|||||||||||||||
The importance of understanding the structure of facts! |
|||||||||||||||
The importance of understanding the structure of facts in Pro/3 cannot be overstated. A lot of things revolve around the fact concept. Rules (sentence-rules to be specific), describe how facts are derived from other facts. Without a clear understanding of facts, you cannot understand these rules. The answer to queries (questions) are in most cases one or more sentences, and the structure of the query itself is based on the sentence structure. |