22.3 Function that Modify Boolean Lists

  • UniteBlist( blist1, blist2 ) F

    UniteBlist unites the boolean list blist1 with the boolean list blist2, which must have the same length. This is equivalent to assigning blist1[i] := blist1[i] or blist2[i] for all i. UniteBlist returns nothing, it is only called to change blist1.

    gap> blist1 := [ true, true, false, false ];;
    gap> blist2 := [ true, false, true, false ];;
    gap> UniteBlist( blist1, blist2 );
    gap> blist1;
    [ true, true, true, false ] 
    

    The function UnionBlist (see UnionBlist) is the nondestructive counterpart to the procedure UniteBlist.

  • IntersectBlist( blist1, blist2 ) F

    intersects the boolean list blist1 with the boolean list blist2, which must have the same length. This is equivalent to assigning blist1[i]:= blist1[i] and blist2[i] for all i. IntersectBlist returns nothing, it is only called to change blist1.

    gap> blist1 := [ true, true, false, false ];;
    gap> blist2 := [ true, false, true, false ];;
    gap> IntersectBlist( blist1, blist2 );
    gap> blist1;
    [ true, false, false, false ] 
    

    The function IntersectionBlist (see IntersectionBlist) is the nondestructive counterpart to the procedure IntersectBlist.

  • SubtractBlist( blist1, blist2 ) F

    subtracts the boolean list blist2 from the boolean list blist1, which must have equal length. This is equivalent to assigning blist1[i] := blist1[i] and not blist2[i] for all i. SubtractBlist returns nothing, it is only called to change blist1.

    gap> blist1 := [ true, true, false, false ];;
    gap> blist2 := [ true, false, true, false ];;
    gap> SubtractBlist( blist1, blist2 );
    gap> blist1;
    [ false, true, false, false ] 
    

    The function DifferenceBlist (see DifferenceBlist) is the nondestructive counterpart to the procedure SubtractBlist.

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

    GAP 4 manual
    February 2000