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: 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: 24
Branches: main
Add two new command line tools "mslice" and "mdice", which manipulate slices
and dices respectively. The functionality of "mdice" duplicates the
functionality of mdb's current "dice" command, while the functionality of
"mslice" is new.
runtime/mercury_trace_base.[ch]:
When generating trace count files, include information about the
context of each execution count. While mdb has access to this
information in the running program, mslice and mdice do not.
In any case, the code in mdb for looking up this information was
terribly inefficient.
Provide a mechanism for recording all execution counts, even the zero
ones, for use in coverage testing. This mechanism is not used yet.
Put a header on trace counts files, to make them recognizable as such.
Make this header indicate whether we are including zero trace counts.
runtime/mercury_wrapper.c:
Provide a flag in MERCURY_OPTIONS for turning on recording of
zero execution counts.
browser/dice.m:
mdbcomp/slice_and_dice.m:
Move most of the code of browser/dice.m to mdbcomp/slice_and_dice.m,
much modified; browser/dice.m is now empty. The modifications are
as follows.
Factor out the code for reading dices, since dices are useful
independent of mdb's dice command.
Generalize the code for computing dices to allow either or both
of the slices being subtracted to be specified as the union of
one or more trace counts files.
Add two more sort conditions for comparing the execution counts
in two slices: ascending and descending versions of simple execution
count differences.
For each operation we have so far performed on dices, add code
for performing that operation on slices.
browser/mdb.m:
Delete the include of dice.m, since it is now empty.
Delete a duplicate include_module of term_rep, and delete the now
unnecessary include_modules of set_cc and tree234_cc.
mdbcomp/mdbcomp.m:
Add slice_and_dice.m as a submodule.
mdbcomp/trace_counts.m:
Provide a mechanism to allow a slice to be specified as coming not
from a single trace count file but from the union operation on a set
of trace count files.
Convert to four-space indentation to eliminate some excessively
indented lines.
slice/mdice.m:
slice/mslice.m:
The main modules of two new commands. Their functionality is almost
entirely in mdbcomp/slice_and_dice.m and mdbcomp/trace_counts.m.
slice/Mmakefile:
New Mmakefile for building mslice and mdice. It is modelled on
profiler/Mmakefile.
slice/Mercury.options:
Empty file, for use in the future.
slice/.nocopyright:
Don't require copyright notice in Mercury.options.
Mmakefile:
Process the slice directory at appropriate points when processing
other directories.
compiler/tupling.m:
Conform to the updated interface of mdbcomp/trace_counts.
library/list.m:
Add versions of list__map for some more arities, for use in the code
above.
trace/mercury_trace_internal.c:
Generalize the code for specifying dices to allow either or both
of the slices being subtracted to be specified as the union of
one or more trace counts files.
Fix several places where we weren't checking the return value of
malloc. Fix two places where we could conceivably free strings that
were still alive. Fix some places where we could pass NULL strings
to Mercury code, and some places where we could free NULL pointers
(which, once upon a time, was not guaranteed to work on all platforms).
Use existing functions such as MR_copy_string where appropriate.
tests/run_one_test:
Fix two small bugs in this script: make the filenames more user
friendly, and make sure that gzip isn't asked to overwrite an
existing file, since that causes it to ask a question on stdout
and to wait for an answer.
tools/bootcheck:
Copy or link the slice directory into stage 2. Rename the
--copy-profiler option as --copy-profilers, since it now copies three
directories containing performance engineering tools: profiler,
deep_profiler and slice.
Estimated hours taken: 0.75
Branches: main
library/queue.m:
library/svqueue.m:
Added to_list, put_on_front, put_list_on_front, and get_from_back.
Added svqueue.put_on_front, svqueue.put_list_on_front, and
svqueue.get_from_back.
Cosmetic changes to comments in svqueue.m.
NEWS:
Mention the new additions.
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: 0.1
Branches: main
library/queue.m:
Add a function queue.from_list/1 that is a synonym
for queue.list_to_queue/1.
NEWS:
Mention the new function.
Shift the description of the term_to_xml module. It
had ended up under the changes for 0.11 for some reason.
s/ad/as/ in a spot.
Estimated hours taken: 8
Branches: main
library/*.m:
Bring these modules up to date with our current style guidelines.
Use predmode declarations where appropriate. Use state variable syntax
where appropriate. Reorder arguments where this makes it possible to
to use state variable syntax. Standardize format of predicate
description comments. Standardize indentation.
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/queue.m:
Fix a bug in queue__delete where the constraint that the `off'
list is empty if and only if the queue is empty was not being
preserved in all cases.
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: 0.5
library/queue.m:
Fix an inefficiency where in some circumstances, queue__head
could take O(n) time where n is the number of elements in the
queue. The fix is to impose (and maintain!) an extra
constraint on the queue data structure which guarantees that
the bad case never turns up.
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).
Estimated hours taken: 5
Remove support for term_to_type and type_to_term implemented as special
preds. Remove support for one-cell and one-or-two-cell type_infos (now
shared-one-or-two-cell type_infos). Move definitions that were in
mercury_builtin.m back to where they belong.
This code has been removed because it is no longer used, and was no
longer being maintained but was still quite complex.
compiler/globals.m:
compiler/handle_options.m:
compiler/mercury_compile.m:
compiler/options.m:
Remove one_cell and one_or_two_cell from type_info methods.
compiler/polymorphism.m:
Remove term_to_type and type_to_term support.
Remove one_cell and one_or_two_cell from type_info methods.
Fix documentation to reflect the new situation.
compiler/special_pred.m:
compiler/unify_proc.m:
Remove term_to_type and type_to_term support.
library/list.m:
Put the definition of `list' back into list.m
library/mercury_builtin.m:
Take the definitions of `list', `term', `var', `var__supply',
etc, out of this module.
Remove type_to_term, term_to_type, det_term_to_type,
term__init_var_supply, term__create_var, term__var_to_int
and term__context_init.
Remove references to USE_TYPE_TO_TERM and #ifdefs around
SHARED_ONE_OR_TWO_CELL_TYPE_INFO.
library/std_util.m:
Remove references ONE_OR_TWO_CELL_TYPE_INFO, and code that
handles one-cell typeinfo comparisons.
library/term.m:
Add type_to_term, term_to_type, det_term_to_type,
term__init_var_supply, term__create_var, term__var_to_int
and term__context_init back to term.m.
Add new implementation of type_to_term/2.
library/uniq_array.m:
Fix a typo in a comment - term_to_type/3 instead of term_to_type/2.
runtime/call.mod:
Remove special case code for unify, compare, index for
one-cell typeinfos.
Remove code for type_to_term/2.
runtime/type_info.h:
Remove references to ONE_CELL_TYPE_INFO or ONE_OR_TWO_CELL_TYPE_INFO.
Make sure only SHARED_ONE_OR_TWO_CELL_TYPE_INFO.
Remove references to USE_TYPE_TO_TERM.
compiler/base_type_layout.m:
compiler/bytecode_gen.m:
compiler/code_util.m:
compiler/delay_slot.m:
compiler/det_util.m:
compiler/fact_table.m:
compiler/hlds_data.m:
compiler/hlds_goal.m:
compiler/mode_debug.m:
compiler/tree.m:
library/bag.m:
library/queue.m:
Import module `list' or `term' (or both).
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'.
list:
added a list__chunk primitive.
std_util:
added bool__or_list, bool__and_list, and bool__not.
others:
suppressed determinism warnings by changing declarations from nondet to
multidet and with judicious use of semidet_fail and semidet_succeed.
lots of files:
Make a start at implementing code generation for complicated
unifications. In the HLDS, change complicated_unify/4 to
complicated_unify/2 since we didn't need the extra two args
after all.
peephole.nl:
A couple of minor efficiency improvements.
queue.nl:
Add queue__queue_to_list/2.
mercury_builtin.nl:
Use det_pred(...), semidet_pred(...), nondet_pred(...)
rather than call_pred(...) for the higher-order predicate modes.
prog_io.nl, io.nl, varset.nl, etc.
Add determinism annotations.
hlds.nl, make_hlds.nl, LOTS of other files:
Reorganize the way the predicate table works.
Make hlds.nl a bit more modular.
Change call/4 to call/5.
Remove all/2 from the hlds.
Changed pred_id to an integer.
Added pred_call_id which is similar to the old pred_id.
Makefile:
Add a rule for creating *.hlds_dump.
array.nl:
Fix determinism error.
det_analysis.nl:
Fix a bug in printing determinism warnings.
fix_errors.sed:
Modify this so it allows all the `inferred nondet' determinism
errors but none of the `inferred semidet' ones.
llds.nl:
Rename llds__pred_mode_id as llds__proc_id.
mode_errors.nl:
Finally got around to implementing Zoltan's suggestions
about the error messages from the mode analysis.
If an error occurs in a conjunction, only one error message
is printed out - the first error which doesn't relate to
a head unification.
modes.nl:
Handle X = f(X) properly. NB: determinism analysis and code
generation still get it wrong!
undef_modes, undef_insts:
I've broken the error message code, since it's not easy
to print pred_ids. I just changed it so that it didn't
print the pred_ids out. Should fix this properly at some stage...
list.nl:
Comment out the difficult modes for same_list.
(A temporary hack until the mode system is improved.)
make_hlds.nl:
Fix scoping errors.
prog_io.nl:
Fix scoping error introduced by the DCG expansion of if-then-else.
map.nl:
Add map__is_empty/1.
mercury_to_mercury.nl:
Fix error in mode declaration.
modes.nl:
Fix bug where the waiting_goals_table in the delay_info structure
was not being correctly updated when we exited a conjunction
which contained a mode error.
queue.nl:
Use `[A|B]' instead of `A.B'.
Add a when declaration.
typecheck.nl:
Fix mode error.
Makefile:
Add a rule to create *.ugly using mercury_compile's
`--convert-to-Mercury' option.
set.nl:
Add set__singleton_set/2.
queue.nl:
Fix queue.nl so that all the operations have an amortised cost
of O(1), execept testing for equality which is O(N) (with a
moderately bad constant factor).