mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-15 09:23:44 +00:00
The unification operation on 2-3-4 trees tests if they are structurally
equal. They might also be considered equal if their sets of key-value pairs
are equivalent. I've created an equal/2 predicate in the tree234 and
map modules in the standard library to test this.
library/tree234.m:
Implement a predicate to test for tree234 equivalence.
library/map.m:
Forward map.equal/2 to tree234.equal/2.
NEWS:
Announce this change in the news file.
tests/general/map_equal.m:
tests/general/map_equal.exp:
Add test case for map.equal/2
tests/general/Mmakefile:
Include the new test case.
11 lines
356 B
Plaintext
11 lines
356 B
Plaintext
Map1 = Map1: unifiable, equal
|
|
Map1 = Map1Copy: unifiable, equal
|
|
Map1 = Map2: not unifiable, not equal
|
|
Map2 = Map1: not unifiable, not equal
|
|
Map1 = empty: not unifiable, not equal
|
|
empty = Map1: not unifiable, not equal
|
|
empty = empty: unifiable, equal
|
|
empty = copy(empty): unifiable, equal
|
|
Map3 = Map4: not unifiable, equal
|
|
Map4 = Map3: not unifiable, equal
|