Commit Graph

2 Commits

Author SHA1 Message Date
Zoltan Somogyi
bb8e42ad44 Improve the style of hash_table.m.
library/hash_table.m:
    Switch to using kv_lists to represent items in overflowing buckets.
    This is both cleaner and more efficient.

    Give many types, function symbols, predicates, functions and variables
    more meaningful names.

    Add XXXs to mark some significant potential problems.

    When an operation has both function and predicate forms, make the
    function form forward to the predicate form, as we do in the rest
    of the standard library.

    Make equality testing between a key in a hash bucket and a search key
    explicit in all cases.

library/kv_list.m:
    Add some functionality that hash_table.m now needs from kv_lists.

library/assoc_list.m:
    Add some functionality that kv_list.m now has, to maintain parity
    between the two modules.

NEWS:
    Announce the changes to assoc_list.m. (The changes to kv_list are moot,
    since it is a new module.)

tests/hard_coded/hash_table_test.{m,exp}:
    Make the progress messages output by this test more meaningful,
    and update its programming style.
2020-02-16 15:45:28 +11:00
Peter Wang
eeec14a8b1 Replace the implementations of (version) hash tables by separate chaining hash
Branches: main

Replace the implementations of (version) hash tables by separate chaining hash
tables.  The old open addressing scheme was broken in the presence of deletes.
Fixes bug #68.

library/hash_table.m:
library/version_hash_table.m:
	As above.

	We no longer use double hashing in case of a hash collision, so hash
	predicates only need to return one value now.

	Add fold with predicate arguments.

library/array.m:
	Add array.foldl for a predicate argument.

	Add array.foldl2 with a unique state pair.

library/version_array.m:
	Add version_array.foldl for a predicate argument.

compiler/make.m:
compiler/make.program_target.m:
compiler/make.util.m:
library/robdd.m:
	Conform to change in hashing predicates.

deep_profiler/dense_bitset.m:
	Add module qualifier to avoid ambiguity.

tests/hard_coded/Mmakefile:
tests/hard_coded/hash_table_delete.exp:
tests/hard_coded/hash_table_delete.m:
tests/hard_coded/hash_table_test.exp:
tests/hard_coded/hash_table_test.m:
tests/hard_coded/version_hash_table_delete.exp:
tests/hard_coded/version_hash_table_delete.m:
tests/hard_coded/version_hash_table_test2.exp:
tests/hard_coded/version_hash_table_test2.m:
	Add new test cases.

tests/hard_coded/hash_bug.m:
tests/hard_coded/hash_init_bug.m:
tests/hard_coded/version_hash_table_test.m:
	Conform to change in hashing predicates.

NEWS:
	Document additions.
2009-03-26 06:32:19 +00:00