next up previous

12.2.4 Comparing Multifield Values

This function checks if one multifield value is a subset of another; i.e., if all the fields in the first multifield value are also in the second multifield value.

Syntax

(subsetp <multifield-expression> <multifield-expression>)

If the first argument is a subset of the second argument, the function returns TRUE; otherwise, it returns FALSE. The order of the fields is not considered. If the first argument is bound to a multifield of length zero, the subsetp function always returns TRUE.

Example

CLIPS> (subsetp (create$ hammer saw drill)
                (create$ hammer drill wrench pliers saw))
TRUE
CLIPS> (subsetp (create$ wrench crowbar)
                (create$ hammer drill wrench pliers saw))
FALSE
CLIPS>


next up previous