22.2 Set Operations via Boolean Lists

  • UnionBlist( blist1, blist2[, ...] ) F
  • UnionBlist( list ) F

    In the first form UnionBlist returns the union of the boolean lists blist1, blist2, etc., which must have equal length. The union is a new boolean list such that union[i] = blist1[i] or blist2[i] or ...

    The second form takes the union of all blists in the list list.

  • IntersectionBlist( blist1, blist2[, ...] ) F
  • IntersectionBlist( list ) F

    In the first form IntersectionBlist returns the intersection of the boolean lists blist1, blist2, etc., which must have equal length. The intersection is a new boolean list such that inter[i] = blist1[i] and blist2[i] and ...

    In the second form list must be a list of boolean lists blist1, blist2, etc., which must have equal length, and IntersectionBlist returns the intersection of those boolean lists.

  • DifferenceBlist( blist1, blist2 ) F

    returns the asymmetric set difference (exclusive or) of the two boolean lists blist1 and blist2, which must have equal length. The asymmetric set difference is a new boolean list such that union[i] = blist1[i] and not blist2[i].

    gap> blist1 := [ true, true, false, false ];;
    gap> blist2 := [ true, false, true, false ];;
    gap> UnionBlist( blist1, blist2 );
    [ true, true, true, false ] 
    gap> IntersectionBlist( blist1, blist2 );
    [ true, false, false, false ] 
    gap> DifferenceBlist( blist1, blist2 );
    [ false, true, false, false ] 
    

    [Top] [Previous] [Up] [Next] [Index]

    GAP 4 manual
    February 2000