Use the same variable (base) name for each field of the eqvclass
structure in all predicates. Make this base name match the name
of that field.
Delete redundant module qualifiers, except in the few cases where
it helps readability.
Add dividers to separate unrelated predicates.
Expand out deeply nested function calls, giving names
to the intermediate results.
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.
library/bimap.m:
library/bitmap.m:
library/calendar.m:
library/char.m:
library/cord.m:
library/deconstruct.m:
library/diet.m:
library/dir.m:
library/eqvclass.m:
library/map.m:
library/pprint.m:
library/pqueue.m:
library/stream.string_writer.m:
library/term_conversion.m:
library/time.m:
library/type_desc.m:
library/version_array.m:
library/version_array2d.m:
library/version_bitmap.m:
library/version_hash_table.m:
Fix inconsistencies between (a) the order in which functions and predicates
are declared, and (b) the order in which they are defined.
In most of these modules, either the order of the declarations
or the order of the definitions made sense, and I changed the other
to match. In a few modules, neither made sense, so I changed *both*
to an order that *does* make sense (i.e. it has related predicates
together).
In some places, put dividers between groups of related
functions/predicates, to make the groups themselves more visible.
In some places, fix comments or programming style, give some auxiliary
(non-exported) predicates better names, or delete some unneeded module
qualifications.
In some places, have the function form of a procedure forward
the work to the predicate form, instead of vice versa, where this is
more natural (usually because it allows the use of state variables).
However, this is the only kind of "algorithmic" change in this diff;
the rest is just moving code around.
NOTE: this change does not affect the io module -- I've left that for a
separate change.
library/*.m:
As per the recent change to the coding standard, avoid module
qualification in library interfaces where possible.
Reformat declarations and descriptive comments to better utilise
any space freed up by the above.
Estimated hours taken: 0.2
Branches: main
Fix Mantis bug 251.
library/eqvclass.m:
Relax the overly restrictive sanity check that generated the problem.
Document why it is relaxed.
tests/hard_coded/eqvclass.{m,exp}:
The Mantis bug test case.
tests/hard_coded/Mmakefile:
Enable the new test case.
Branches: main, 11.07 (partial)
Fix bug #248: make the argument order of the singleton_set/2 predicates in the
various set modules in the standard library consistent. (This breaks backwards
compatibility but in a fairly minor way.)
Add the predicate is_singleton/2 to those set modules that do not already
provide it.
Fix a bug in the implementation of set_unordlist.singleton_set/2.
library/set.m:
library/set_bbbtree.m:
library/set_ctree234.m:
library/set_ordlist.m:
library/set_unordlist.m:
Swap the argument order of singleton_set/2.
Add is_singleton/2 where it wasn't already present.
library/set_unordlist.m:
Fix a bug: singleton_set/2 failed to take account of
the fact that the representation could contain duplicates
in the singleton_setT::out, set_unordlist(T)::in) mode.
The fix is to sort and remove the duplicates before checking
whether the set is singleton.
NEWS:
Announce the above changes.
library/eqvclass.m:
library/tree234.m:
compiler/accumulator.m:
compiler/code_info.m:
compiler/graph_colour.m:
compiler/higher_order.m:
compiler/lp_rational.m:
compiler/ml_tag_switch.m:
compiler/pd_info.m:
compiler/pd_util.m:
compiler/proc_gen.m:
compiler/prog_mode.m:
compiler/term_pass1.m:
compiler/type_constraints.m:
compiler/unneeded_code.m:
compiler/var_locn.m:
deep_profiler/autopar_costs.m:
deep_profiler/var_use_analysis.m:
tests/general/set_test.m:
Conform to the above changes.
tests/hard_coded/Mmakefile:
tests/hard_coded/singleton_dups.{m,exp}:
Add a regression test for the problem with set_unordlist.singleton_set/2.
Branches: main
Change the argument ordering of predicates in the set module.
library/set.m:
Change predicate argument orders to match the versions
in the svset module.
Group function definitions with the corresponding predicates
rather than at the end of the file.
Delete Ralph's comments regarding the argument order in the
module interface: readers of the library reference guide are
unlikely to be interested in his opinion of the argument ordering
ten or so years ago.
Add extra modes for set.map/3 and set.map_fold/5.
library/svset.m:
library/eqvclass.m:
library/tree234.m:
library/varset.m:
browser/*.m:
compiler/*.m:
deep_profiler/*.m:
mdbcomp/trace_counts.m:
extras/moose/grammar.m:
extras/moose/lalr.m:
extras/moose/moose.m:
tests/hard_coded/bitset_tester.m:
Conform to the above change.
NEWS:
Announce the above changes.
Branches: main
Change the argument ordering of predicates in the eqvclass and queue modules in
order to make the more conducive to the use of state variable notation.
library/eqvclass.m:
library/queue.m:
Make the above changes.
Shift function definitions so that they placed with
the corresponding predicate definitions rather than
all being grouped at the end of the module.
library/sveqvclass.m:
library/svqueue.m:
compiler/common.m:
compiler/ctgc.selector.m:
compiler/dead_proc_elim.m:
compiler/matching.m:
compiler/modes.m:
compiler/recompilation.usage.m:
compiler/unify_proc.m:a
tests/hard_coded/type_to_term_bug.m:
Conform to the above change and remove dependencies on the
sv{eqvclass,queue} modules.
NEWS:
Announce the change.
Branches: main
Change the argument order of many of the predicates in the map, bimap, and
multi_map modules so they are more conducive to the use of state variable
notation, i.e. make the order the same as in the sv* modules.
Prepare for the deprecation of the sv{bimap,map,multi_map} modules by
removing their use throughout the system.
library/bimap.m:
library/map.m:
library/multi_map.m:
As above.
NEWS:
Announce the change.
Separate out the "highlights" from the "detailed listing" for
the post-11.01 NEWS.
Reorganise the announcement of the Unicode support.
benchmarks/*/*.m:
browser/*.m:
compiler/*.m:
deep_profiler/*.m:
extras/*/*.m:
mdbcomp/*.m:
profiler/*.m:
tests/*/*.m:
ssdb/*.m:
samples/*/*.m
slice/*.m:
Conform to the above change.
Remove any dependencies on the sv{bimap,map,multi_map} modules.
Estimated hours taken: 0.1
Branches: main
library/eqvclass.m:
library/graph.m:
library/bool.m:
library/parser.m:
library/relation.m:
library/robdd.m:
Delete imports that are duplicated between the interface and
implementation sections.
Estimated hours taken: 1
Branches: main
compiler/special_pred.m:
Fix grammar in the name of a predicate.
Minor cleanups.
compiler/add_special_pred.m:
Conform to the change in special_pred.m.
compiler/atsort.m:
compiler/clause_to_proc.m:
compiler/constraint.m:
compiler/deforest.m:
compiler/hlds_out.m:
compiler/loop_inv.m:
compiler/mercury_to_mercury.m:
compiler/ml_code_gen.m:
compiler/ml_tailcall.m:
compiler/mlds_to_c.m:
compiler/rtti_to_mlds.m:
compiler/type_util.m:
compiler/untupling.m:
library/dir.m:
library/eqvclass.m:
library/type_desc.m:
Minor cleanups.
library/queue.m:
Use a real type, not a pair, to represent queues, and document its
meaning.
tests/hard_coded/type_to_term_bug.exp:
Conform to the change to queue representations.
Estimated hours taken: 0.2
Branches: main, release
library/*.m:
Improve the library reference manual by formatting the beginning of
library modules consistently.
library/integer.m:
Fix some bad indentation.
Estimated hours taken: 0.5
Branches: main
library/eqvclass.m:
Add a function for use by the scanner generator.
library/multi_map.m:
Fix typo in comment.
NEWS:
Mention the new function.
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: 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: 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: 12
Branches: main
compiler/common.m:
Make this pass significantly more efficient when operating on
predicates with many opportunities for reusing common structures.
The speed when compiling the six largest compiler modules is virtually
unaffected, but the time to compile a module generated by caribou
has dropped from 79 seconds to 56, a 30% reduction.
The main change is avoiding repeated computations. Instead of storing
the types of available structures and checking their type constructors
each time they are looked at, compute the type constructor just once.
Document the main data structure in significantly more detail than
before.
Switch to four-space indentation. Some predicates have so many levels
of indentation that this is the only way to allow a reasonable amount
of code on each line.
compiler/simplify.m:
Conform to the changed interface of common.m. Some minor cleanups.
library/eqvclass.m:
Improve the speed of the basic operation of adding new equivalences
by avoiding the creation of new equivalence classes and then destroying
them immediately.
Make it possible for the caller (in our case, common.m) to speed up a
sequence of equivalence tests by performing the common part of those
tests just once.
Estimated hours taken: 2
Branches: main
library/eqvclass.m:
Bring this module up to date with our current code guidelines.
Use predmode declarations, state variables and field accesses
where possible. Use counters instead of plain ints to allocate
partition_ids.
There are no changes in algorithms.
library/sveqvclass.m:
Provide state-variable-friendly versions of the predicates in
eqvclass.m that could benefit from this.
library/library.m:
NEWS:
Mention the new module.
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: 6
library/pqueue.m:
library/assoc_list.m:
library/getopt.m:
library/bag.m:
library/bimap.m:
library/bintree.m:
library/bintree_set.m:
library/bt_array.m:
library/eqvclass.m:
library/graph.m:
library/group.m:
library/queue.m:
library/rbtree.m:
library/stack.m:
library/term.m:
library/varset.m:
library/tree234.m:
library/relation.m:
library/set.m:
library/set_bbbtree.m:
library/set_ordlist.m:
library/set_unordlist.m:
Ralph Becket <rwab1@cam.sri.com>'s changes to add functions for
the remaining output det predicates in a number of modules in the
standard library. Basically, for each
:- pred f(in, ..., in, out) is det.
he has added the declaration
:- func f(in, ..., in) = out.
and definition
f(X1, ..., Xn) = Y :-
f(X1, ..., Xn, Y).
The changes were made using a mostly automatic process.
Estimated hours taken: 0.5
library/*.m:
compiler/*.m:
Undo Zoltan's bogus update of all the copyright dates.
The dates in the copyright header should reflect the years
in which the file was modified (and no, changes to the
copyright header itself don't count as modifications).
Estimated hours taken: 3
Enable --warn-interface-imports by default. This was turned off while
list and term were defined in mercury_builtin.m, since it caused many
warnings.
Fix all the unused interface imports that have been added since then.
compiler/options.m:
Enable --warn-interface-imports by default.
compiler/module_qual.m:
Fix formatting inconsistencies with module names in warning
messages. (".m" was not appended to module names if there was
only one module).
compiler/*.m:
library/*.m:
tests/invalid/type_loop.m:
tests/warnings/*.m:
Remove usused interface imports, or move them into
implementation (mostly bool, list and std_util).
library/*.m:
Improve the documentation.
Add a "Stability: low/medium/high" comment to all modules,
which describes the stability of the interface to that module.
ops.m:
Add `:' as an infix operator.
require.m:
Implement require/1, since higher-order predicates now work.
term.m:
Use the type `comparison_result' from mercury_builtin.m,
rather than defining an identical type `comparison'.