1#@local a,b,c,g,l
2gap> START_TEST("set.tst");
3gap> a:=Set([(1,3,2),(4,5)]);;
4gap> b:=[(1,2),(5,9,7)];;
5gap> UniteSet(a,b);
6gap> a;
7[ (5,9,7), (4,5), (1,2), (1,3,2) ]
8gap> HasIsSSortedList(a);
9true
10gap> IsSSortedList(a);
11true
12gap> c:=Union(a,[(5,3,7),(1,2)]);
13[ (5,9,7), (4,5), (3,7,5), (1,2), (1,3,2) ]
14gap> HasIsSSortedList(c) and IsSSortedList(c);
15true
16gap> SubtractSet(c,[(1,2),(1,2,3)]);
17gap> c;
18[ (5,9,7), (4,5), (3,7,5), (1,3,2) ]
19gap> HasIsSSortedList(c) and IsSSortedList(c);
20true
21gap> AddSet(c,5);
22gap> c;
23[ 5, (5,9,7), (4,5), (3,7,5), (1,3,2) ]
24gap> HasIsSSortedList(c) and IsSSortedList(c);
25true
26gap> AddSet(a,(5,6));
27
28#gap> HasIsSSortedList(a) and IsSSortedList(a);
29#true
30gap> c:=Union(a,[(1,2),(1,2,3)]);
31[ (5,6), (5,9,7), (4,5), (1,2), (1,2,3), (1,3,2) ]
32gap> HasIsSSortedList(c) and IsSSortedList(c);
33true
34gap> g:=Group((3,11)(4,7)(6,8)(9,10),(1,3)(2,8,10,12)(4,5,6,7)(9,11));;
35gap> l:=AsSortedList(g);;
36gap> HasIsSSortedList(l) and IsSSortedList(l);
37true
38gap> c:=Difference(l,[(3,11)( 4, 7)( 6, 8)( 9,10)]);;
39gap> HasIsSSortedList(c) and IsSSortedList(c);
40true
41gap> Length(c);
427919
43gap> c:=Difference(l,a);;
44gap> c=l;
45true
46gap> [1..10000] = Set([1..10000], x -> x);
47true
48gap> [1..10000] = Set([-10000..-1], x -> -x);
49true
50gap> [0..2016] = Set([1..2017], x -> (x * 503) mod 2017);
51true
52gap> [0..2016] = Set([1..5000], x -> (x * 503) mod 2017);
53true
54gap> STOP_TEST( "set.tst", 1);
55