Let's try to formulate one of the basic laws of Japan in Quixote:
"If the head of the family dies, half of his property goes to his wife, and the rest is shared between the children. The parents, or brothers and sisters of the deceased inherit nothing.
The first step in describing this law is to realize that the paragraph is a set of conditions and their results. The paragraph can be represented using a rule of the type "If condition A is satisfied, the result is B." The next step is to realize that there are the objects "head of family," "property," and concepts like "death."
These are all objects. If "inheritence," "death of head of family," "wife's existence," "children's existence," "property," and so on are chosen as objects, the law can be written as:
If "death of head of family" and "wife's existence" and "children's existence" and "property" is S, then wife inherits S/2, children inherit S/2 and parents, brothers, sisters inherit 0.
This shows how the law of inheritance can be described in an object based format.
Quixote contains rules characteristic of deductive databases (such as "If condition A is satisfied the result B is also satisfied" written as "B<=A) and object terms characteristic of object-oriented databases.
The previous paragraph can be represented in Quixote by:
inheritance/[wife=S/2, children=S/2, parents=0, brothers=0, sisters=0] <= death_of_head_of_family, wife's_existence, children's_existence, property/[Sum=S];;
Let's have a quick break :)
Here are some technical terms used in Quixote. The terms that represent objects like "death of head of family", "wife's existence," and so on are called Object Terms. Terms that represent objects and their characteristics, such as inheritance/[wife=S/2, children=S/2, brothers=0, sisters=0, parents=0], and property/[sum=S] are called Attribute Terms. An Object Term is regarded as a special kind of Attribute Term without the symbol / and everything to the right of it.
Human beings have the characteristics of the family mammals. To represent this, we do not need to include the characteristics of the family mammals for human objects; we can just let humans inherit this characteristic. Allowing families to inherit characteristics like this allows us to classify and organize those characteristics.
Written in Quixote the inheritance rule might look like this:
human_beings =< mammals mammals/[breathing=lung, temperature=homeotherm]
Quixote automatically assigns all the characteristics of mammals to human beings; they need not be defined again at the human level.
Anyone who had tried to represent the real world using a rule as the above property inheritance know that the real world has exceptions to the rule. Quixote can also incorporate exceptions to property inheritance.
For example, here is a structured object term:
apple[color=green]Note that a structured object term looks like an attribute. The difference is that the structured object term has no slash / .
This object term represents a green apple. Let's use this example to look at the concept of exceptions to the rule of property inheritance.
[color=green] represents the fact that the apple's color is green. This is an important point - a green apple should be green. If it is not green any more, it cannot be a green apple!
When apple[color=green] is written in Quixote, apple[color=green] =< apple is automatically made. This relation means that a green apple is a kind of apple and it inherits the characteristics of the parent apple.
When the attribute term apple/[shape=round, color=red] (apples are round and red) is written, Quixote automatically assigns shape=round to apple[color=green], but doesn't assign color=red to it.
In general, if there exist two different definitions for the same characteristic in an attribute term and a structured object term, the definition in the structured object term has the higher priority. In the example, color=green in the structured object term has higher priority than color=red in the attribute term.
This is the way that Quixote handles exceptions to the property inheritance rule.
Quixote uses modules in order to organize and classify rules. A set of rules are contained in a module with a unique module name.
The following Quixote statement lets module1 inherit all the rules of module2:
module1 >- module2
Then module1 is assumed to contain all the rules that are in module2.
Let's look at the legal example we discussed previously. The law of inheritance was represented by a rule. The module containing the set of rules governing inheritance can be given the name "Law_of_Inheritance."
In the same way, the whole of the civil law could be represented by a set of rules in a module called "Civil_Law."
The module "Civil_Law" can be made to inherit the rules of the module "Law_of_Inheritance" by writing
Civil_Law >- Law_of_InheritanceDefining sets of rules as modules and setting the inheritance of those rules between modules saves redefining the rules in subsequent modules.
a. Do not inherit b. OverwriteExceptions to the inheritance of rules are implemented by adding a symbol which specifies the type of inheritance for the target rule.
I have explained the integration of objects and rules and the two kinds of inheritance to demonstrate the way that Quixote has merged deductive databases and object-oriented databases.