This is the most technical part of the tutorial . In this section we shall demonstrate the use of constrain and graphic extensions for extending GFL with new operators. Such new operators may for example emulate some operators of DAML+OIl ontology language. It is worth to note however, the systematic conversion of DAML+OIL ontologies to any logic programming framework is a complex problem , that will probably bring forth a number of papers in the future. At present the only paper that deals with this problem is working paper by B. Grosof and I Horrocks .
Intersection is the least difficult operator to deal with. It allows exact translation from set theoretical to Logic programming semantic. There are possibly different ways of defining the intersection of concepts. Consider our previous example- ecomodeler which is Intersection of ecologist and modeler.
This statement is equivalent to the set of 3 rules:
X:ecomodeler:- X:ecologist, X:modeler.
X:modeler:- X:ecomodeler.
X:ecologist:-X:ecomodeler.
Note we can use the same variable X in all the three rules. It is because in logic programming variable name has meaning only inside the rule. Alternatively it can be translated into one fact and 3 generic rules.
intersection(ecomodeler, ecologist, modeler).
X:Int:-intersection(Int, C1, C2), X:C1, X:C2.
X:C1:-intersection(Int, C1, _),X:Int.
X:C1:-intersection(Int, _, C1),X:Int.
We will use the first set of rules to define intersection operator. Here is how definition looks.

The green arrows suggest that variable symbols in meaning part of the diagram should exactly correspond to the names in operator part .Note, only variable X in the diagram is a real logical variable. The symbols C1, C2, Cinter denote arbitrary classes. But they are not logical variables (so we do not use question mark after their name. The definition of the operator Intersection suggest that each occurrence of such operator should be accompanied by insertion of 3 rules into the database. During this insertion variables C1, C2, Cinter substituted by the respective concepts from left hand side of the diagram. Variable X is logical variable and is inserted as is. We can frealy use the same variable X in all the three rules , or we can use other names. IIn F-Logic variable name is local for the rule.
Operation Union is more difficult one since it does not allow exact translation from set theoretical to logic programming framework However we can emulate set theoretical semantic using negation as failure and integrity constrains. (although it will not always work precisely as a set theoretical union). Again there are different ways of defining Union. For example the following set of rules suggest that the concept commodity is a union of concepts good and service .
X:comodity:-X:good; X:service.
wu('the result is larger then union of the operands' , comodity, good, service):ic:- X:comodity, tnot (X:good; X:service)
Alternatively the same logical construction may be defined as follows.
union(comodity, good, service). %ensure different variables names
X:ConceptU:-union(U,Concept1,C2), (X:Concept1;X:C2).
wu('the result is larger then union of the operands' , U, Concept1, Concept2):ic:- union(ConceptU,Concept1,Concept2), X:ConceptU, tnot (X:Concept1; X:Concept2)
Now we will use the first set of rules to define the symbol Union

The definition of Disjoint Union of many variables is far more complex task. For example the assertion that concept organism is a disjoint union of concepts animalia, plantae ,fungi, protista ,monera may be expressed as the following set of rules:
organism:dunion[members->>{animalia ,plantae, fungi, protista, monera}].
X:DU:-DU:dunion[members->>C], X:C.
wu('the result is larger then union of the operands' , DU):ic:- DU:dunion, X:DU, not (DU[member->C], X:C).
wd('union is not disjoint', C1, C2):ic:-X:dunion[members->>C1], X[members->>C2], Y:C1, Y:C2.
We shall live it as an exercise to draw the graphic definition of DUnion operator.
We can use external symbols to enrich our graphic formalism. For example we may introduce symbol near the attribute name which will indicate that the attribute is transitive. We can use label inv near attributes to identify the inverse attribute
C 2003 S. Krivov Send your comments to skrivov@zoo.uvm.edu