next up previous
Next: Fact Functions Up: Facts Previous: Facts

Types of facts


The type is the only attribute that is mandatory in a fact declaration. It determines the set of values a fact can take. For instance the fact dead would be a boolean predicate (it is false or true); and the facts temperature and voltage should be of numeric type.

Figure 4: Syntax of type definition.

A fact is valuated over the set of values determined by its type plus the special value unknown, meaning ignorance of the value. There are four basic predefined types, namely boolean, many-valued, numeric and class; and a parametric user-defined type named fuzzy. Moreover, programmers can declare two anonymous types by enumerating the values that the fact can receive, namely set and linguistic. Next there is a summary of the meaning of Milord II fact types:

Boolean Facts
These are facts whose value can be either Yes (true) or No (false).

Numeric Facts
The value of a fact of this type is a real number. They are used to represent quantitative data, for instance concepts like temperature, number of leucocytes, etc.

Many-valued Facts
The concepts represented as facts with many-valued type are those whose truthness is graded. For instance if we use a subjective criteria to appreciate if a patient has fever by touching him with the hand, we can consider that the fact fever is a many-valued fact (we can say that fever is possible). In this case that fact is declared as

fever = Type: many-valued

The type many-valued is parametric with respect to a set of linguistic terms, representing truth values, defined by the programmer. This set of terms must be defined in the inference system declaration (see Section 4). The value of facts of this type will be an interval over the so defined ordered set of linguistic terms.

Class Facts
This type is a bit special. The set of values of this type is empty. Hence, facts of this type will be valueless facts. As a direct consequence of this, facts of this type cannot appear in premises or conclusions of rules. They can be used in the structuring of knowledge as relations between facts. These relations may appear in premises of meta-rules. So, for instance, we can declare the fact oral as a class fact. Then, we can define relations between the antibiotics that are administrated orally and the fact oral. Finally, we could define a meta-rule to be applied to all antibiotics administrated orally by using the previously defined relation in the meta-rule's premise.

Fuzzy Facts
Vagueness of concepts as fever can be interpreted as the degree of membership of a numeric measure (in this case temperature) to a fuzzy set.

The values of facts with an associated fuzzy set are still intervals of linguistic terms. The way of computing the interval will be done, in this case, by the application of the fuzzy membership function to the numerical value of the fact that must appear in a relation named needs_quantitative.

Figure 5: Fuzzy set representing the concept fever.

We can see an example of fact declaration of the concept fever (see Figure 5). This concept is declared by giving the four points of the trapezoidal approximation of its membership function.

fever = Type: fuzzy (37,38,43,43) 
        Relation: needs_quantitative temperature

Attributes of relations will be explained in Section 3.1.4.

Set Facts

Facts of this type get values from a user-defined finite set of symbolic values. This set is defined by enumerating its elements. For instance, the fact treatment gets values from a set of antibiotics ( etambutol, aciclovir and ganciclovir). This set is, moreover, the anonymous type of the fact treatment.

treatment = Type: (etambutol, aciclovir, ganciclovir)

The value of the fact treatment will be a mapping from the elements of its type to intervals of linguistic terms representing the degree of membership of every antibiotic to the fact treatment (v.g. tex2html_wrap_inline6287 ).

Linguistic Facts
We can declare a linguistic fact by giving a user-defined set of linguistic values and giving for every linguistic value a trapezoidal approximation of a fuzzy set with respect to a numeric fact. In Figure 6 we can see a new representation of the fact fever by means of three fuzzy sets, that is, low, medium and high.

Figure 6: Fuzzy sets representing the concept fever.

The declaration of this new interpretation of the fever concept can be:

fever = Type: (l "low"    (37,37.3,37.6,38),
               m "medium" (37.6,38,38.5,39),
               h "high"   (38.5,39,43,43))
        Relation: needs_quantitative temperature

Notice that, as in the case of fuzzy facts, it is necessary to declare the same relation needs_quantitative with a numeric fact, in this case again temperature. The optional string in the elements of the type (e.g. low) is used only for informational purposes.

next up previous
Next: Fact Functions Up: Facts Previous: Facts

Josep Puyol-Gruart
Thu Oct 23 15:34:13 MET DST 1997