A slot represents a relation among individuals, and is declared using :slot. The domain of an n-ary relation is the cross-product of n sets, which are specified in the second argument to the :slot form. The first argument is the name of the relation. By convention, the name P of a relation P(a,b) is chosen to fit the template, ``The P of a is b.''
The :cardinality keyword specifies how many distinct values can consistently be in a slot. For example, spouse can only have one value, but grandparent would have :cardinality 4. (Modern family structure is beyond the scope of this document.) The friend slot has no bound.
Binary relations of :cardinality 1 are functions, defining mapping from individuals in the first domain to individuals in the second domain. Functions support certain inferences that don't apply to more general relations.
The :backlink keyword declares an inverse relation, and a forward chaining rule from the current relation to its inverse. The :inverse keyword is similar, but creates backlink rules in both directions. The :comment keyword is purely for documentation.
(tell '((:slot spouse (people people) :cardinality 1 :backlink spouse :comment "(spouse a b) = The spouse of a is b.") (:slot wife (people people) :cardinality 1 :backlink spouse :comment "(wife a b) = The wife of a is b.") (:slot husband (people people) :cardinality 1 :inverse wife :comment "(husband a b) = The husband of a is b.") (:slot friend (people people) :comment "(friend a b) = A friend of a is b.")))
Unlike the above binary relations, age is a three place relation between a physical object, its age, and the time-unit the age is measured in. Since the age will be represented by a Lisp object (i.e., a number), the keyword :number indicates that the second argument is represented by an object belonging to the Lisp datatype number, rather than by an Algernon frame.
(tell '((:slot age (physical-objects :number time-units) :cardinality 1)))