Language Reference/Terms/in

: in

The in operator is used to test for member ship of a collection (e.g. a list) and to nondeterministically generate the members of a collection.

The in operator can be defined for any domain and interface using the in_test and in_iterate attributes.

The in_test attribute defines the predicate that is used as in-test for a certain domain or interface. Likewise the in_iterate attribute defines the predicate that is used as in-ieratorfor the domain/interface.

For a domain the predicate must have the type:

predicates : ( Elem, Collection) determ.

For a domain   the in_test</vp> and in_iterate</vp> predicate must fulfill these schematic declarations:

domains = ... [in_test(<in_test>), in_iterate(<in_iterate>)]. class predicates <in_test> : (<some-type> Elem, Collection) determ. <in_iterate : ( Collection) -> <some-type> Elem nondeterm.

For an interface  </vp> the in_test</vp> and in_iterate</vp> predicate must fulfill these schematic declarations:

interface [in_test(<in_test>), in_iterate(<in_iterate>)] predicates <in_test> : (<some-type> Elem) determ. <in_iterate : -> <some-type> Elem nondeterm. ... end interface

The in</vp> operator is predefined on list domains, and in PFC the collections have suitable attributes.