Tuesday, August 5, 2008

Rule

Real Rule of the Week: Defining a Subconcept

In our first of a series of real rule examples we consider the case where a subconcept is defined by means of a derivation rule with the help of a condition on the properties of the superconcept.

vocabularyThe rule states: A woman is a female whose age is greater than 21. The underlying vocabulary of this rule, depicted in the diagram to the left, includes the concepts person, female and woman, where woman is a subconcept of female, which is in turn a subconcept of person, and the person properties name and age.

ruleThe defined concept, woman, is in the conclusion of the rule, while the condition consists of two parts: a classification of something as a female and an attached requirement that the age of that female must be greater than 21. This gives us a rule with a classification conclusion for infering that x is a woman, and with a classification condition, requiring that x is a female, and an inequality condition, requiring that the age of x is greater than 21. The rule can be visualized as shown in the diagram to the right. The circle epresents the rule, its label DR stands for derivation rule. Incoming arrows attached to a rule circle represent conditions, and the outgoing arrow represents the conclusion.

If you wonder, what kind of visual representation I'm using here, it's the UML-based visual rule language URML developed in the REWERSE research project Rule Modeling and Markup.

The UML comes with a formal languge for expressing integrity rules and derivation rules, called OCL. Unfortunately, OCLi supports only derivation rules for defining properties, but not for defining (sub-)classes. We'll use it in some of our next real rule of the week posts.

In the predicate logic syntax of the logic programming language Prolog, this rule would be formalized as

woman(X) :- female(X), age(X,Y), Y > 21.

It would be nice to collect further formalizations in other rule languages. Can you add your favorite one?

No comments: