library/fatter_sparse_bitset.m:
Add this version of fat_sparse_bitset.m, which stores *two* words
worth of bits in each cell, not one. This word would otherwise be unused,
because the Boehm-Demers-Weiser allocator rounds up requests for three
word cells to four.
library/MODULES_DOC:
library/library.m:
Add the new module to the list of library modules.
library/fat_sparse_bitset.m:
library/sparse_bitset.m:
library/tree_bitset.m:
Update the documentation of all these other bitset modules. Copy
the same basic introduction to all the relevant modules. Add documentation
of the differences to tree_bitset.m and fatter_sparse_bitset.m, with
a pointer in fat_sparse_bitset.m to fatter_sparse_bitset.m.
library/test_bitset.m:
Test the new module as well as the others.
tests/hard_coded/speedtest_bitset.m:
Extend the benchmarking of list_to_set operations to the new module.
To allow the benchmarking to be tough enough to be informative, comment
out the benchmarking of the old_list_to_set operations.
... by using the algorithm now in sparse_bitset.list_to_set.
Keep the old list_to_set algorithm around in both modules for a short while
to allow comparative benchmarking.
library/fat_sparse_bitset.m:
library/sparse_bitset.m:
As above.
tests/hard_coded/speedtest_bitset.m:
A benchmark program to compare the old and new list_to_set algorithms,
both versus each other, and between sparse_bitset and fat_sparse_bitset.
library/sparse_bitset.m:
Replace the old algorithm, which had O(N^2) worst-case behavior,
with a modified form of natural merge sort, whose worst-case complexity
is O(NlogN).
library/sparse_bitset.m:
library/fat_sparse_bitset.m:
Speed up the remove_leq and remove_gt operations by moving a
loop invariant computation, the conversion of the boundary item's index
into an <offset,bitposn> pair, out of the loop.
Eliminate some unnecessary differences between the two modules,
e.g. clear_bit being a predicate rather than a function.
library/test_bitset.m:
Add facilities to test the remove_leq and remove_gt operations
of sparse_bitset.m, fat_sparse_bitset.m, and tree_bitset.m
against the same operations on plain old set_ordlists.
Bring this module up to date by requiring set elements to be
members of the uenum typeclass, not the enum typeclass.
Make the test_bitset type a bespoke type.
library/tree_bitset.m:
Add predicate versions of the remove_leq and remove_gt operations
alongside the existing function versions, to allow the new code
in test_bitset.m to work the same way regardless of which bitset module
it is testing.
For uniformity with the other bitset modules, require set elements to be
members of the uenum typeclass, not the enum typeclass.
Change the other integers, such as level numbers, to be unsigned
as well, to avoid the need for casts.
NEWS:
Announce the new additions and changes.
tests/hard_coded/test_tree_bitset.{m,exp}:
Use those new facilities to test those operations, and add some
test sets designed for that purpose.
Add a comment about the limitations of this testing strategy.
tests/hard_coded/bitset_tester.m:
Delete this long-unused module. (It was the original basis of
the test_bitset.m module in the library directory, but it became unused
when test_tree_bitset.m switched to using that module a long time ago.)
library/fat_sparse_bitset.m:
library/sparse_bitset.m:
Replace shifts by ints (most cast from uints) with shifts where
the number of bits to shift is specified as a uint.
NEWS:
Mention all the user-visible changes below.
library/enum.m:
Add the typeclass uenum, which is a version of the existing enum typeclass
that maps items to uints, not ints. It also uses a semidet predicate,
not a semidet function, to get back to the item from the uint.
library/sparse_bitset.m:
library/fat_sparse_bitset.m:
Make these modules operate on uints, which means requiring the items
in the sets to be instances of uenum, not enum.
If a few places, improve loops by doing previously-repeated conversions
of [u]ints into <offset, bit-to-set> pairs just once.
library/counter.m:
Define ucounters, which allocate uints. Improve documentation.
library/digraph.m:
Change digraph_keys from ints to uints, since we put them into
sparse_bitsets.
library/int.m:
Make int an instance of the uenum typeclass. This can help users
who currently put ints into sparse_bitsets.
library/pprint.m:
Prettyprint sparse_bitsets as lists of uints.
library/term.m:
Make vars instances of uenum as well as enum.
library/uint.m:
Make uint an instance of the uenum typeclass.
Add the ubits_per_uint function, which allows some casts to be avoided.
compiler/make.deps_set.m:
Change the indexes we put into sparse_bitsets from ints to uints.
compiler/make.make_info.m:
Change the source of those indexes from ints to uints.
compiler/make.top_level.m:
compiler/make.util.m:
Conform to the changes above.
compiler/pre_quantification.m:
Change zones from ints to uints, since we put them into sparse_bitsets.
tests/hard_coded/int_uenum.{m,exp}:
tests/hard_coded/Mmakefile:
Enable the new test case.
tests/valid/use_import_only_for_instance.m:
Update this extract from library/digraph.m the same way as
library/digraph.m itself.
library/fat_sparse_bitset.m:
library/sparse_bitset.m:
Change the auxiliary functions of these modules into predicates,
since their main job is to update the bitset_elems data structure.
Make the converted predicates use state variable notation
where this is useful.
When an operation has two versions, a function and a predicate,
the predicate used to be implemented in terms of the function.
Switch this: implement the functions in terms of the predicates.
Use a consistent naming scheme for variables: ItemX for the things
stored in the sparse bitset; SetX for representing whole sparse bitsets,
and ElemsX for repreresenting bitset_elems.
Fix some minor problems in the comments describing the exported operations.
Note opportunities for improvement.
library/diet.m:
library/fat_sparse_bitset.m:
library/set.m:
library/set_bbbtree.m:
library/set_ctree234.m:
library/set_ordlist.m:
library/set_tree234.m:
library/set_unordlist.m:
library/sparse_bitset.m:
library/tree_bitset.m:
Delete predicates and functions that have been marked as obsolete
since at least 2019.
Adjust documentation as required.
NEWS:
Announce the deletions.
In the Mercury standard library, every exported predicate or function
has (or at least *should* have) a comment that documents it, including
the meanings of its arguments. About 35-40% of these modules put `'s
(left and right quotes) around the names of the variable representing
those arguments. Some tried to do it consistently (though there were spots
with unquoted or half quoted names), while some did it only a few places.
This is inconsistent: we should either do it everywhere, or nowhere.
This diff makes it nowhere, because
- this is what the majority of the standard library modules do;
- this is what virtually all of the modules in the compiler, profiler,
deep_profiler etc directories do;
- typing all those quotes when adding new predicates in modules that
follow this convention is a pain in the ass; and because
- on many modern terminals, `' looks non-symmetrical and weird.
Likewise, the comment explaining a predicate often started with
% `predname(arguments)' returns ...
This diff deletes these quotes as well, since they add nothing useful.
This diff does leave in place quotes around code fragments, both terms
and goals, where this helps delineate the boundaries of that fragment.
library/sparse_bitset.m:
library/fat_sparse_bitset.m:
Improve these modules in several ways.
Provide more detailed documentation for the main data structures
and for several predicates.
Give some internal predicates more meaningful names.
Make union_list and intersect_list merge four sets per pass instead of two,
and encode the pass's main invariant (that both the input and output lists
of sets are nonempty) in the types.
Provide distinct low_to_high and high_to_low versions of both fold_bits
and fold2_bits, in order to avoid having to make repeated switches
based on the direction.
Use predmode declarations when possible.
Use variable names in a more consistent manner.
Move initial det computations out of the conditions of if-then-elses.
Eliminate negated tests in the conditions of if-then-elses.
Use det_from_int where relevant.
Eliminate nil/cons switches where both arms do the same thing.
Eliminate unnecessary differences between the two modules.
library/diet.m:
library/fat_sparse_bitset.m:
library/sparse_bitset.m:
library/test_bitset.m:
library/tree_bitset.m:
As above. Also, mark as obsolete the same predicates as were marked obsolete
in the other set modules recently.
compiler/mode_robdd.equiv_vars.m:
compiler/mode_robdd.implications.m:
compiler/mode_robdd.tfeirn.m:
library/robdd.m:
library/digraph.m:
Avoid using predicates that are now marked obsolete.
Discussion of these changes can be found on the Mercury developers
mailing list archives from June 2018.
COPYING.LIB:
Add a special linking exception to the LGPL.
*:
Update references to COPYING.LIB.
Clean up some minor errors that have accumulated in copyright
messages.
The helper predicate `divide_bits_by_set' compares two bit vectors
(words) at the same offset, but it was incorrectly passed an absolute
offset instead of the offset *within* the two words it compares.
That led a call to unchecked_left_shift:
OffsetBit = unchecked_left_shift(1, Offset)
which compiles to C:
OffsetBit = 1 << Offset;
whose behaviour is undefined when Offset >= bits_per_int.
The correct expression should be
OffsetBit = 1 << OffsetInWord;
(strictly speaking, this still relies on undefined behaviour because we
may shift into the sign bit)
It so happens that the incorrect code produces expected value of OffsetBit
on x86 and x86_64 because the left shift instructions mask the shift count
to the lower 5 or 6 bits (for 32-bit and 64-bit words, respectively),
and because the base offset of each bitset_elem is always a multiple
of bits_per_int.
The incorrect code also happens to work when targeting Java and C#
because those languages define their left shift operators to mask the
shift count in the same way.
library/sparse_bitset.m:
As above.
library/sparse_bitset.m:
library/fat_sparse_bitset.m:
Add modes for folds with unique and mostly-unique accumulators.
library/diet.m:
Fix some formatting.
Estimated hours taken: 3
Branches: main
Avoid some redundant work during determinism analysis. This diff speeds up
tools/speedtest by just shy of 0.7%.
compiler/det_analysis.m:
Instead of (a) getting a list of procedures in the module and then
(b) classifying them into three categories, do both jobs at once.
This avoids some redundant traversals and map lookups, and avoids
the creation of an intermediate data structure.
compiler/instmap.m:
Instead of converting a set into a list and iterating over that list
to check that elements of the set have a given property, iterate over
the set elements directly.
Put the arguments of a predicate in a more logical order.
compiler/det_util.m:
Conform to the change in instmap.m.
compiler/set_of_var.m:
Provide the all_true predicate needed by det_util.
library/*set*.m:
In every module that implements sets, provide an all_true predicate.
NEWS:
Mention the new predicates in the library.
Estimated hours taken: 8
Branches: main
compiler/inst_match.m:
Instead of first testing whether an inst exists in a set
and then inserting it if does not, use a single predicate
that does both the membership test and the insertion (if
the membership test failed) in one pass.
This speeds up compilation of one version of the rcpsp_cpx
stress test by about 9%, with negligible effect on tools/speedtest.
Some cleanups that should have been committed before this diff follow.
Change the structure of many of the predicates in this module from
containing multiple clauses, to a single clause with an explicit
disjunction, which (where relevant) now gets a require_comple_switch
wrapper. In several cases, this change has shown that we were
missing code for handling some kinds of insts. For example, some
predicates handled free/0 but not free/1, even though there was
no reason for the difference. This diff fixes such oversights
in places where the right action seems obvious to me, and adds
XXXs in places where I see no obvious fix.
Rename several predicates and function symbols to avoid ambiguities.
Add some XXXs on potential problems.
library/*set*.m:
Implement this insert_new predicate for all the implementations
of sets we have. The code in each case is copied from the code
of insert, with code to return a set unchanged replaced with `fail'.
NEWS:
Mention the new predicates.
Estimated hours taken: 6
Branches: main
library/sparse_bitset.m:
Add the predicates and functions needed to allow this module
to replace tree_bitset.m in implementing the operations of
set_of_var.m.
Convert the module to call unexpected instead of error.
library/fat_sparse_bitset.m:
A new module. It is a copy of the updated version of sparse_bitset.m
modified to use fat lists instead of plain lists. This means that
instead of representations such as
[bitset_elem(Offset1, Bits1), bitset_elem(Offset2, Bits2)]
it has representations such as
node(Offset1, Bits1, node(Offset2, Bits2, empty))
These have half the number of nodes and thus half the number of
allocations. In theory, they could also need only 75% of the space
(one three-word cell instead of two two-word cells), but the Boehm
collector rounds up three words to four.
library/library.m:
Add the new module.
Branches: main, 11.07
Fix argument ordering in documentation for
`sparse_bitset.member/2' and `tree_bitset.member/2'.
library/sparse_bitset.m:
library/tree_bitset.m:
As above.
Estimated hours taken: 3
Branches: main
compiler/stack_alloc.m:
Avoid some redundant conversions between lists and sets. The main
performance win is from avoiding a list_to_set conversion that
requires sorting.
library/*set*.m:
The change to stack_alloc.m requires the ability to partition a set
based on predicate. Implement a version of filter that returns the
false as well as the true cases in all the set modules. (Most set
modules lacked the return-the-trues-only version of filter as well.)
NEWS:
Mention the additions to the standard library.
Branches: main
Change the argument order of predicates in the sparse_bitset modules to make
it more conducive to the use of state variable notation.
Group function clauses together with the clauses for the corresponding
predicates.
library/sparse_bitset.m:
As above.
library/digraph.m:
compiler/make.dependencies.m:
compiler/mode_robdd.equiv_vars.m:
compiler/mode_robdd.implications.m:
compiler/mode_robdd.tfeirn.m:
tests/hard_coded/bitset_tester.m:
tests/hard_coded/pprint_test.m:
tests/valid/loop_inv_bug.m:
Conform to the above change.
library/digraph.m:
library/getopt.m:
library/getopt_io.m:
library/map.m:
Remove dependencies on the svset module.
NEWS:
Announce the above change.
Branches: main
Add predicates named is_empty/1 as a synonym for empty/1 to all the modules in
the standard library that provide sets. The former name is less ambiguous than
the latter.
library/set*.m:
library/spare_bitset.m:
library/tree_bitset.m:
Add is_empty/1 as a synonym for empty/1.
NEWS:
Announce the above addition.
Estimated hours taken: 0.5
Branches: main
Remove a bug workaround in the the thread module.
Misc. minor changes to library modules.
library/thread.m:
Delete the workaround for the bug with foreign_import_module pragmas
and sub-modules on the lowlevel backends.
library/deconstruct.m:
library/sparse_bitset.m:
library/varset.m:
Delete duplicate imports.
library/io.m:
library/thread.semaphore.m:
s/which/that/ in a spot.
library/prolog.m:
Convert this module to 4-space indentation.
library/dir.m:
library/getopt.m:
library/getopt_io.m:
library/lexer.m:
Fix some formatting so that it conforms to our current coding
standard.
Estimated hours taken: 12
Branches: main
Fix a bug that caused bootchecks with --optimize-constructor-last-call to fail.
The problem was not in lco.m, but in follow_code.m. In some cases,
(specifically, the LCMC version of insert_2 in sparse_bitset.m),
follow_code.m moved an impure goal (store_at_ref) into the arms of an
if-then-else without marking those arms, or the if-then-else, as impure.
The next pass, simplify, then deleted the entire if-then-else, since it
had no outputs. (The store_at_ref that originally appeared after the
if-then-else was the only consumer of its only output.)
The fix is to get follow_code.m to make branched control structures such as
if-then-elses, as well as their arms, semipure or impure if a goal being moved
into them is semipure or impure, or if they came from an semipure or impure
conjunction.
Improve the optimization of the LCMC version of sparse_bitset.insert_2, which
had a foreign_proc invocation of bits_per_int in it: replace such invocations
with a unification of the bits_per_int constant if not cross compiling.
Add a new option, --optimize-constructor-last-call-null. When set, LCMC will
assign NULLs to the fields not yet filled in, to avoid any junk happens to be
there from being followed by the garbage collector's mark phase.
This diff also makes several other changes that helped me to track down
the bug above.
compiler/follow_code.m:
Make the fix described above.
Delete all the provisions for --prev-code; it won't be implemented.
Don't export a predicate that is not now used anywhere else.
compiler/simplify.m:
Make the optimization described above.
compiler/lco.m:
Make sure that the LCMC specialized procedure is a predicate, not a
function: having a function with the mode LCMC_insert_2(in, in) = in
looks wrong.
To avoid name collisions when a function and a predicate with the same
name and arity have LCMC applied to them, include the predicate vs
function status of the original procedure included in the name of the
new procedure.
Update the sym_name of calls to LCMC variants, not just the pred_id,
because without that, the HLDS dump looks misleading.
compiler/pred_table.m:
Don't have optimizations like LCMC insert new predicates at the front
of the list of predicates. Maintain the list of predicates in the
module as a two part list, to allow efficient addition of new pred_ids
at the (logical) end without using O(N^2) algorithms. Having predicates
in chronological order makes it easier to look at HLDS dumps and
.c files.
compiler/hlds_module.m:
Make module_info_predids return a module_info that is physically
updated though logically unchanged.
compiler/options.m:
Add --optimize-constructor-last-call-null.
Make the options --dump-hlds-pred-id, --debug-opt-pred-id and
--debug-opt-pred-name into accumulating options, to allow the user
to specify more than one predicate to be dumped (e.g. insert_2 and
its LCMC variant).
Delete --prev-code.
doc/user_guide.texi:
Document the changes in options.m.
compiler/code_info.m:
Record the value of --optimize-constructor-last-call-null in the
code_info, to avoid lookup at every cell construction.
compiler/unify_gen.m:
compiler/var_locn.m:
When deciding whether a cell can be static or not, make sure that
we never make static a cell that has some fields initialized with
dummy zeros, to be filled in for real later.
compiler/hlds_out.m:
For goals that are semipure or impure, note this fact. This info was
lost when I changed the representation of impurity from markers to a
field.
mdbcomp/prim_data.m:
Rename some ambiguous function symbols.
compiler/intermod.m:
compiler/trans_opt.m:
Rename the main predicates (and some function symbols) of these modules
to avoid ambiguity and to make them more expressive.
compiler/llds.m:
Don't print line numbers for foreign_code fragments if the user has
specified --no-line-numbers.
compiler/make.dependencies.m:
compiler/mercury_to_mercury.m:
compiler/recompilation.usage.m:
Don't use io.write to write out information to files we may need to
parse again, because this is vulnerable to changes to the names of
function symbols (e.g. the one to mdbcomp/prim_data.m).
The compiler still contains some uses of io.write, but they are
for debugging. I added an item to the todo list of the one exception,
ilasm.m.
compiler/recompilation.m:
Rename a misleading function symbol name.
compiler/parse_tree.m:
Don't import recompilation.m here. It is not needed (all the components
of parse_tree that need recompilation.m already import it themselves),
and deleting the import avoids recompiling almost everything when
recompilation.m changes.
compiler/*.m:
Conform to the changes above.
compiler/*.m:
browser/*.m:
slice/*.m:
Conform to the change to mdbcomp.
library/sparse_bitset.m:
Use some better variable names.
Estimated hours taken: 1
Branches: main
library/Mercury.options:
Compile sparse_bitset.m and tree_bitset.m with
--optimize-constant-propagation, which enables the optimizations
in simplify.m for operations involving bits_per_int, which were
designed for this purpose.
Compile them also with --use-atomic-cells, to enables to use plain
Mercury code instead of foreign procs to allocate nodes containing
bitsets.
These changes lead to a speedup of about 1.5% in compiling
training_cars_full.m, from 97.3 seconds to 95.8 seconds.
library/sparse_bitset.m:
library/tree_bitset.m:
Use Mercury code instead of foreign_procs to allocate nodes containing
bitsets.
I tried commenting out the sanity checks still left in tree_bitset.m,
but this lead to a speedup of only 0.1%, so I left them in.
Estimated hours taken: 32
Branches: main
Add to the library a new module called tree_bitset.m, which is a version
of sparse_bitset.m modified to allow algorithms (for union, intersection etc)
that do not require scanning the entire list of bitmaps.
Use this module as the set representation in quantification.
This reduces the time to compile training_cars_full.m from 250 seconds
to 110 seconds (a reduction of about 56%). As for compiling ordinary files,
the time taken for our usual speedtest (compiling the six largest files
of the compiler itself) is reduced from 20.2 seconds to 19.5 (a reduction
of about 3.5%).
library/tree_bitset.m:
Add the new module.
library/library.m:
Include the new module in the library.
library/int.m:
Improve the formatting of some comments.
library/sparse_bitset.m:
Fix a bug in a comment.
compiler/quantification.m:
Use the new module in the library.
Avoid using predicates that exist in sparse_bitset.m and in set.m
but are available only as functions in tree_bitset.m.
Rename a predicate to avoid ambiguity.
compiler/hlds_out.m:
Output the number of variables in a predicate or procedure when
printing the set of variables and their types.
tests/hard_coded/test_tree_bitset.{m,exp}:
tests/hard_coded/tree_bitset_tester.m:
Two modules of a new test case, modelled on the test case that tests
sparse_bitsets, for testing tree_bitsets.
tests/hard_coded/Mmakefile:
Don't enable the new test case yet, since the .exp file is only a dummy
so far.
Estimated hours taken: 1
Branches: main
Various minor cleanups and syntax updates for the standard library.
There are no changes to any algorithms.
library/injection.m:
library/set.m:
library/sparse_bitset.m:
Use promise_equivalent_clauses where appropriate.
library/set_ordlist.m:
library/set_unordlist.m:
Convert these module to 4-space indentation:
Convert these module to 4-space indentation
library/*.m:
Convert some if-then-elses into switches.
Remove unnecessary module qualification - this is related
mainly to the breakup of std_util and the fact that on
the 0.13 branche we had two versions of the all-solutions
predicates.
Various other style cleanups.
vim/syntax/mercury.vim:
Highlight promise_equivalent_clauses appropriately.
Estimated hours taken: 18
Branches: main
Move the univ, maybe, pair and unit types from std_util into their own
modules. std_util still contains the general purpose higher-order programming
constructs.
library/std_util.m:
Move univ, maybe, pair and unit (plus any other related types
and procedures) into their own modules.
library/maybe.m:
New module. This contains the maybe and maybe_error types and
the associated procedures.
library/pair.m:
New module. This contains the pair type and associated procedures.
library/unit.m:
New module. This contains the types unit/0 and unit/1.
library/univ.m:
New module. This contains the univ type and associated procedures.
library/library.m:
Add the new modules.
library/private_builtin.m:
Update the declaration of the type_ctor_info struct for univ.
runtime/mercury.h:
Update the declaration for the type_ctor_info struct for univ.
runtime/mercury_mcpp.h:
runtime/mercury_hlc_types.h:
Update the definition of MR_Univ.
runtime/mercury_init.h:
Fix a comment: ML_type_name is now exported from type_desc.m.
compiler/mlds_to_il.m:
Update the the name of the module that defines univs (which are
handled specially by the il code generator.)
library/*.m:
compiler/*.m:
browser/*.m:
mdbcomp/*.m:
profiler/*.m:
deep_profiler/*.m:
Conform to the above changes. Import the new modules where they
are needed; don't import std_util where it isn't needed.
Fix formatting in lots of modules. Delete duplicate module
imports.
tests/*:
Update the test suite to confrom to the above changes.
Estimated hours taken: 1
Branches: main
library/*.m:
Replace __ with . as the module qualifier everywhere.
tests/hard_coded/test_injection.exp:
Replace __ with . as the module qualifier in expected exceptions.
Estimated hours taken: 0.5
Branches: main
library/*.m:
Annotate foreign_procs with trail usage information throughout most of
the standard library.
Fix an out of date comment in string.m.
Fix some minor formatting problems.
Estimated hours taken: 4
Branches: main
library/*.m:
Convert to four-space indentation most of the library modules that
weren't already indented that way. Use predmode syntax where possible.
In some modules, shorten long lines by deleting module name prefixes.
Fix departures from our coding standards.
In some modules, simplify code, mostly using field names and/or state
variables.
There are no changes in algorithms, except for neg_list in integer.m.
Estimated hours taken: 1.5
Branches: main
library/sparse_bitset.m:
Provide versions of foldl and fold2 that work with two accumulators.
Convert to four-space indentation.
library/relation.m:
Fix some efficiency problems caused by folds on sparse_bitsets.
Use the new two-accumulator variants instead of using pairs,
which avoids memory allocation. Use the folds over predicates
instead of the folds over functions, since sparse_bitset.m implements
the folds over functions by converting the function into a predicate,
which takes time.
Make some lambda expressions into named predicates.
Convert to four-space indentation.
Estimated hours taken: 3.5
Branches: main
Make the positioning of descriptive comments conform
to the coding standard for the following library modules.
Convert preds to predmode syntax where possible.
Make the ordering of related predicates and functions
conform to the coding standard, where the descriptive
comment makes it possible to do that.
Other minor changes are listed below.
library/bimap.m:
Fix capitalisation of a few comments.
library/dir.m:
s/throw an exception/throws an exception/.
library/exception.m:
Fix the comment about the exception_result/1 type.
There is only one type and an inst following the comment.
library/map.m:
Remove the unique modes for map.set/4, map.delete/3 and
map.delete_list/3.
library/rbtree.m:
Remove the unique modes for rbtree.set/4, rbtree.delete/3,
rbtree.remove/4, rbtree.remove_smallest/4 and rbtree.remove_largest/4.
library/tree234.m:
Remove left over unique modes for preds.
library/set.m:
XXX the ordering of procedures in this module is a bit strange.
library/set_bbbtree.m:
library/set_unordlist.m:
Remove various unique modes for set operations like
delete/3. (Some of these were commented out anyway).
library/term_to_xml.m:
Fix a spot where line width exceeded 79 characters.
library/array.m:
library/assoc_list.m:
library/random.m:
library/multi_map.m:
library/pqueue.m:
library/queue.m:
library/bool.m:
library/char.m:
library/construct.m:
library/counter.m:
library/deconstruct.m:
library/eqvclass.m:
library/gc.m:
library/io.m:
library/sparse_bitset.m:
library/stack.m:
library/std_util.m:
library/store.m:
library/string.m:
library/term.m:
library/term_io.m:
library/type_desc.m:
library/varset.m:
As above.
Estimated hours taken: unknown (but probably several weeks by dmo)
Branches: main
Move changes in the library on the mode-constraints branch onto the trunk.
library/eqvclass.m:
Add some utility functions and predicates.
library/map.m:
Add some utility functions and predicates, and some type
specialization directives.
library/tree234.m:
Add some utility functions and predicates.
library/robdd.m:
Add this module, which provides a Mercury interface to the C code in
robdd/bryant.c. In some places, robustness has been sacrificed for
speed, and the module is not (yet) as well documented as it could be;
therefore it is not (yet) included in the documentation.
library/pprint.m:
Print robdds nicely, since this is essential to debugging code handling
robdds. (This is why adding robdd.m in some other directory, e.g. the
compiler, wouldn't really work.)
library/term.m:
Add a function that returns the highest numbered vars created from
a var_supply.
library/varset.m:
Add a function that returns the highest numbered vars created from
a varset.
library/unsafe.m:
Add this module here, since it may be needed to debug code in the
library (e.g. in robdd.m.).
library/library.m:
Add a reference to the robdd module, and a commented out reference
to the unsafe module. If a developer needs to use unsafe.m anywhere
in the Mercury implementation, they can uncomment this reference
in the relevant workspace.
Make the list of modules easier to maintain (especially in the case
of CVS conflicts) by listing one module per line.
Fix formatting of some foreign_procs.
NEWS:
Mention the new predicates and functions.
Mmake.workspace:
Add a new make variable that specifies the location of the robdd
subdirectory.
Mmakefile:
Add rules for handling the robdd subdirectory.
configure.in:
Check whether the compiler can handle local foreign_decls, since
robdd.m now needs this.
tools/bootcheck:
Add the robdd subdirectory to the stage 2 & 3 directories.
deep_profiler/unsafe.m:
Remove this module from this directory.
doc/Mmakefile:
Do not include the robdd and unsafe modules in the documentation.
The robdd module because (in its present state) it is not stable
enough, the unsafe module because it is not enabled in installed
versions of the library.
robdd/Makefile:
Update the set of default compilation flags. The main code in this
directory, bryant.c, is #included in library/robdd.m, and the only
other programs in this directory are test programs.
robdd/Mmakefile:
New file. Includes a mechanism to compile bryant.c in the robdd
subdirectory, since this can give cleaner error messages than
compiling library/robdd.m.
robdd/bryant.[ch]:
Huge cleanup of these files. Add MR_ROBDD_ prefixes to global symbols,
make the formatting conform to our standards, and fix irregularities
in the uses of the macros that control the use of optional facilities.
robdd/bryantPrint.[ch]:
robdd/table.[ch]:
robdd/test_abexit.c:
robdd/test_abunify.c:
robdd/test_abglb.c:
robdd/test_iff.c:
robdd/test_rename.c:
robdd/test_restrict.c:
robdd/test_rglb.c:
robdd/test_upclose.c:
robdd/test_var.c:
robdd/test_vars.c:
robdd/timing.[ch]:
robdd/var.h:
Conform to the changes in bryant.h. Note that since the code in these
files won't end up in Mercury program code, they don't need to be
namespace clean.
runtime/mercury.h:
runtime/mercury_heap.h:
runtime/mercury_init.h:
runtime/mercury_memory.h:
#define GC_I_HIDE_POINTERS before each #include of gc.h (bryant.c
hides pointers). This impact of this #define is so small that it is
not measurable.
runtime/RESERVED_MACRO_NAMES:
library/RESERVED_MACRO_NAMES:
Add HIDE_POINTER and REVEAL_POINTER, since defining GC_I_HIDE_POINTERS
makes these macros from gc.h visible.
runtime/mercury_reg_workarounds.[ch]:
Add the MR_memset function.
tests/debugger/declarative/if_then_else.{inp,exp}:
tests/debugger/declarative/ite_2.{inp,exp,exp2}:
Avoid a name conflict with the predicate ite in robdd.m.
Estimated hours taken: 0.5
Branches: main
library/Mmakefile:
Fix a typo which meant that everything was always getting
compiled with --allow-stubs --no-warn-stubs.
library/sparse_bitset.m:
Use pragma type_spec declarations for predicate foldr_2/4;
the previous patch to this file deleted them for function foldr_2/3,
but the right fix was to move them to the corresponding predicate.
Estimated hours taken: 0.5
Branches: main
Removed a function declaration from the sparse_bitset implementation.
library/sparse_bitset.m:
Removed the function declaration for sparse_bitset.foldr_2/3 from the
implementation, since the function is not called by anything and
causes a compile warning.