Previous topic  Top  Next topic  Print this Topic
 

Predicates

 

In ObjectLogic, predicates are used in the same way as in predicate logic, e.g. in Datalog. Thus, preserving upward-compatibility from Datalog to ObjectLogic. A predicate symbol followed by one or more terms separated by commas and included in parentheses is called a P-atom to distinguish it from F-atoms. The example below shows some P-atoms. The last P-atom consists solely of a 0-ary predicate symbol. These are always used without parentheses.

owner(car74, paul).

adult(paul).

true.

Information expressed by P-atoms can usually also be represented by F-atoms, thus obtaining a more natural style of modeling. For example, the information given in the first two P-atoms could also be expressed in the following way:

car74[owner->paul].

paul:adult.

Note that the expressions in the two examples above are alternative but disjoint representations. They cannot be used in a mixed manner, i.e. a query for owner(X,Y) does not retrieve any results for facts represented in the object-oriented way with F-Atoms.