XEROX LSET 2 4 1 LSET 1 4 By: Kelly Roach (Roach.pa@Xerox.com) List SETs LSET contains functions for operating on sets and bags implemented as lists. Set operations like LUNION comes in several flavors. LUNION [Operation] takes multiple arguments and uses EQUAL LUNION2 [Operation] takes 2 arguments and uses EQUAL LUNIONQ [Operation] takes multiple arguments and uses EQ LUNIONQ2 [Operation] takes 2 arguments and uses EQ Set operations, which do tests with EQUAL, assume that the args that are passed to them are in LSETIFY form-- that is, there are no EQUAL duplicates within any arg. Set operations, which do tests with EQ, assume that the args that are passed to them are in LSETIFYQ form--there are no EQ duplicates within any arg. It isn't necessary that the user call LSETIFY or LSETIFYQ, if the user can guarantee that the args to LUNION, etc. do not have EQUAL or EQ duplicates respectively. Basic set operations: UNION: LUNION, LUNIONQ, LUNION2, LUNIONQ2 INTERSECT: LINTERSECT, LINTERSECTQ, LINTERSECT2, LINTERSECTQ2 SUBTRACT: LSUBTRACT, LSUBTRACTQ, LSUBTRACT2, LSUBTRACTQ2 Miscellaneous useful set functions: (LUNIFY E L) Returns LUNION of L and (LIST E). (LUNIFYQ E L) Returns LUNIONQ of L and (LIST E). (LDELETE E L) Returns LSUBTRACT of L and (LIST E). (LDELETEQ E L) Returns LSUBTRACTQ of L and (LIST E). (LSETIFY L) Returns L with all EQUAL duplicates deleted. (LSETIFYQ L) Returns L with all EQ duplicates deleted. (LSETP L) Returns T if L is an EQUAL set. (LSETQP L) Returns T if L is an EQ set. (LSUBSET X Y) Returns T iff X is a subset of Y. (LSUBSETQ X Y) Similar to LSUBSET but uses EQ. (LEQUAL X Y) Returns T iff X equals Y. (LEQUALQ X Y) Returns T iff X equals Y using EQ. Bags (also known as multisets) are unordered lists similar to sets, but elements of bags may appear more than once inside the same bag. Thus, (X Y X A A) and (A X Y X A) represent the same bag containing 2 occurences of A, 2 occurences of X, and 1 occurence of Y. There are no BBAGIFY or BBAGIFYQ functions similar to LSETIFY and LSETIFYQ since all finite undotted lists are already bags. Basic bag operations: UNION: BUNION, BUNIONQ, BUNION2, BUNIONQ2 INTERSECT: BINTERSECT, BINTERSECTQ, BINTERSECT2, BINTERSECTQ2 SUBTRACT: BSUBTRACT, BSUBTRACTQ, BSUBTRACT2, BSUBTRACTQ2 Miscellaneous useful bag functions: (BUNIFY E L) Returns BUNION of L and (LIST E). (BUNIFYQ E L) Returns BUNIONQ of L and (LIST E). (BSUBBAG X Y) Returns T iff X is a subbag of Y. (BSUBBAGQ X Y) Similar to BSUBBAG but uses EQ. (BEQUAL X Y) Returns T iff X equals Y. (BEQUALQ X Y) Returns T iff X equals Y using EQ.(LIST ((PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC ) STARTINGPAGE# 1) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC )) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC )) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC )) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC )) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC )) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL)))))(È (È(ŠŠ8(ŠŠ8DÈÈ PAGEHEADING RUNNINGHEADMODERN MODERN MODERN MODERN MODERNLOGO HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN & M5(!%á°$B†¢$ Y@zº