get-role-cardinality [Function]


Purpose

The get-role-cardinality function returns the number of fillers of a given role on a given concept or instance, providing that the maximum and minimum number of such fillers is the same.

Syntax

get-role-cardinality conceptOrInstance relation

Arguments

The conceptOrInstance argument is a Loom concept or instance.

The relation argument is the relation whose upper and lower bounds are to be compared.

Value

The get-role-min-cardinality function returns the minimum number retriction that applies to conceptOrInstance for relation, if that minimum is the same as the maximum. Otherwise, it returns nil.

Examples

(defconcept B 
    :is (:and (:all r A) (:exactly 3 r) (:filled-by r Joe Fred))) 
(defconcept C 
    :is-primitive B 
    :implies (:and (:some s A) (:at-most 2 s)) 
    :defaults (:filled-by s Sue)) 
(tellm (C Mary)) 
(get-role-cardinality (fc C) (fr r)) ==> 3 
(get-role-cardinality (fc C) (fr s)) ==> NIL 
(get-role-cardinality (fi Mary) (fr r)) ==> 3 
(get-role-cardinality (fi Mary) (fr s)) ==> NIL

See Also

Last modified: Jun 1 1995