Search                        Top                                  Index
HELP AREIN                                          A. Sloman July 1982

    <list_of_patterns> arein <list > -> <boolean>

AREIN is an infix operator which takes a list of patterns and a list and
returns TRUE or FALSE. The result is true if all patterns in the first list
match items in the second list, with the same bindings of the variables.
As a side effect the elements of the list which matched are put in a list and
assigned to the global variable THEM. For example:

vars x y z;
    [[?x isa ?y] [colour ?x ?z]]
           [[colour a red] [colour b blue] [a isa block] [b isa block]] =>
    ** <true>

    ** a

    ** block

    z =>
    ** red

    them =>
    ** [[a isa block] [colour a red]]

See also HELP
    *ISIN         - matches a single pattern against list elements
    *MATCHESALLOF - matches a list against a list of patterns
    *DATABASE     - on use of the POP-11 DATABASE
    *ALLPRESENT   - finds instances of a pattern in the DATABASE
    *FOREVERY     - selective iteration over a database
    *MATCHES      - summary of the POP-11 matcher