mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-15 17:33:38 +00:00
library/test_bitset.m:
Instead of comparing just one bitset module (tree_bitset by default)
against set_ordlist, compare all of them (tree_bitset, sparse_bitset,
and fat_sparse_bitset) against set_ordlist.
tests/hard_coded/test_bitsets.{m,exp}:
Rename this test case from test_tree_bitset to test_bitsets, since
(through library/test_bitset.m) we now test ALL bitset implementations,
not just tree_bitset.
tests/hard_coded/Mmakefile:
Refer to the test by its new name.
796 lines
12 KiB
Plaintext
796 lines
12 KiB
Plaintext
|
|
List1: 2, 7, 15, 19, 19, 22, 25, 28, 29, 31, 32, 34, 36, 38, 39, 40, 42, 44, 47, 58, 59, 59
|
|
List2: 2, 4, 4, 9, 11, 12, 13, 14, 17, 18, 21, 23, 23, 30, 31, 37, 37, 38, 39, 40, 42, 43, 44, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 56, 57, 58, 61, 61, 63, 64
|
|
|
|
testing count
|
|
count: 20 35
|
|
testing foldl
|
|
Sum of List1 = 647
|
|
Sum of List2 = 1305
|
|
testing union
|
|
[2, 4, 7, 9, 11, 12, 13, 14, 15, 17, 18, 19, 21, 22, 23, 25, 28, 29, 30, 31, 32, 34, 36, 37, 38, 39, 40, 42, 43, 44, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 61, 63, 64]
|
|
testing intersection
|
|
[2, 31, 38, 39, 40, 42, 44, 58]
|
|
testing difference
|
|
[7, 15, 19, 22, 25, 28, 29, 32, 34, 36, 47, 59]
|
|
testing remove_least
|
|
2
|
|
[7, 15, 19, 22, 25, 28, 29, 31, 32, 34, 36, 38, 39, 40, 42, 44, 47, 58, 59]
|
|
testing remove_leq 33
|
|
[34, 36, 38, 39, 40, 42, 44, 47, 58, 59]
|
|
testing remove_gt 33
|
|
[2, 7, 15, 19, 22, 25, 28, 29, 31, 32]
|
|
testing delete
|
|
[7, 15, 19, 22, 25, 28, 29, 32, 34, 36, 47, 59]
|
|
testing delete_list
|
|
[7, 15, 19, 22, 25, 28, 29, 32, 34, 36, 47, 59]
|
|
testing divide_by_set
|
|
[2, 31, 38, 39, 40, 42, 44, 58]
|
|
[4, 9, 11, 12, 13, 14, 17, 18, 21, 23, 30, 37, 43, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 61, 63, 64]
|
|
|
|
List1: 532, 32431
|
|
List2: 32794
|
|
|
|
testing count
|
|
count: 2 1
|
|
testing foldl
|
|
Sum of List1 = 32963
|
|
Sum of List2 = 32794
|
|
testing union
|
|
[532, 32431, 32794]
|
|
testing intersection
|
|
[]
|
|
testing difference
|
|
[532, 32431]
|
|
testing remove_least
|
|
532
|
|
[32431]
|
|
testing remove_leq 16481
|
|
[32431]
|
|
testing remove_gt 16481
|
|
[532]
|
|
testing delete
|
|
[532, 32431]
|
|
testing delete_list
|
|
[532, 32431]
|
|
testing divide_by_set
|
|
[]
|
|
[32794]
|
|
|
|
List1: 1064, 64862
|
|
List2: 65588
|
|
|
|
testing count
|
|
count: 2 1
|
|
testing foldl
|
|
Sum of List1 = 65926
|
|
Sum of List2 = 65588
|
|
testing union
|
|
[1064, 64862, 65588]
|
|
testing intersection
|
|
[]
|
|
testing difference
|
|
[1064, 64862]
|
|
testing remove_least
|
|
1064
|
|
[64862]
|
|
testing remove_leq 32963
|
|
[64862]
|
|
testing remove_gt 32963
|
|
[1064]
|
|
testing delete
|
|
[1064, 64862]
|
|
testing delete_list
|
|
[1064, 64862]
|
|
testing divide_by_set
|
|
[]
|
|
[65588]
|
|
|
|
List1: 1, 29424
|
|
List2: 1, 2, 3, 35701
|
|
|
|
testing count
|
|
count: 2 4
|
|
testing foldl
|
|
Sum of List1 = 29425
|
|
Sum of List2 = 35707
|
|
testing union
|
|
[1, 2, 3, 29424, 35701]
|
|
testing intersection
|
|
[1]
|
|
testing difference
|
|
[29424]
|
|
testing remove_least
|
|
1
|
|
[29424]
|
|
testing remove_leq 14712
|
|
[29424]
|
|
testing remove_gt 14712
|
|
[1]
|
|
testing delete
|
|
[29424]
|
|
testing delete_list
|
|
[29424]
|
|
testing divide_by_set
|
|
[1]
|
|
[2, 3, 35701]
|
|
|
|
List1: 2, 58848
|
|
List2: 2, 4, 6, 71402
|
|
|
|
testing count
|
|
count: 2 4
|
|
testing foldl
|
|
Sum of List1 = 58850
|
|
Sum of List2 = 71414
|
|
testing union
|
|
[2, 4, 6, 58848, 71402]
|
|
testing intersection
|
|
[2]
|
|
testing difference
|
|
[58848]
|
|
testing remove_least
|
|
2
|
|
[58848]
|
|
testing remove_leq 29425
|
|
[58848]
|
|
testing remove_gt 29425
|
|
[2]
|
|
testing delete
|
|
[58848]
|
|
testing delete_list
|
|
[58848]
|
|
testing divide_by_set
|
|
[2]
|
|
[4, 6, 71402]
|
|
|
|
List1: 1
|
|
List2: 2, 35701
|
|
|
|
testing count
|
|
count: 1 2
|
|
testing foldl
|
|
Sum of List1 = 1
|
|
Sum of List2 = 35703
|
|
testing union
|
|
[1, 2, 35701]
|
|
testing intersection
|
|
[]
|
|
testing difference
|
|
[1]
|
|
testing remove_least
|
|
1
|
|
[]
|
|
testing remove_leq 1
|
|
[]
|
|
testing remove_gt 1
|
|
[1]
|
|
testing delete
|
|
[1]
|
|
testing delete_list
|
|
[1]
|
|
testing divide_by_set
|
|
[]
|
|
[2, 35701]
|
|
|
|
List1: 2
|
|
List2: 4, 71402
|
|
|
|
testing count
|
|
count: 1 2
|
|
testing foldl
|
|
Sum of List1 = 2
|
|
Sum of List2 = 71406
|
|
testing union
|
|
[2, 4, 71402]
|
|
testing intersection
|
|
[]
|
|
testing difference
|
|
[2]
|
|
testing remove_least
|
|
2
|
|
[]
|
|
testing remove_leq 2
|
|
[]
|
|
testing remove_gt 2
|
|
[2]
|
|
testing delete
|
|
[2]
|
|
testing delete_list
|
|
[2]
|
|
testing divide_by_set
|
|
[]
|
|
[4, 71402]
|
|
|
|
List1: 101, 102
|
|
List2: 1, 2, 3, 35699, 35700, 35701
|
|
|
|
testing count
|
|
count: 2 6
|
|
testing foldl
|
|
Sum of List1 = 203
|
|
Sum of List2 = 107106
|
|
testing union
|
|
[1, 2, 3, 101, 102, 35699, 35700, 35701]
|
|
testing intersection
|
|
[]
|
|
testing difference
|
|
[101, 102]
|
|
testing remove_least
|
|
101
|
|
[102]
|
|
testing remove_leq 101
|
|
[102]
|
|
testing remove_gt 101
|
|
[101]
|
|
testing delete
|
|
[101, 102]
|
|
testing delete_list
|
|
[101, 102]
|
|
testing divide_by_set
|
|
[]
|
|
[1, 2, 3, 35699, 35700, 35701]
|
|
|
|
List1: 202, 204
|
|
List2: 2, 4, 6, 71398, 71400, 71402
|
|
|
|
testing count
|
|
count: 2 6
|
|
testing foldl
|
|
Sum of List1 = 406
|
|
Sum of List2 = 214212
|
|
testing union
|
|
[2, 4, 6, 202, 204, 71398, 71400, 71402]
|
|
testing intersection
|
|
[]
|
|
testing difference
|
|
[202, 204]
|
|
testing remove_least
|
|
202
|
|
[204]
|
|
testing remove_leq 203
|
|
[204]
|
|
testing remove_gt 203
|
|
[202]
|
|
testing delete
|
|
[202, 204]
|
|
testing delete_list
|
|
[202, 204]
|
|
testing divide_by_set
|
|
[]
|
|
[2, 4, 6, 71398, 71400, 71402]
|
|
|
|
List1: 35702, 35703, 35705, 36696
|
|
List2: 1, 2, 3, 33416, 334283
|
|
|
|
testing count
|
|
count: 4 5
|
|
testing foldl
|
|
Sum of List1 = 143806
|
|
Sum of List2 = 367705
|
|
testing union
|
|
[1, 2, 3, 33416, 35702, 35703, 35705, 36696, 334283]
|
|
testing intersection
|
|
[]
|
|
testing difference
|
|
[35702, 35703, 35705, 36696]
|
|
testing remove_least
|
|
35702
|
|
[35703, 35705, 36696]
|
|
testing remove_leq 36200
|
|
[36696]
|
|
testing remove_gt 36200
|
|
[35702, 35703, 35705]
|
|
testing delete
|
|
[35702, 35703, 35705, 36696]
|
|
testing delete_list
|
|
[35702, 35703, 35705, 36696]
|
|
testing divide_by_set
|
|
[]
|
|
[1, 2, 3, 33416, 334283]
|
|
|
|
List1: 71404, 71406, 71410, 73392
|
|
List2: 2, 4, 6, 66832, 668566
|
|
|
|
testing count
|
|
count: 4 5
|
|
testing foldl
|
|
Sum of List1 = 287612
|
|
Sum of List2 = 735410
|
|
testing union
|
|
[2, 4, 6, 66832, 71404, 71406, 71410, 73392, 668566]
|
|
testing intersection
|
|
[]
|
|
testing difference
|
|
[71404, 71406, 71410, 73392]
|
|
testing remove_least
|
|
71404
|
|
[71406, 71410, 73392]
|
|
testing remove_leq 72401
|
|
[73392]
|
|
testing remove_gt 72401
|
|
[71404, 71406, 71410]
|
|
testing delete
|
|
[71404, 71406, 71410, 73392]
|
|
testing delete_list
|
|
[71404, 71406, 71410, 73392]
|
|
testing divide_by_set
|
|
[]
|
|
[2, 4, 6, 66832, 668566]
|
|
|
|
List1: 0, 63, 64, 65, 127
|
|
List2:
|
|
|
|
testing count
|
|
count: 5 0
|
|
testing foldl
|
|
Sum of List1 = 319
|
|
Sum of List2 = 0
|
|
testing union
|
|
[0, 63, 64, 65, 127]
|
|
testing intersection
|
|
[]
|
|
testing difference
|
|
[0, 63, 64, 65, 127]
|
|
testing remove_least
|
|
0
|
|
[63, 64, 65, 127]
|
|
testing remove_leq 63
|
|
[64, 65, 127]
|
|
testing remove_gt 63
|
|
[0, 63]
|
|
testing delete
|
|
[0, 63, 64, 65, 127]
|
|
testing delete_list
|
|
[0, 63, 64, 65, 127]
|
|
testing divide_by_set
|
|
[]
|
|
[]
|
|
|
|
List1: 0, 126, 128, 130, 254
|
|
List2:
|
|
|
|
testing count
|
|
count: 5 0
|
|
testing foldl
|
|
Sum of List1 = 638
|
|
Sum of List2 = 0
|
|
testing union
|
|
[0, 126, 128, 130, 254]
|
|
testing intersection
|
|
[]
|
|
testing difference
|
|
[0, 126, 128, 130, 254]
|
|
testing remove_least
|
|
0
|
|
[126, 128, 130, 254]
|
|
testing remove_leq 127
|
|
[128, 130, 254]
|
|
testing remove_gt 127
|
|
[0, 126]
|
|
testing delete
|
|
[0, 126, 128, 130, 254]
|
|
testing delete_list
|
|
[0, 126, 128, 130, 254]
|
|
testing divide_by_set
|
|
[]
|
|
[]
|
|
|
|
List1: 0, 63, 64, 65, 127, 128
|
|
List2:
|
|
|
|
testing count
|
|
count: 6 0
|
|
testing foldl
|
|
Sum of List1 = 447
|
|
Sum of List2 = 0
|
|
testing union
|
|
[0, 63, 64, 65, 127, 128]
|
|
testing intersection
|
|
[]
|
|
testing difference
|
|
[0, 63, 64, 65, 127, 128]
|
|
testing remove_least
|
|
0
|
|
[63, 64, 65, 127, 128]
|
|
testing remove_leq 64
|
|
[65, 127, 128]
|
|
testing remove_gt 64
|
|
[0, 63, 64]
|
|
testing delete
|
|
[0, 63, 64, 65, 127, 128]
|
|
testing delete_list
|
|
[0, 63, 64, 65, 127, 128]
|
|
testing divide_by_set
|
|
[]
|
|
[]
|
|
|
|
List1: 0, 126, 128, 130, 254, 256
|
|
List2:
|
|
|
|
testing count
|
|
count: 6 0
|
|
testing foldl
|
|
Sum of List1 = 894
|
|
Sum of List2 = 0
|
|
testing union
|
|
[0, 126, 128, 130, 254, 256]
|
|
testing intersection
|
|
[]
|
|
testing difference
|
|
[0, 126, 128, 130, 254, 256]
|
|
testing remove_least
|
|
0
|
|
[126, 128, 130, 254, 256]
|
|
testing remove_leq 128
|
|
[130, 254, 256]
|
|
testing remove_gt 128
|
|
[0, 126, 128]
|
|
testing delete
|
|
[0, 126, 128, 130, 254, 256]
|
|
testing delete_list
|
|
[0, 126, 128, 130, 254, 256]
|
|
testing divide_by_set
|
|
[]
|
|
[]
|
|
|
|
List1: 0, 63, 64, 65, 127, 128, 130
|
|
List2:
|
|
|
|
testing count
|
|
count: 7 0
|
|
testing foldl
|
|
Sum of List1 = 577
|
|
Sum of List2 = 0
|
|
testing union
|
|
[0, 63, 64, 65, 127, 128, 130]
|
|
testing intersection
|
|
[]
|
|
testing difference
|
|
[0, 63, 64, 65, 127, 128, 130]
|
|
testing remove_least
|
|
0
|
|
[63, 64, 65, 127, 128, 130]
|
|
testing remove_leq 65
|
|
[127, 128, 130]
|
|
testing remove_gt 65
|
|
[0, 63, 64, 65]
|
|
testing delete
|
|
[0, 63, 64, 65, 127, 128, 130]
|
|
testing delete_list
|
|
[0, 63, 64, 65, 127, 128, 130]
|
|
testing divide_by_set
|
|
[]
|
|
[]
|
|
|
|
List1: 0, 126, 128, 130, 254, 256, 260
|
|
List2:
|
|
|
|
testing count
|
|
count: 7 0
|
|
testing foldl
|
|
Sum of List1 = 1154
|
|
Sum of List2 = 0
|
|
testing union
|
|
[0, 126, 128, 130, 254, 256, 260]
|
|
testing intersection
|
|
[]
|
|
testing difference
|
|
[0, 126, 128, 130, 254, 256, 260]
|
|
testing remove_least
|
|
0
|
|
[126, 128, 130, 254, 256, 260]
|
|
testing remove_leq 130
|
|
[254, 256, 260]
|
|
testing remove_gt 130
|
|
[0, 126, 128, 130]
|
|
testing delete
|
|
[0, 126, 128, 130, 254, 256, 260]
|
|
testing delete_list
|
|
[0, 126, 128, 130, 254, 256, 260]
|
|
testing divide_by_set
|
|
[]
|
|
[]
|
|
|
|
List1:
|
|
List2: 2
|
|
|
|
testing count
|
|
count: 0 1
|
|
testing foldl
|
|
Sum of List1 = 0
|
|
Sum of List2 = 2
|
|
testing union
|
|
[2]
|
|
testing intersection
|
|
[]
|
|
testing difference
|
|
[]
|
|
testing remove_least
|
|
call failed
|
|
testing delete
|
|
[]
|
|
testing delete_list
|
|
[]
|
|
testing divide_by_set
|
|
[]
|
|
[2]
|
|
|
|
List1:
|
|
List2: 4
|
|
|
|
testing count
|
|
count: 0 1
|
|
testing foldl
|
|
Sum of List1 = 0
|
|
Sum of List2 = 4
|
|
testing union
|
|
[4]
|
|
testing intersection
|
|
[]
|
|
testing difference
|
|
[]
|
|
testing remove_least
|
|
call failed
|
|
testing delete
|
|
[]
|
|
testing delete_list
|
|
[]
|
|
testing divide_by_set
|
|
[]
|
|
[4]
|
|
|
|
List1:
|
|
List2: 2, 35701
|
|
|
|
testing count
|
|
count: 0 2
|
|
testing foldl
|
|
Sum of List1 = 0
|
|
Sum of List2 = 35703
|
|
testing union
|
|
[2, 35701]
|
|
testing intersection
|
|
[]
|
|
testing difference
|
|
[]
|
|
testing remove_least
|
|
call failed
|
|
testing delete
|
|
[]
|
|
testing delete_list
|
|
[]
|
|
testing divide_by_set
|
|
[]
|
|
[2, 35701]
|
|
|
|
List1:
|
|
List2: 4, 71402
|
|
|
|
testing count
|
|
count: 0 2
|
|
testing foldl
|
|
Sum of List1 = 0
|
|
Sum of List2 = 71406
|
|
testing union
|
|
[4, 71402]
|
|
testing intersection
|
|
[]
|
|
testing difference
|
|
[]
|
|
testing remove_least
|
|
call failed
|
|
testing delete
|
|
[]
|
|
testing delete_list
|
|
[]
|
|
testing divide_by_set
|
|
[]
|
|
[4, 71402]
|
|
|
|
List1: 2
|
|
List2:
|
|
|
|
testing count
|
|
count: 1 0
|
|
testing foldl
|
|
Sum of List1 = 2
|
|
Sum of List2 = 0
|
|
testing union
|
|
[2]
|
|
testing intersection
|
|
[]
|
|
testing difference
|
|
[2]
|
|
testing remove_least
|
|
2
|
|
[]
|
|
testing remove_leq 2
|
|
[]
|
|
testing remove_gt 2
|
|
[2]
|
|
testing delete
|
|
[2]
|
|
testing delete_list
|
|
[2]
|
|
testing divide_by_set
|
|
[]
|
|
[]
|
|
|
|
List1: 4
|
|
List2:
|
|
|
|
testing count
|
|
count: 1 0
|
|
testing foldl
|
|
Sum of List1 = 4
|
|
Sum of List2 = 0
|
|
testing union
|
|
[4]
|
|
testing intersection
|
|
[]
|
|
testing difference
|
|
[4]
|
|
testing remove_least
|
|
4
|
|
[]
|
|
testing remove_leq 4
|
|
[]
|
|
testing remove_gt 4
|
|
[4]
|
|
testing delete
|
|
[4]
|
|
testing delete_list
|
|
[4]
|
|
testing divide_by_set
|
|
[]
|
|
[]
|
|
|
|
List1: 2, 35701
|
|
List2:
|
|
|
|
testing count
|
|
count: 2 0
|
|
testing foldl
|
|
Sum of List1 = 35703
|
|
Sum of List2 = 0
|
|
testing union
|
|
[2, 35701]
|
|
testing intersection
|
|
[]
|
|
testing difference
|
|
[2, 35701]
|
|
testing remove_least
|
|
2
|
|
[35701]
|
|
testing remove_leq 17851
|
|
[35701]
|
|
testing remove_gt 17851
|
|
[2]
|
|
testing delete
|
|
[2, 35701]
|
|
testing delete_list
|
|
[2, 35701]
|
|
testing divide_by_set
|
|
[]
|
|
[]
|
|
|
|
List1: 4, 71402
|
|
List2:
|
|
|
|
testing count
|
|
count: 2 0
|
|
testing foldl
|
|
Sum of List1 = 71406
|
|
Sum of List2 = 0
|
|
testing union
|
|
[4, 71402]
|
|
testing intersection
|
|
[]
|
|
testing difference
|
|
[4, 71402]
|
|
testing remove_least
|
|
4
|
|
[71402]
|
|
testing remove_leq 35703
|
|
[71402]
|
|
testing remove_gt 35703
|
|
[4]
|
|
testing delete
|
|
[4, 71402]
|
|
testing delete_list
|
|
[4, 71402]
|
|
testing divide_by_set
|
|
[]
|
|
[]
|
|
testing count
|
|
testing foldl
|
|
testing union
|
|
testing intersection
|
|
testing difference
|
|
testing remove_least
|
|
testing delete
|
|
testing delete_list
|
|
testing divide_by_set
|
|
testing count
|
|
testing foldl
|
|
testing union
|
|
testing intersection
|
|
testing difference
|
|
testing remove_least
|
|
testing delete
|
|
testing delete_list
|
|
testing divide_by_set
|
|
testing count
|
|
testing foldl
|
|
testing union
|
|
testing intersection
|
|
testing difference
|
|
testing remove_least
|
|
testing delete
|
|
testing delete_list
|
|
testing divide_by_set
|
|
testing count
|
|
testing foldl
|
|
testing union
|
|
testing intersection
|
|
testing difference
|
|
testing remove_least
|
|
testing delete
|
|
testing delete_list
|
|
testing divide_by_set
|
|
testing count
|
|
testing foldl
|
|
testing union
|
|
testing intersection
|
|
testing difference
|
|
testing remove_least
|
|
testing delete
|
|
testing delete_list
|
|
testing divide_by_set
|
|
testing count
|
|
testing foldl
|
|
testing union
|
|
testing intersection
|
|
testing difference
|
|
testing remove_least
|
|
testing delete
|
|
testing delete_list
|
|
testing divide_by_set
|
|
testing count
|
|
testing foldl
|
|
testing union
|
|
testing intersection
|
|
testing difference
|
|
testing remove_least
|
|
testing delete
|
|
testing delete_list
|
|
testing divide_by_set
|
|
testing count
|
|
testing foldl
|
|
testing union
|
|
testing intersection
|
|
testing difference
|
|
testing remove_least
|
|
testing delete
|
|
testing delete_list
|
|
testing divide_by_set
|
|
testing count
|
|
testing foldl
|
|
testing union
|
|
testing intersection
|
|
testing difference
|
|
testing remove_least
|
|
testing delete
|
|
testing delete_list
|
|
testing divide_by_set
|
|
testing count
|
|
testing foldl
|
|
testing union
|
|
testing intersection
|
|
testing difference
|
|
testing remove_least
|
|
testing delete
|
|
testing delete_list
|
|
testing divide_by_set
|