mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-15 01:13:30 +00:00
NEWS:
HISTORY:
Shift the 20.06.X news into the HISTORY file.
RELEASE_NOTES:
Bump the release version.
6446 lines
250 KiB
Plaintext
6446 lines
250 KiB
Plaintext
Prehistory
|
|
----------
|
|
|
|
We designed the Mercury execution algorithm in October 1993. We started
|
|
working on a Mercury compiler in December 1993. Semantic analysis
|
|
started working around May 1994. We started generating code around
|
|
August 1994; we started work on optimizations very soon after. The
|
|
compiler successfully compiled itself on 24 February 1995.
|
|
|
|
|
|
Mercury 0.1, April 8 1995
|
|
-------------------------
|
|
Initial beta-test release.
|
|
Very resource-hungry, not very well documented.
|
|
|
|
|
|
Mercury 0.2, April 18 1995
|
|
--------------------------
|
|
Much better error messages for determinism errors, much
|
|
faster compilation, much lower memory requirements for bootstrapping.
|
|
The C compilation is much faster and requires much less memory since we
|
|
now by default compile to one C function per procedure, but we also
|
|
improved the speed of the Mercury compiler itself by nearly 40% by
|
|
implementing some library predicates much more efficiently.
|
|
|
|
|
|
Mercury 0.2.5, 1 June 1995
|
|
--------------------------
|
|
Much better syntax error messages.
|
|
Better documentation, now including a library reference manual.
|
|
Added a GNU autoconf configuration script.
|
|
Ported to IRIX 5.
|
|
Added `multidet'.
|
|
Enabled the use of tag bits in combination with conservative garbage
|
|
collection (this improved the speed of the compiler by about 20%).
|
|
Compile directly to C rather than via the old .mod files, which were
|
|
post-processed by a Perl script (improves compilation speed, reduces
|
|
disk space requirements, removes dependency on Perl).
|
|
Lots of bug fixes.
|
|
|
|
|
|
Mercury 0.3, 18 July 1995
|
|
-------------------------
|
|
The first public release.
|
|
Better type error messages.
|
|
Better determinism error messages.
|
|
Only recompiles <module>_init.c after `mmake depend', rather than after
|
|
anything changes.
|
|
Ported to ULTRIX (N.B. - ULTRIX's /bin/sh sucks).
|
|
Avoid saving variables on the stack before negated contexts.
|
|
Don't embed label names as strings in the executable.
|
|
A few other efficiency improvements.
|
|
Lots of bug fixes.
|
|
Made the rule for `mmake clean' less reckless (don't do `rm -f *.c').
|
|
Rationalized the options to `mc'. Implemented a couple of new ones.
|
|
Added a symbol demangler to improve linker error messages.
|
|
Made very significant improvements to the documentation.
|
|
Added a "Prolog to Mercury transition guide".
|
|
|
|
|
|
Mercury 0.4, 14 September 1995
|
|
------------------------------
|
|
|
|
* Higher-order predicates and lambda expressions are now implemented.
|
|
(This means that `call/{1,2,3,4}' and `solutions/2' are now usable;
|
|
unfortunately call/{5,6,...} are still not yet implemented.)
|
|
* Unique modes are now partially implemented (but don't use them
|
|
for anything except I/O, as the implementation is not yet complete).
|
|
* Partially instantiated modes are now closer to being fully
|
|
implemented.
|
|
* The installation process is more standard (basically
|
|
just `configure; make; make install').
|
|
* Autoconfiguration is a bit more robust.
|
|
* `msc' and `mnc' now produce somewhat smaller object files.
|
|
* Error and warning messages are a little better in some cases.
|
|
* Fixed a few code generation bugs.
|
|
* Ported to DEC Alpha/OSF and BSDI BSD/386.
|
|
* We've improved the efficiency of the 386 port by about 70%.
|
|
(50% because asm_fast.gc mode now works on the 386, the rest
|
|
due to better optimization).
|
|
* We generate better code for calls to `\='.
|
|
* We generate better code for `compare/3'.
|
|
* A few other new optimizations.
|
|
* The profiler now works (see the documentation in the Mercury
|
|
User's Guide).
|
|
* Some new library predicates, including `string__format'
|
|
(like C's sprintf).
|
|
* `set__join/2' has been renamed as `set__power_union/2'.
|
|
* `list__sort/2' has been renamed as `list__sort_and_remove_dups/2'.
|
|
* There is a new `list__sort/2' which does not remove duplicates.
|
|
|
|
|
|
Mercury 0.5, 15 February 1996
|
|
-----------------------------
|
|
|
|
* We now support committed choice nondeterminism in a logical and declarative
|
|
fashion, using the new determinism categories `cc_nondet' and `cc_multi'.
|
|
Like `nondet' and `multi' respectively, they specify that a predicate
|
|
may have more than one solution, but they convey the additional
|
|
assertion that the predicate will only be used in contexts in which
|
|
only one solution is needed. The compiler will check that all uses
|
|
of the predicate satisfy this requirement. Having proven the
|
|
assertion to be correct, the compiler can then generate much more
|
|
efficient code for the predicate. By pushing pruning inwards, the
|
|
compiler can often avoid creating choice points at all.
|
|
|
|
* We now check for backtracking over unique modes.
|
|
(This may potentially break some programs using unique modes in ways
|
|
that the compiler can't prove are safe. In such cases, replacing
|
|
`multi' with `cc_multi' should solve the problem. If you have any
|
|
trouble with this, we'll be happy to help you.)
|
|
We have also added "mostly unique" modes, which provide support
|
|
for backtrackable destructive update.
|
|
See the Mercury Language Reference Manual.
|
|
|
|
* We now provide genuine arrays with destructive update.
|
|
See the library module `uniq_array'. (Warning: this has not had
|
|
much testing. The interface is not yet stable.)
|
|
|
|
* We now support interfacing to C code.
|
|
See the documentation in the Mercury Language Reference Manual.
|
|
|
|
* There is now an `inline' pragma which you can use as a hint to the
|
|
compiler to inline a particular predicate.
|
|
|
|
* We've ported the system to ULTRIX (thanks to Gertjan van Noord
|
|
and especially Eero Pajarre).
|
|
|
|
* We now support shared libraries for IRIX 5.
|
|
|
|
* We now allow the use of compilers other than gcc -
|
|
see the user's guide for details.
|
|
We don't recommend the use of compilers other than gcc,
|
|
since the inability to use gcc's special features will
|
|
most likely lead to much less efficient code.
|
|
|
|
* To complement our source distribution, we now also provide binary
|
|
distributions for a variety of platforms. Installation should be
|
|
quick and easy.
|
|
|
|
* Various other minor improvements:
|
|
- In portable C mode, we now generate better code for loops.
|
|
- We've made a few other minor improvements in the generated code.
|
|
- Unary plus and minus are now implemented.
|
|
- Updated the documentation to reflect changes in unique modes.
|
|
- Corrected a lot of typos in the documentation.
|
|
- Fixed quite a few bugs.
|
|
|
|
* Parts of the library module `std_util' have been moved into separate
|
|
modules `assoc_list' and `bool'; if you have existing code which
|
|
used those parts of `std_util', you may need to add `import_module'
|
|
declarations to import `assoc_list' and/or `bool'.
|
|
|
|
|
|
Mercury 0.6, 2 August 1996
|
|
--------------------------
|
|
|
|
* We now provide preliminary support for type and mode inference.
|
|
|
|
The `:- pred' and `:- mode' declarations are now optional for
|
|
predicates that are local to a module; the compiler will infer
|
|
the types and modes automatically.
|
|
|
|
This support is not yet complete, and so type and mode inference are
|
|
not enabled by default. They can be enabled using the `--infer-types'
|
|
and `--infer-modes' options. The limitations of the current
|
|
implementation are: (1) type inference loops for certain very rare
|
|
type-incorrect programs; (2) mode inference doesn't support
|
|
reordering; (3) there are some modes which the current mode inference
|
|
algorithm is not capable of inferring.
|
|
|
|
Note that omitting type and mode declarations can significantly
|
|
reduce the quality of the compiler's error messages; if you have
|
|
trouble understanding an error message, then it is a good idea to add
|
|
explicit type and mode declarations.
|
|
|
|
* We now support functional syntax.
|
|
|
|
Functions can be declared with `:- func' declarations,
|
|
and defined using equations or conditional equations,
|
|
in a similar manner to the way predicates are declared
|
|
with `:- pred' declarations and defined using facts and rules.
|
|
Terms can contain function calls and if-then-elses.
|
|
For example:
|
|
|
|
:- func sum(list(int)) = int.
|
|
sum([]) = 0. % unconditional equations
|
|
sum([X|Xs]) = X + sum(Xs). % using function calls
|
|
|
|
:- func max(int, int) = int.
|
|
max(X, Y) = Max :- % conditional equation
|
|
(X >= Y -> Max = X ; Max = Y).
|
|
|
|
:- func min(int, int) = int.
|
|
min(X, Y) = (if X >= Y then X else Y). % unconditional equation
|
|
% using if-then-else expression
|
|
|
|
By default, functions are assumed to have a single det mode with
|
|
all arguments input and the result output, but you can override
|
|
this default by supplying explicit mode declarations; for example,
|
|
this allows you to use functions in a backwards mode to compute the
|
|
function inverse.
|
|
|
|
Zero-arity functions can be used to define constants.
|
|
|
|
:- func pi = float.
|
|
pi = 3.14159265359.
|
|
|
|
We also support higher-order functions and function lambda expressions.
|
|
See the Mercury Language Reference Manual for details.
|
|
|
|
The support for functions is not quite complete; there is one minor
|
|
limitation and one major one. The minor limitation is that the C
|
|
interface does not yet support Mercury functions. (Fortunately there
|
|
is an easy work-around - since the C interface does support predicates,
|
|
you can just make your Mercury function call a Mercury predicate.)
|
|
The major limitation is that there is currently no support for
|
|
debugging programs using functional syntax; obviously using a Prolog
|
|
system won't work, since Prolog doesn't support functions.
|
|
|
|
* We now support overloading of predicates (and functions) with the
|
|
same name and arity defined in different modules.
|
|
|
|
Previously, an explicit module qualifier was required to resolve the
|
|
ambiguity; now, the typechecker will use the types to resolve the
|
|
ambiguity, if possible. (Note that you cannot define more than one
|
|
predicate with the same name and arity in the same module. Allowing
|
|
that would add considerable complexity to the syntax, and would be
|
|
of arguable utility, so we do not anticipate lifting that restriction.)
|
|
|
|
* We now support defining types with the same name in different modules.
|
|
|
|
Previously this resulted in multiply defined symbol errors in certain
|
|
circumstances, e.g. when profiling.
|
|
|
|
* We have removed the limitations on the number and order of arguments in
|
|
higher-order predicate calls.
|
|
|
|
* Support for floating point is much improved.
|
|
|
|
The above-mentioned support for functional syntax and overloading
|
|
have enabled major improvements in the interface used for floating
|
|
point. You can now use the usual arithmetic and comparison
|
|
operators, rather than the cumbersome builtin_float_plus (etc.)
|
|
predicates that were used previously. We have also improved code
|
|
generation for floating point operations, by avoiding many
|
|
unnecessary boxing/unboxing operations, and by making the
|
|
`--static-ground-terms' optimization apply also to floating point
|
|
constants. These two optimizations improved performance on the
|
|
realistic "pseudoknot" benchmark by nearly a factor of four.
|
|
(There's still plenty of room for performance improvements, however.)
|
|
|
|
* We now support reverse mode arithmetic.
|
|
|
|
This means that a goal such as `A is B + C' can be used not only to compute
|
|
A from B and C, but also to compute B from A and C, or to compute C from
|
|
A and B.
|
|
|
|
* We have added some new compiler options to simplify the choice of which
|
|
optimization options to enable.
|
|
|
|
- You can now use `-O<n>' to select an optimization level between -1 and 6.
|
|
The default level is `-O2'; if you want to minimize compilation
|
|
time, compile with `-O0', which disables all optimizations except those
|
|
that actually improve overall compilation speed.
|
|
|
|
- You can now use `--optimize-space' to select optimization for space,
|
|
instead of optimization for time (which is the default).
|
|
|
|
* We have continued to improve the compiler's optimization.
|
|
|
|
As well as the above-mentioned improvements to float-point code generation:
|
|
|
|
- We now specialize calls to higher-order predicates within the same module
|
|
in the case when the higher-order arguments have known values.
|
|
This optimization is enabled by the `--optimize-higher-order' option.
|
|
|
|
- We now specialize calls to predicates within the same module which have
|
|
unused arguments. This often happens for polymorphic predicates, since
|
|
the compiler introduces type_info arguments which are often unused.
|
|
This optimization is enabled by the `--optimize-unused-args' option.
|
|
|
|
- The `--inlining' option now governs the settings of three separate options.
|
|
One, `--inline-simple', reproduces the previous behavior of `--inlining':
|
|
it inlines procedures whose definition is simple (e.g. a conjunction of
|
|
builtins). Another, `--inline-single-use', tells the compiler to inline
|
|
all procedures that are called exactly once. The compiler can also
|
|
inline procedures called more than once as long as they are not too
|
|
big; the argument of the option `--inline-threshold' sets a limit
|
|
on the size of the procedure definition (roughly in terms of the number
|
|
of logical connectives it has) multiplied by the number of calls to
|
|
the predicate.
|
|
|
|
- There's a new option `--optimize-dead-proc' option to eliminate unused
|
|
procedures within a module. This is useful even if the original source
|
|
code didn't contain any unused procedures, since inlining and code
|
|
specialization can make a procedure unused even if there original source
|
|
had calls to that procedure.
|
|
|
|
- There's a new option `--split-c-files' which causes the compiler to put
|
|
each C function in its own C file, so that the linker can link in only
|
|
what is used, and a new Mmake target `foo.split' for
|
|
building a version of `foo' compiled with `--split-c-files'.
|
|
(`--split-c-files' has much the same effect as `--optimize-dead-proc',
|
|
except that it works globally, not just within a module.)
|
|
On platforms for which we don't support shared libraries, installing
|
|
a split version of the Mercury library fixes the problem of dumb Unix
|
|
linkers dragging in nearly the entire library even if most of it is
|
|
unused, and so reduces the size of a hello world program from >400k
|
|
to around 120k.
|
|
|
|
- The code generator generates special code for dense switches in
|
|
which all the output variables are constant terms. Instead of
|
|
generating dense jump tables, it puts the answers in static constant
|
|
arrays, and retrieves them using array indexing, avoiding
|
|
an expensive jump and reducing code size.
|
|
|
|
- The code generator now emits better code for constructing deeply nested
|
|
terms, and avoids some unnecessary register shuffling.
|
|
|
|
- The value numbering optimization now processes code sequences
|
|
containing several heap allocations.
|
|
|
|
- The `--pred-value-number' option now works. If it is given, and
|
|
value numbering notices that a value is available from a location
|
|
that is faster to access than the one from which another code
|
|
sequence retrieves the value, this other code sequence will be
|
|
reoptimized taking this into account.
|
|
|
|
* We now support a C-to-Mercury interface, ie. we allow C code to call
|
|
Mercury predicates, using a new `pragma export' declaration.
|
|
(Unfortunately, this is not yet documented. There is however a
|
|
fairly detailed and reasonably well-documented example in the
|
|
samples/c_interface/c_calls_mercury directory.)
|
|
|
|
* We have added a little bit of inline assembler code for the Alpha so
|
|
that we can support the use of gcc non-local gotos and asm labels.
|
|
This improved both code size and execution speed for the Alpha port
|
|
by about 20-25%.
|
|
|
|
* We have ported the Mercury implementation to RS/6000 systems running AIX.
|
|
(Thanks to Andreas Kuehlmann.)
|
|
|
|
* We have made a few changes to the Mercury standard library.
|
|
The changes are listed here, but see the Mercury Library Reference Manual
|
|
for details such as documentation on the new predicates.
|
|
|
|
- The getopt library is now more flexible. It can handle command
|
|
line switches (such as `-O2') that affect the values of many
|
|
options, and it can handle long options that specify a value after
|
|
an equal sign, in the GNU style (e.g. `--optimization-level=2').
|
|
|
|
- We have added a few new predicates using higher order facilities:
|
|
list__map/3, list__filter/3, list__filter/4, list__foldl/4,
|
|
list__foldr/4, list__sort/4 and list__merge/4 in list.m and
|
|
maybe_pred/3 in std_util.m.
|
|
|
|
- There are a couple of new all-solutions predicates in std_util.m:
|
|
solutions_set/2 and unsorted_solutions/2.
|
|
|
|
- We have added some additional predicates for handling association lists:
|
|
assoc_list__search/3 and assoc_list__remove/4.
|
|
|
|
- There are a few new predicates for converting floats to ints:
|
|
float__ceiling_to_int/2, float__floor_to_int/2
|
|
float__round_to_int/2, and float__truncate_to_int/2.
|
|
|
|
- There are quite a few changes to the graph module. The interface has been
|
|
made more consistent with the rest of the library. The predicate
|
|
graph__lookup_node/3 has been replaced by two predicates:
|
|
graph__search_node/3 which is nondet and returns all the nodes with
|
|
matching data, and graph__find_matching_nodes/3 which is det and
|
|
returns all the nodes with matching data.
|
|
|
|
- We have renamed the varset__lookup predicates to varset__search in order to
|
|
conform to our general naming convention.
|
|
|
|
- We have removed the (undocumented) library predicate list__map_maybe/3.
|
|
|
|
- The set module is now implemented using sorted lists rather than
|
|
unsorted lists. (The interface is still the same.) The old
|
|
unsorted lists representation is still available, in the
|
|
set_unordlist module.
|
|
|
|
|
|
Mercury 0.7, 15 August 1997
|
|
---------------------------
|
|
|
|
* The Mercury language now supports higher-order syntax.
|
|
|
|
You can now write `P(X)' as an alternative to `call(P, X)'
|
|
or `F(X)' as an alternative for `apply(F, X)'.
|
|
|
|
* Module qualifiers are now optional.
|
|
|
|
You can use just plain `write_string' rather than `io__write_string'.
|
|
|
|
* There is a new `:- use_module' directive.
|
|
|
|
This is the same as `:- import_module', except all uses of the imported
|
|
items must be explicitly module qualified.
|
|
|
|
More changes to the module system are expected in the future,
|
|
possibly including changing the module qualifier operator to `.'.
|
|
Currently either `:' or `__' can be used as module qualifiers,
|
|
but we advise you to stick with using only `__' rather than `:',
|
|
to avoid problems in the future if we do change the module
|
|
qualifier to `.'.
|
|
|
|
* We've improved the C interface.
|
|
|
|
The C interface now handles Mercury functions properly --
|
|
previously it only handled predicates, not functions.
|
|
Also, exporting semidet predicates or functions to C now works.
|
|
We've improved the documentation, and we've included some examples
|
|
of how to use the C interface to interface with C++.
|
|
We also now support `main' being defined in C rather than in Mercury.
|
|
|
|
See samples/c_interface for examples of all of the above.
|
|
|
|
* We now support cross-module optimizations.
|
|
|
|
The `--intermodule-optimization' option enables cross-module inlining
|
|
and cross-module specialization of higher-order predicates.
|
|
Also `--intermod-unused-args' enables cross-module elimination of
|
|
unused input arguments.
|
|
|
|
* We've continued to improve the quality of the code we generate.
|
|
|
|
We now use a more efficient argument-passing convention, and the code
|
|
we generate for polymorphic predicates uses a more efficient "type-info"
|
|
representation than previous versions.
|
|
|
|
(Note that this means code generated by Mercury 0.7 is not compatible
|
|
with code generated by earlier versions, so you will need to
|
|
recompile any existing Mercury object files or libraries when you
|
|
install the new version.)
|
|
|
|
We handle floating point code a bit better. We don't box floating
|
|
point values on 64-bit architectures anymore, and on 32-bit
|
|
architectures we do a better job of avoiding unnecessary box/unbox
|
|
operations. We also make some use of floating point registers for
|
|
holding temporary values.
|
|
|
|
We've made several improvements to the code generator that result in
|
|
better code in common situations.
|
|
|
|
There's also a new optimization option, `--inline-alloc', which can
|
|
speed up code that does a lot of memory allocation by inlining the
|
|
GC_malloc() function. (This option is also enabled by `-O6'.)
|
|
|
|
* We now support ELF shared libraries on Linux.
|
|
|
|
See README.Linux for details.
|
|
|
|
Note that using shared libraries is not yet the default,
|
|
so if you want to take advantage of this, you must explicitly
|
|
enable it as described in README.Linux.
|
|
|
|
* We have added support for very large tables of facts.
|
|
|
|
See the documentation for `pragma fact_table' in the
|
|
"implementation-dependent pragmas" section of the Mercury
|
|
Language Reference Manual.
|
|
|
|
* We have fixed quite a few bugs.
|
|
|
|
Mode inference now works a little bit better.
|
|
|
|
We now allow a function of arity N to coexist with a predicate of
|
|
arity N+1.
|
|
|
|
The Mercury `char' type is now 8-bit clean (previously, "for
|
|
compatibility with NU-Prolog" we only supported 7-bit characters).
|
|
|
|
* The `mc' script has been renamed `mmc'.
|
|
|
|
This was done to avoid name clashes with the Midnight Commander
|
|
and the Modula Compiler.
|
|
|
|
* We've added `man' pages.
|
|
|
|
The documentation now includes Unix-style `man' pages for
|
|
most of the development tools, including mmake, mmc, mgnuc, ml,
|
|
and mprof. These supplement the existing documentation in the
|
|
Mercury User's Guide.
|
|
|
|
Most of the information in the man pages is also available using
|
|
the standard `--help' option.
|
|
|
|
* We've improved the compiler's diagnostics a bit.
|
|
|
|
Some of the compiler's error messages are a bit more informative, and
|
|
it catches some errors that previously it missed (such as specifying
|
|
modes in some but not all of the arguments of a `:- pred' declaration).
|
|
|
|
* We have made quite a few changes to the Mercury standard library.
|
|
|
|
The changes are listed here, but see the Mercury Library Reference Manual
|
|
for details such as documentation on the new predicates.
|
|
|
|
- The std_util.m module now contains functions and predicates for
|
|
traversing and constructing terms of arbitrary type, and for
|
|
accessing types at runtime.
|
|
|
|
+ For traversing terms:
|
|
Functions argument/3, det_argument/3, functor/3,
|
|
and predicate deconstruct/4. These are similar to
|
|
Prolog's arg/3, functor/3, and '=..'.
|
|
|
|
+ For constructing terms:
|
|
Functions num_functors/1, construct/3 and
|
|
predicate get_functor/5.
|
|
|
|
+ For accessing and constructing types:
|
|
Functions type_of/1, type_ctor/1, type_args/1,
|
|
type_ctor_name/1, type_ctor_arity/1, make_type/2,
|
|
and predicates type_ctor_and_args/3 and
|
|
type_ctor_name_and_arity/3.
|
|
|
|
There are also some new functions for accessing values of the
|
|
universal type `univ', namely univ/2 and univ_type/1.
|
|
|
|
- There is a new module called `prolog' which contains some predicates that
|
|
may be useful for compatibility with Prolog: arg/3, functor/3,
|
|
`=:=', `=\=', `==', `\==', `@<', `@>', `@=<', `@>='. We plan to
|
|
eventually move the definitions of cut (`!') and `is' here too.
|
|
|
|
- We've finally implemented generic input-output predicates,
|
|
namely io__print/3, io__write/3, and io__read/3, using the
|
|
functions and predicates described above. These can read or write
|
|
data of any type. We've also added io__nl/3 to print a newline.
|
|
Together with the change to make module qualifiers optional, these
|
|
changes make performing output quite a bit simpler; it's nice to be
|
|
able to write `print("Foo = "), print(Foo), nl'.
|
|
|
|
- We've also added generic predicates io__write_binary/3 and
|
|
io__read_binary/3, for doing binary I/O on values of any type.
|
|
(The current implementations actually just call io__read/3 and
|
|
io__write/3 respectively, though, so they're not maximally efficient.)
|
|
|
|
- The predicates term_to_type/2 and type_to_term/2, which convert
|
|
values of any type to or from type `term', are now implemented.
|
|
|
|
- We have a new module called benchmarking.m to make benchmarking easier.
|
|
The predicate report_stats, which used to be in std_util, is now
|
|
in this module.
|
|
|
|
- The interface to the relation.m module has been changed extensively.
|
|
Elements must now be explicitly added to the domain of the relation,
|
|
using relation__add_element/4, and relation operations such as
|
|
relation__add are now performed on relation_keys. There are also
|
|
four new operations which convert elements to relation_keys and
|
|
vice versa:
|
|
relation__search_element/3, relation__lookup_element/3,
|
|
relation__search_key/3, and relation__lookup_key/3
|
|
|
|
- We changed the order of the arguments to set_bbbtree__subset,
|
|
for consistency with the order in set__subset and elsewhere.
|
|
We also changed the implementation of set__subset and
|
|
set_ordlist__subset to match the behaviour specified in the
|
|
documentation.
|
|
|
|
- We made some extensive additions to bag.m to include the standard set
|
|
operations (union, intersection, subtraction), and some other predicates
|
|
for manipulating bags. We also changed bag__contains/2 (swapped the
|
|
arguments), and bag__remove (now semidet) to be consistent with set.m
|
|
and map.m.
|
|
|
|
- There are two new predicates io__tmpnam and io__remove_file,
|
|
with semantics similar to the ANSI C functions tmpnam() and remove().
|
|
|
|
- There are new predicates int__max_int, int__min_int, int__bits_per_int,
|
|
char__min_char_value, and char__max_char_value, with semantics similar
|
|
to INT_MAX, INT_MIN, (CHAR_BIT * sizeof(int)), CHAR_MIN, and CHAR_MAX
|
|
in ANSI C (respectively).
|
|
|
|
- We've added list__merge_and_remove_dups/4 and list__sort_and_remove_dups/4
|
|
to complete the set of list__merge and list__sort operations.
|
|
|
|
- We've added io__write_list/5 and io__write_list/6; these predicates write
|
|
lists using a user-specified procedure to write the elements and separating
|
|
the elements with a user-specified separator string.
|
|
|
|
- We've added io__read_file/{3,4} and io__read_binary_file/{3,4} which read
|
|
whole files (until error or eof).
|
|
|
|
- We've added a double accumulator version of list__foldl/4 called
|
|
list__foldl2/6, which is a convenient generalisation for accumulators
|
|
that also do I/O. Also, we've added list__map_foldl/5, which is an
|
|
amalgam of list__map/3 and list__foldl/4.
|
|
|
|
- We've added a new constructor `maybe_string' to getopt's option_data
|
|
type, for parsing optional string-valued command-line arguments.
|
|
See library/getopt.m for details. Also added to getopt are some
|
|
missing option-lookup predicates: getopt__lookup_accumulating_option/3
|
|
and getopt__lookup_maybe_string_option/3.
|
|
|
|
- We've added string__foldl to the library. It has the same semantics as
|
|
(string__to_char_list(String, Chars), list__foldl(Pred, Chars, Acc0, Acc))
|
|
but is implemented more efficiently.
|
|
|
|
- We've cleaned up the handling of integer division and modulus/remainder.
|
|
Previously the semantics of `//' and `mod' were not really well defined.
|
|
The semantics of `//' and `mod' have now been clarified and there are
|
|
new functions `div' and `rem'. `//' truncates towards zero, and `rem'
|
|
is remainder with respect to `//', whereas `div' truncates towards minus
|
|
infinity, and `mod' is remainder with respect to `div'.
|
|
|
|
- The old array.m module has been renamed bt_array.m (short for
|
|
"backtrackable array", or "binary tree array"), and uniq_array.m
|
|
has been renamed array.m. The interfaces of both modules have been
|
|
extended to make them closer to each other.
|
|
|
|
The following predicates have been added to array.m (formerly
|
|
uniq_array.m):
|
|
|
|
+ array__shrink/3: this is similar to array__resize/4 except
|
|
that it's designed for cases when you only want to make an
|
|
array smaller, so you don't have to supply a filler element.
|
|
|
|
+ array__min/2, array__bounds/3: find the lower bound or both
|
|
bounds (respectively) of an array. (In this implementation,
|
|
the lower bound is always 0.)
|
|
|
|
The following predicates have been added to bt_array.m (formerly
|
|
array.m):
|
|
|
|
+ bt_array__min/2, bt_array__max/2, bt_array__size/2: find
|
|
the lower bound, upper bound and size of a bt_array
|
|
respectively.
|
|
|
|
+ bt_array__in_bounds/2: check if an index is within the
|
|
bounds of a bt_array.
|
|
|
|
+ bt_array__semidet_set/4: the semidet version of bt_array__set/4.
|
|
|
|
+ bt_array__from_list/3: a replacement for bt_array__from_list/2,
|
|
which has been removed. The extra argument is the lower bound
|
|
for the new bt_array.
|
|
|
|
+ bt_array__shrink/4: analogous to array__shrink/3.
|
|
|
|
+ bt_array__resize/5: a replacement for bt_array__resize/4. There
|
|
was a design flaw in the previous interface, in that if the
|
|
array increased in bounds, the extra slots were filled with one
|
|
particular element from the old bt_array. The extra argument is
|
|
the element to use to fill these slots instead.
|
|
|
|
* There is a new `extras' directory in the distribution that contains
|
|
some additional libraries. These provide support for the following
|
|
application areas:
|
|
|
|
- graphics using Tk and OpenGL
|
|
|
|
- arithmetic on complex and imaginary numbers
|
|
|
|
- processing HTML forms using the CGI interface.
|
|
|
|
|
|
Mercury 0.7.2, 13 October 1997
|
|
------------------------------
|
|
|
|
We have split the distribution into two parts, a `core' part and an
|
|
`extras' part. We still recommend that people get both parts.
|
|
|
|
Changes to the Mercury language:
|
|
********************************
|
|
|
|
* We have added support for constraint handling.
|
|
|
|
To support constraint handling, we've made the mode system a bit
|
|
more flexible. There is a new inst `any' for variables whose value
|
|
is unknown but which may have constraints on them.
|
|
|
|
The support for `any' insts is not 100% complete; in particular, we
|
|
do not support passing values of inst `free' where values of inst
|
|
`any' are expected, so sometimes you have to explicitly call a predicate
|
|
to initialize a free variable to inst `any'. Also the Mercury language
|
|
reference manual does not yet contain any documentation on `any' insts.
|
|
|
|
The `extras' distribution includes packages for doing constraint
|
|
solving on (a) floating point numbers and (b) terms containing
|
|
Prolog-style variables. See below.
|
|
|
|
* The C interface now includes generalized trailing support.
|
|
|
|
The compiler has a new set of grades `*.tr' (e.g. `asm_fast.gc.tr')
|
|
which provide support for trailing. They could be used by predicates or
|
|
functions defined using the C interface to perform such things as
|
|
constraint solving, backtrackable destructive update, or even automatic
|
|
unwinding of database transactions on backtracking. See the
|
|
documentation in the "Trailing" section of the Mercury language
|
|
reference manual (it's at the end of the "C interface" section,
|
|
which is in the chapter on "Pragmas").
|
|
|
|
* It is now possible to stop the compiler from optimizing "impure"
|
|
Mercury code inappropriately.
|
|
|
|
This is accomplished by declaring impure predicates to be impure,
|
|
allowing the compiler to treat them cautiously. The compiler tracks
|
|
impurity, and requires all impure predicates, and calls to them, to
|
|
be declared. For more information, see "Impurity" section of the
|
|
"Pragmas" chapter of the Mercury Language Reference Manual.
|
|
|
|
* We now support user-defined equality predicates.
|
|
|
|
See the Mercury Language Reference Manual for details.
|
|
|
|
However, until we have support for type classes (coming soon :-),
|
|
you will probably run into trouble if you try to use compare/3,
|
|
write/1, functor/2, etc., on a type with user-defined equality.
|
|
Hence we recommend that this feature should not yet be used.
|
|
Because of this, we haven't bothered to document the
|
|
rationale or use for user-defined equality predicates
|
|
(though rest assured that when we do have type classes,
|
|
this feature will indeed be useful).
|
|
|
|
* We have introduced new syntax to allow higher-order predicate expressions
|
|
to use DCG notation.
|
|
|
|
For details, see the "Data-terms" section of the "Syntax" chapter
|
|
and/or the "Creating higher-order terms" section of the "Higher-order"
|
|
chapter in the Mercury Language Reference Manual.
|
|
|
|
|
|
Changes to the Mercury standard library:
|
|
****************************************
|
|
|
|
* We have rewritten the `store' module to use unique modes.
|
|
|
|
The `store' module provides a declarative interface to mutable variables
|
|
with destructive update.
|
|
|
|
* The library predicate unsorted_aggregate/4 in std_util.m
|
|
now interleaves calls of the aggregation predicate with
|
|
the generation of solutions, rather than first finding all
|
|
solutions and then aggregating them. This allows you
|
|
to print out solutions as they are found, for example.
|
|
|
|
* We have added a few new predicates, namely list__takewhile/4,
|
|
bag__to_list/2, and varset__new_named_var/4.
|
|
|
|
* We have changed the interface to lexer__get_token_list to use a more
|
|
efficient representation of lists of tokens. The functionality is
|
|
unchanged.
|
|
|
|
* We have fixed a problem where io__call_system/4 was not returning
|
|
the exit code of the invoked command on some operating systems.
|
|
|
|
* We have fixed a bug in relation__rtc/4.
|
|
|
|
* We have added the predicate queue__delete_all/3.
|
|
|
|
* Map (and tree234) have 2 new predicates: map__foldl which is
|
|
analogous to list__foldl, and map__map_values which is analogous
|
|
to list__map.
|
|
|
|
* We have added integer.m, which implements arbitrary precision integers,
|
|
and rational.m, which implements arbitrary precision rational numbers.
|
|
|
|
|
|
New library packages in the `extras' distribution:
|
|
**************************************************
|
|
|
|
* We have added a CLP(R) interface.
|
|
|
|
The new library package `cfloat_lib', in the extras/clpr directory,
|
|
is a Mercury interface to the CLP(R) constraint solver. The module
|
|
`cfloat' defines a type `cfloat' for constrained floating point numbers,
|
|
together with the usual arithmetic operators (+, -, *, /, <, >, =<, >=)
|
|
as well as some non-linear constraint functions (abs, min, max,
|
|
sin, cos, arcsin, and arccos). The module `dump' provides I/O predicates
|
|
for printing out constraints.
|
|
|
|
Note that since `cfloat' is a different type than `float', you
|
|
have to use the `==' operator provided in this package rather
|
|
than `=' if you want to unify a cfloat with a float.
|
|
|
|
We don't yet support any equivalent to SICStus Prolog's
|
|
call_residue/3 or the three-argument version of CLP(R)'s dump predicate.
|
|
|
|
But apart from that, it all works nicely. And even though we support
|
|
equivalents to such nasty non-logical meta-programming constructs
|
|
as CLPR's `dump' primitive, we still manage to preserve referential
|
|
transparency -- the interface provided is a completely pure declarative
|
|
interface.
|
|
|
|
* We have added some support for Prolog-style variables and coroutining.
|
|
|
|
The module extras/trailed_updated/var.m provides a type `var(T)'
|
|
which is a Prolog-style variable that holds a value of type T.
|
|
These variables can have the new inst `any' described above.
|
|
There's also an implementation of freeze/2, for coroutining
|
|
(dynamic scheduling). The extras/trailed_update/samples subdirectory
|
|
has an example of the use of freeze/2 to solve the N-queens problem.
|
|
|
|
* We have added library modules for backtrackable destructive update.
|
|
|
|
See the new modules `tr_array' and `tr_store' in the extras/trailed_update.
|
|
These are versions of `array' and `store' that use trailed backtrackable
|
|
destructive update. The extras/trailed_update/samples subdirectory
|
|
has an example of the use of tr_store to provide a reasonably efficient
|
|
meta-interpreter.
|
|
|
|
* We have added an interface to ODBC databases in extras/odbc.
|
|
|
|
Thanks to the people from Mission Critical, in particular Renaud Paquay,
|
|
for providing the original version.
|
|
|
|
|
|
Changes to the Mercury compiler:
|
|
********************************
|
|
|
|
* We have added support for termination analysis.
|
|
|
|
For details, see the "Termination analysis" subsection of the
|
|
"Implementation-dependent pragmas" section of the "Pragmas" chapter
|
|
of the Mercury Language Reference Manual.
|
|
|
|
This implementation is experimental, but our tests show that it is
|
|
capable of proving the termination of most predicates and functions
|
|
in real programs.
|
|
|
|
The current implementation of termination analysis depends on the
|
|
third-party package lp_solve. This is package is available from
|
|
<ftp://ftp.es.ele.tue.nl/pub/lpsolve>; it is also included in the
|
|
lp_solve subdirectory of the Mercury source distribution. Note
|
|
that the copyright of lp_solve includes substantial restrictions.
|
|
|
|
Details of the analysis are available in "Termination Analysis for
|
|
Mercury" by Chris Speirs, Zoltan Somogyi and Harald Sondergaard. In P.
|
|
Van Hentenryck, editor, "Static Analysis: Proceedings of the Fourth
|
|
International Symposium", Lecture Notes in Computer Science. Springer,
|
|
1997. A longer version is available for download from
|
|
<http://www.cs.mu.oz.au/publications/tr_db/mu_97_09.ps.gz>.
|
|
|
|
* We have made it easier to use different compilation models ("grades").
|
|
|
|
The Mercury compiler (mmc), the Mercury front-end to GNU C (mgnuc),
|
|
and the Mercury linker (ml) now figure out which grade to use based
|
|
on the options specified. This means that for example to enable
|
|
profiling, you can just compile and link with `--profiling', rather
|
|
than having to specify grade `asm_fast.gc.prof'.
|
|
|
|
Attempts to mix object files compiled with different grades should now
|
|
result in errors at link time rather than undefined behaviour.
|
|
|
|
* We have improved the C interface.
|
|
|
|
We now handle the case when `main' is defined in C rather than in Mercury
|
|
slightly more cleanly -- there are functions mercury_init()
|
|
and mercury_terminate() for initializing and terminating the
|
|
Mercury runtime. See runtime/init.h for documentation of the functions,
|
|
and see samples/c_interface/simpler_c_calls_mercury for an example of
|
|
their use.
|
|
|
|
* The compiler does a better job of constant-propagation optimization.
|
|
|
|
* We have fixed a few minor bugs.
|
|
|
|
|
|
Mercury 0.7.3, 1 November 1997
|
|
------------------------------
|
|
|
|
This release is primarily a bug-fix release. The problems fixed
|
|
include installation problems on Windows, some problems with the
|
|
profiler, and compatibility with GNU Make versions >= 3.76.
|
|
But as well as bug fixes, there are a few minor improvements:
|
|
|
|
* The profiler now allows you to merge profiling data from multiple runs.
|
|
|
|
There's a new script `mprof_merge_runs' to support this.
|
|
See the "Profiling" section of the Mercury User's Guide,
|
|
or the man page for `mprof_merge_runs'.
|
|
|
|
* Termination analysis no longer uses the `lp_solve' package,
|
|
so we have removed it from the distribution.
|
|
|
|
This avoids some portability problems and some copyright issues
|
|
(the `lp_solve' package had a quite restrictive license).
|
|
|
|
* We've fixed one of the limitations: unique mode declarations
|
|
no longer have to precede non-unique mode declarations.
|
|
|
|
|
|
Mercury 0.7.4, 1 November 1997
|
|
------------------------------
|
|
|
|
This release just corrected a couple of bugs in the binary
|
|
distribution for 0.7.3.
|
|
|
|
|
|
Mercury 0.8, 18 November 1998
|
|
-----------------------------
|
|
|
|
Changes to the Mercury language:
|
|
********************************
|
|
|
|
* The type system now includes support for Haskell-style type classes.
|
|
|
|
Type classes let you specify an interface and then provide multiple
|
|
different implementations of that interface. They're similar to
|
|
abstract base classes in C++ or "interfaces" in Java.
|
|
See the "Type classes" chapter of the Mercury Language Reference Manual
|
|
for details.
|
|
|
|
Unlike Haskell 1.4, Mercury supports multi-parameter type classes,
|
|
but we do not (yet) support constructor classes, and nor do we
|
|
support default methods.
|
|
|
|
* Mode inference can now infer "mostly-unique" modes as well as
|
|
"unique" modes.
|
|
|
|
* You can now declare both committed-choice ("cc") and backtracking (non-cc)
|
|
modes for the same predicate.
|
|
|
|
Determinism analysis will pick the appropriate one to use for each
|
|
call based on the context.
|
|
|
|
* The module system now includes support for sub-modules.
|
|
|
|
The aim of this extension is twofold. One aim is to provide more
|
|
fine-grained encapsulation control: nested sub-modules within a
|
|
single source file provide a convenient method for encapsulating
|
|
units smaller than a source file. The other aim is to provide better
|
|
support for structuring large software packages that consist of many
|
|
source files. Sub-modules can be defined in separate files, with
|
|
separate compilation, which means that you can also use this feature
|
|
to combine a group of existing Mercury modules into a single logical
|
|
package, with proper namespace control and encapsulation.
|
|
|
|
See the "Modules" chapter of the Mercury language reference manual
|
|
for details.
|
|
|
|
* We have made more improvements to the C interface.
|
|
|
|
The C interface now includes support for defining procedures
|
|
that can have multiple solutions (i.e. those whose determinism
|
|
is `nondet' or `multi') in C.
|
|
|
|
Also there's a new declaration, `pragma import', which is a bit
|
|
like the existing `pragma c_code' declaration except that
|
|
instead of giving a C code fragment, you just give the name
|
|
of a C function. `pragma import' is like the inverse of the
|
|
existing `pragma export' declaration.
|
|
|
|
* We have added support for automatic tabling (memoization).
|
|
|
|
See the "Tabled evaluation" subsection of the "Implementation-dependent
|
|
pragmas" section of the "Pragmas" chapter of the Mercury language
|
|
reference manual.
|
|
|
|
* We have added (tentative) support for exception handling.
|
|
|
|
The interface to exception handling is actually via an `exception.m'
|
|
library module rather than a new language construct.
|
|
For now, this module is located in the `extras/exceptions'
|
|
directory, which is part of the `mercury-extras' distribution,
|
|
but our intent is to eventually migrate this into the Mercury
|
|
standard library if experience with its use proves positive.
|
|
|
|
The exception handling interface uses committed choice nondeterminism
|
|
to avoid some semantic problems with previous exception handling
|
|
proposals.
|
|
|
|
See the documentation in the interface of `exception.m' for details.
|
|
|
|
Changes to the Mercury standard library:
|
|
****************************************
|
|
|
|
* There is also a new builtin function promise_only_solution/1,
|
|
for calling `cc_multi' or `cc_nondet' code from `det' or `semidet'
|
|
procedures. See the "builtin" chapter of the Mercury Library
|
|
Reference Manual for details.
|
|
|
|
* The getopt module now supports a new type of option data, namely
|
|
`maybe_int(maybe(int))', to allow optional arguments with integer values.
|
|
There is also a new corresponding lookup predicate,
|
|
getopt__lookup_maybe_int_option/3.
|
|
|
|
See the "getopt" chapter of the Mercury Library Reference Manual for details.
|
|
|
|
* Support for memory profiling: new predicates report_full_memory_stats/0
|
|
in benchmarking.m and io__report_full_memory_stats/2 in io.m.
|
|
|
|
See the "benchmarking" chapter of the Mercury Library Reference Manual
|
|
for details.
|
|
|
|
* The types `term', `var', `var_supply' and `varset' are now polymorphic.
|
|
This allows one to distinguish between terms, etc. denoting different kinds
|
|
of things by giving them different types. The new coercion predicates
|
|
listed below allow one to coerce terms, etc between types.
|
|
|
|
The monomorphic versions of these have been retained as equivalences
|
|
to the polymorphic ones with the type variable instantiated to a dummy
|
|
type `generic'.
|
|
|
|
* Miscellaneous new predicates.
|
|
|
|
The Mercury standard library now includes the following new predicates:
|
|
|
|
bag__det_remove_list/3
|
|
bag__least_upper_bound/3
|
|
bag__remove_list/3
|
|
det_univ_to_type/2
|
|
eqvclass__same_eqvclass_list/2
|
|
io__read_line_as_string/{3,4}
|
|
list__take_upto/3
|
|
map__det_insert_from_assoc_list/3
|
|
map__det_intersect/5
|
|
map__det_union/5
|
|
map__intersect/4
|
|
map__sorted_keys/2
|
|
map__to_sorted_assoc_list/2
|
|
map__union/4
|
|
relation__add_values/4
|
|
relation__compose/3
|
|
relation__from_assoc_list/2
|
|
set__count/2
|
|
set_ordlist__count/2
|
|
store__new_cyclic_mutvar/4
|
|
term__coerce/2
|
|
term__coerce_var/2
|
|
term__coerce_var_supply/2
|
|
varset__coerce/2
|
|
varset__select/3
|
|
|
|
In addition, there are four new system constants added to the float
|
|
library module, float__radix, float__mantissa_digits, float__min_exponent
|
|
and float__max_exponent. There are also predicate equivalents for these.
|
|
|
|
Also the old relation__to_assoc_list/2 predicate has been renamed as
|
|
relation__to_key_assoc_list/2; there is a new relation__to_assoc_list/2
|
|
predicate with a different type for the second argument.
|
|
|
|
See the Mercury Library Reference Manual for details.
|
|
|
|
* A few library procedures that have implicit side effects and are thus
|
|
intended for debugging use only have been declared `impure'.
|
|
You will need to write `impure' before every call to these procedures
|
|
and typically you will need to add a `pragma promise_pure' declaration
|
|
for the callers.
|
|
|
|
The predicates affected are report_stats/0 and report_full_memory_stats/0
|
|
in library/benchmarking.m; unsafe_dump/2, unsafe_dump_float/1, and
|
|
unsafe_dump_tableaus/0 in extras/clpr/dump.m; and debug_freeze/3
|
|
and debug_freeze/4 in extras/trailed_update/var.m.
|
|
|
|
* The interface to the predicate term__compare/4 was found to be error-prone,
|
|
and so we are phasing it out; it is declared with `pragma obsolete'
|
|
in this version, so any use of it will now result in a warning, and
|
|
the predicate will be removed entirely in some future version.
|
|
|
|
Changes to the Mercury implementation:
|
|
**************************************
|
|
|
|
* We've added a new source-to-source transformation - deforestation.
|
|
|
|
Deforestation transforms conjunctions to avoid the construction
|
|
of intermediate data structures and to avoid multiple traversals
|
|
over data structures. Deforestation is enabled at optimization level
|
|
`-O3' or higher, or by using the `--deforestation' option.
|
|
|
|
* The compiler can now perform type specialization.
|
|
|
|
Type specialization removes the overhead of polymorphic code, including
|
|
code which uses type classes. The disadvantage is increased code size.
|
|
Currently we do not perform inter-module type specialization.
|
|
Type specialization is enabled by using the `--type-specialization' option.
|
|
|
|
* We've added support for "transitive" inter-module analysis.
|
|
|
|
With the previous support for inter-module optimization, when
|
|
analysing a module, the compiler could make use of information
|
|
about the modules that it imports directly, but not about
|
|
modules that are imported indirectly. "Transitive" inter-module
|
|
analysis gives the compiler information about indirectly
|
|
imported modules.
|
|
|
|
However, currently this is only used for termination analysis;
|
|
optimizations such as inlining still use only ordinary inter-module
|
|
analysis, not transitive inter-module analysis.
|
|
|
|
* Array bounds checking can now be disabled.
|
|
|
|
To disable array bounds checking, you must compile with
|
|
`--intermodule-optimization' enabled and you must also
|
|
define the C macro ML_OMIT_ARRAY_BOUNDS_CHECKS (e.g. by using
|
|
`MGNUCFLAGS=-DML_OMIT_ARRAY_BOUNDS_CHECKS' in your Mmakefile).
|
|
|
|
* Domain checking for higher mathematical operations can now be disabled.
|
|
|
|
To disable domain checking, you must compile with
|
|
`--intermodule-optimization' enabled and you must also
|
|
define the C macro ML_OMIT_MATH_DOMAIN_CHECKS (e.g. by using
|
|
`MGNUCFLAGS=-DML_OMIT_MATH_DOMAIN_CHECKS' in your Mmakefile).
|
|
|
|
See the Mercury Library Reference Manual for details.
|
|
|
|
* We've added some primitive debugging support.
|
|
|
|
The runtime system now includes a "four-port" style debugger
|
|
(actually with eight ports).
|
|
To use this debugger, you need to build your program with debugging
|
|
enabled, which is normally done using the `--debug' (or `-g') option,
|
|
and then run it using the `mdb' command, e.g. `mdb a.out'.
|
|
Type `h' at the `mdb>' prompt for a list of the available commands,
|
|
or see the "Debugging" chapter of the Mercury User's Guide for further
|
|
details.
|
|
|
|
* The support for debugging using Prolog now includes support for
|
|
detailed control over how terms are printed out during debugging.
|
|
|
|
See the "Using Prolog" section of the Mercury User's Guide for details.
|
|
However, for most purposes we now recommend using the native Mercury
|
|
debugger rather than debugging using Prolog.
|
|
|
|
* The Mercury profiler has a number of new features.
|
|
|
|
The profiler now supports profiling just user time, or profiling
|
|
real (elapsed) time, rather than profiling user + system time.
|
|
We've also added support for memory profiling.
|
|
|
|
See the "Profiling" chapter of the Mercury User's Guide for details.
|
|
|
|
* Profiling should now work on MS Windows.
|
|
|
|
To enable profiling on MS Windows, you need to have Sergey
|
|
Okhapkin's latest version of gnu-win32 that includes his patch to add
|
|
support for setitimer(). Sergey's "CoolView" version of cygwin.dll
|
|
is available via <http://miracle.geol.msu.ru/sos/>; his patch will
|
|
probably also be included in the next (b19) release of gnu-win32.
|
|
Note that on Windows, you must use the Mercury runtime system's `-Tr'
|
|
(profile real time) option; profiling just user time or user + system
|
|
time is still not supported on Windows, because to the best of our
|
|
knowledge Windows doesn't provide the necessary system calls.
|
|
|
|
* Intermediate files can be placed in subdirectories.
|
|
|
|
If you use the `--use-subdirs' option to `mmake' or `mmc',
|
|
then they will create the various intermediate files used
|
|
by the Mercury implementation in a subdirectory called `Mercury'
|
|
rather than in the current directory. (For `mmake', if there
|
|
is already a `Mercury' subdirectory, then this option is the default.)
|
|
This keeps your source directories much less cluttered.
|
|
|
|
* Mmake has a new variable GRADEFLAGS for specifying options that
|
|
affect the grade (compilation model).
|
|
|
|
This means that for example to enable profiling, you can build with
|
|
`GRADEFLAGS = --profiling' in your Mmakefile, rather than having to
|
|
use the more obscure incantation `GRADE = asm_fast.gc.prof'.
|
|
|
|
* Mmake now supports per-file settings of MCFLAGS and other *FLAGS variables.
|
|
|
|
For example, if you want to disable singleton variable warnings just
|
|
for a single module `horrible_code.m', you can just include the line
|
|
|
|
MCFLAGS-horrible_code = --no-warn-singleton-variables
|
|
|
|
in your Mmakefile.
|
|
|
|
* Mmake now warns about variables which are defined but not used.
|
|
|
|
To disable this warning, use the `-w-' or `--no-warn-undef-variables'
|
|
option.
|
|
|
|
* The components of the argument to the `--grade' option and of the `GRADE'
|
|
Mmake variable may now be given in any order. The compiler also has a
|
|
new option `--output-grade-string' which prints the canonical grade string
|
|
for the set of options with which the compiler was invoked.
|
|
|
|
* Mmake now runs a bit faster, particularly on Windows.
|
|
|
|
* We've made a few small improvements to the efficiency of the generated code.
|
|
|
|
* The system has been ported to Linux/PPC.
|
|
|
|
* The system has been ported to work with version b19 of cygwin32
|
|
(this port has not been tested well, though).
|
|
See README.MS-Windows for details.
|
|
|
|
* We've updated to version 4.13alpha2 of the Boehm garbage collector.
|
|
|
|
* We've made the MERCURY_OPTIONS environment variable somewhat easier to use.
|
|
|
|
* Mtags is now able to produce tags for type class declarations. It is
|
|
also able to produce tags files in the extended format supported by
|
|
recent versions of Vim and Elvis. Do `mtags --help' for more
|
|
information.
|
|
|
|
* Numerous bug fixes.
|
|
|
|
|
|
Mercury 0.8.1, 16 December 1998
|
|
-------------------------------
|
|
|
|
This release just corrected some bugs in the binary
|
|
distribution for 0.8.
|
|
|
|
|
|
Mercury 0.9, 18 December 1999
|
|
-----------------------------
|
|
|
|
HIGHLIGHTS
|
|
==========
|
|
|
|
Changes to the Mercury language:
|
|
* The Mercury type system now supports existentially quantified types.
|
|
* We now allow abstract instance declarations.
|
|
* We now support a simple form of user-defined infix operators.
|
|
|
|
Changes to the Mercury standard library:
|
|
* Exception handling support is now part of the standard library.
|
|
* There are two new standard library modules `time' and `gc'.
|
|
* We've added function versions of many of the predicates in the
|
|
Mercury standard library.
|
|
|
|
New library packages in the Mercury extras distribution:
|
|
* We've added support for optional lazy evaluation.
|
|
* The extras distribution now includes support for dynamic linking.
|
|
* We've added some bindings to POSIX.3 functionality.
|
|
|
|
Changes to the Mercury implementation:
|
|
* Mmake, the Mercury make tool, now includes better support for
|
|
installing libraries.
|
|
* The Mercury debugger (mdb) is much improved.
|
|
It now includes support for interactive queries, command-line editing
|
|
and command-line history, display of source line numbers, and
|
|
setting breakpoints on source line numbers.
|
|
The GNU Emacs interface provides a source-linked debugger.
|
|
* We've removed the support for using a Prolog debugger on Mercury programs.
|
|
* We've added support for user-guided type specialization.
|
|
* Numerous bug fixes.
|
|
|
|
DETAILED LISTING
|
|
================
|
|
|
|
Changes to the Mercury language:
|
|
********************************
|
|
|
|
* The Mercury type system now supports existentially quantified types.
|
|
|
|
Existential types let you create heterogeneous collections (e.g. lists
|
|
containing objects of different types). In combination with type
|
|
classes, they allow you to write code in an OOP-like style.
|
|
See the "Existential types" chapter of the Mercury Language Reference
|
|
Manual for details.
|
|
|
|
Our current implementation still has a couple of important limitations;
|
|
see the "Known bugs and limitations" section of the "Existential types"
|
|
chapter of the Mercury Language Reference Manual.
|
|
|
|
* We now allow abstract instance declarations.
|
|
|
|
You can declare in the interface of a module that a type is an
|
|
instance of a particular type class, and provide the definition
|
|
of that instance in the implementation section of that module.
|
|
|
|
* We now support a simple form of user-defined infix operators.
|
|
|
|
Terms in the form of x `fun` y are transformed into fun(x, y). `fun`
|
|
is parsed as an infix operator with the highest possible precedence
|
|
and left associativity.
|
|
|
|
* We've made a small change to the rule for quantification of lambda
|
|
expressions.
|
|
|
|
The new rule is that all variables in the arguments of lambda
|
|
expressions are treated as locally quantified to that lambda expression.
|
|
For function lambda expressions, variables in the result term
|
|
use the normal quantification rules. See the "Data-terms" section
|
|
of the "Syntax" chapter of the Mercury Language Reference Manual
|
|
for details.
|
|
|
|
Previously, the exact quantification rule for lambda expressions was
|
|
not documented, but the compiler would locally quantify variables in
|
|
function return values, and it would only locally quantify variables
|
|
occurring at the top level of an argument term, not those occurring in
|
|
subterms. Both of these were rather surprising for functional
|
|
programmers.
|
|
|
|
It is possible that this change may break some existing code using
|
|
predicate lambda expressions with compound terms as arguments, but we
|
|
expect this to be extremely rare. If it does occur, the compiler
|
|
will issue a warning about variables having overlapping scopes, and
|
|
the work-around is simple: use a fresh variable for the lambda
|
|
predicate argument and unify it with the compound term in the body of
|
|
the lambda expression.
|
|
|
|
* The old-style syntax for predicate lambda expressions,
|
|
`lambda([<Args>] is <Det>, <Goal>)', is now officially deprecated.
|
|
|
|
Please use the new syntax-style `(pred([<Args>]) is <Det> :- <Goal>)'
|
|
instead. The compiler still supports the old-style syntax, but
|
|
we plan to eventually drop this support in some future release.
|
|
|
|
Changes to the Mercury standard library:
|
|
****************************************
|
|
|
|
* Exception handling support is now part of the standard library.
|
|
|
|
The module `exception', which was previously part of the "extras"
|
|
distribution, has been moved into the standard library.
|
|
The predicate error/1 now throws an exception rather than just
|
|
terminating execution.
|
|
|
|
However, many of the operations in the standard library still handle
|
|
errors by aborting execution rather than by throwing exceptions.
|
|
|
|
* There's a new standard library module `time'.
|
|
|
|
The `time' module provides an interface to the ANSI/ISO C <time.h>
|
|
functions, and to the POSIX times() function. Thanks to Tomas By
|
|
for contributing the original version of this module.
|
|
|
|
* There's a new standard library module `gc', for controlling the
|
|
garbage collector.
|
|
|
|
Currently it contains only one predicate, `garbage_collect',
|
|
which forces a garbage collection. We may add more later.
|
|
|
|
* We've added some new predicates to the Mercury standard library:
|
|
array__map/3,
|
|
bag__count_value/3,
|
|
std_util__do_while/4.
|
|
|
|
* We've added function versions of many of the predicates in the
|
|
Mercury standard library.
|
|
|
|
One small drawback of this change is that it is not completely
|
|
backwards compatible; in certain circumstances, there is a potential
|
|
ambiguity between a function call and a partially applied predicate,
|
|
and for some occurrences of this the compiler may not be able to
|
|
resolve the ambiguity unless the user provides additional type
|
|
declarations (or the like). But such cases should be quite rare,
|
|
and when they do occur the fix is easy, so we thought the clear
|
|
advantages of using a functional syntax were well worth this minor
|
|
glitch in backwards compatibility.
|
|
|
|
* The following predicates have been replaced by functions with
|
|
the same names, and will be removed in a future release.
|
|
|
|
The predicate versions were intended for use in programs which needed
|
|
to work in both Prolog and Mercury, but executing Mercury programs using
|
|
Prolog is no longer supported.
|
|
|
|
float__ceiling_to_int/2,
|
|
float__floor_to_int/2,
|
|
float__round_to_int/2,
|
|
float__truncate_to_int/2,
|
|
float__abs/2,
|
|
float__max/3,
|
|
float__min/3,
|
|
float__pow/3,
|
|
float__hash/2,
|
|
float__max/1,
|
|
float__min/1,
|
|
float__epsilon/1,
|
|
float__radix/1,
|
|
float__mantissa_digits/1,
|
|
float__min_exponent/1,
|
|
float__max_exponent/1.
|
|
|
|
* The implementations of `int:>>/2' and `int:<</2' have been changed to define
|
|
the results for negative shift counts and shift counts greater than the
|
|
word size.
|
|
|
|
For efficiency, we also provide the functions `int:unchecked_left_shift/2'
|
|
and `int:unchecked_right_shift/2' that, like the previous implementations
|
|
of `int:>>/2' and `int:<</2', do not check for these cases.
|
|
|
|
* `int:^/2' and `integer:^/2' have been replaced by `int__xor/2' and
|
|
`integer__xor/2', and will be removed in a future release.
|
|
The operator `^' will be used by record syntax.
|
|
|
|
New library packages in the Mercury extras distribution:
|
|
********************************************************
|
|
|
|
* We've added support for optional lazy evaluation.
|
|
|
|
The extras distribution now includes a new module `lazy',
|
|
which provides support for optional lazy evaluation
|
|
via a type `lazy(T)', with `delay' and `force' operations.
|
|
There's also a `lazy_list' module which uses the `lazy' module.
|
|
See the files in extras/lazy_evaluation for details.
|
|
|
|
* The extras distribution now includes support for dynamic linking.
|
|
|
|
The interface is based on the C functions dlopen(), dlsym(), and co.,
|
|
which are supported by most modern Unix systems.
|
|
See the files in extras/dynamic_linking for details.
|
|
|
|
* We've added some bindings to POSIX.3 functionality.
|
|
|
|
At this stage it's quite incomplete.
|
|
See the files in extras/posix for details.
|
|
|
|
Changes to the Mercury implementation:
|
|
**************************************
|
|
|
|
* Mmake, the Mercury make tool, now includes better support for
|
|
installing libraries.
|
|
|
|
It's now much easier to build and install libraries in several
|
|
different grades (e.g. for debugging, time profiling, and memory
|
|
profiling) or for more than one architecture.
|
|
|
|
See the "Supporting multiple grades and architectures" section
|
|
of the "Libraries" chapter of the Mercury User's Guide.
|
|
|
|
* We've fixed a bug in switch detection.
|
|
|
|
This change may break some code written for Mercury 0.8. Some
|
|
disjunctions which Mercury 0.8 found to have determinism `det'
|
|
now have determinism `nondet'.
|
|
|
|
Mercury 0.8 (but not Mercury 0.7) allowed switches where a unification
|
|
to test the switched-on variable against a function symbol occurred after
|
|
the first call in the disjunct. Doing this may remove infinite loops,
|
|
violating the strict sequential semantics (see the "Semantics" chapter
|
|
of the Mercury Language Reference Manual).
|
|
|
|
To fix switches for which determinism errors are now reported, simply
|
|
reorder the goals in each disjunct so that only unifications occur
|
|
before the test of the switched-on variable.
|
|
|
|
* The Mercury debugger (mdb) now includes support for interactive queries.
|
|
|
|
See the "Interactive query commands" subsection of the "Debugger commands"
|
|
section of the "Debugging" chapter of the Mercury User's Guide for details.
|
|
|
|
* The Mercury debugger (mdb) now optionally supports command-line editing
|
|
and command-line history.
|
|
|
|
This support uses the GNU Readline library. For the source distribution,
|
|
the Mercury configure script will detect whether readline has been
|
|
installed and will only enable the command-line editing and history
|
|
support if readline has been installed. For the binary distribution,
|
|
if the binary distribution was built with readline, then you will
|
|
need to install GNU readline in order to use the debugger.
|
|
|
|
For information on where to obtain GNU Readline, see the INSTALL file.
|
|
|
|
* The Mercury debugger (mdb) now displays source line numbers and allows
|
|
setting breakpoints on source line numbers.
|
|
|
|
The GNU Emacs interface takes advantage of this to provide a
|
|
source-linked debugger.
|
|
|
|
* We've removed the support for using a Prolog debugger on Mercury programs.
|
|
|
|
Now that we have a working Mercury debugger, there's no longer any need to
|
|
use a Prolog debugger for debugging Mercury code.
|
|
|
|
Normally we would warn at least one or two releases in advance, if
|
|
any feature is to be removed. However, in this case
|
|
|
|
- it was an implementation feature rather than a language feature;
|
|
- the cost of maintaining the feature was quite high;
|
|
- the feature was already broken is various ways [one being that it
|
|
doesn't work with the latest versions of SICStus Prolog, due to
|
|
those versions removing support for a SICStus Prolog feature
|
|
(save/1), apparently without any advance notice]; and
|
|
- a simple work-around is available if anything breaks as a result
|
|
of the feature being removed.
|
|
|
|
In the unlikely event that anyone happened to have any makefiles or
|
|
scripts that depended on the support for using Prolog, they can
|
|
install the latest Mercury distribution and still continue to use the
|
|
Prolog support from Mercury 0.8, just by including the `bin'
|
|
directories for both versions in their PATH, with the more recent one
|
|
first, of course.
|
|
|
|
* We've added support for user-guided type specialization.
|
|
|
|
See the "Type specialization" section of the "Pragmas" chapter of the
|
|
Mercury Language Reference Manual for details.
|
|
|
|
* Numerous bug fixes.
|
|
|
|
|
|
Mercury 0.9.1, 26 January 2000
|
|
------------------------------
|
|
|
|
This release is primarily a bug-fix release.
|
|
It fixes some bugs with the binary distribution of 0.9,
|
|
stops the compiler accepting some incorrect inst declarations,
|
|
fixes a bug in exception handling and a problem with the source
|
|
distribution where `configure' did the wrong thing on some architectures
|
|
if you ran it twice.
|
|
|
|
In addition, Morphine has been added to the extras distribution.
|
|
Morphine is a trace analysis system, which allows Mercury programs to be
|
|
debugged and dynamically analyzed using a Prolog interface. You need
|
|
the ECLiPSe Prolog system to use Morphine. See the README file in the
|
|
Morphine directory for more details.
|
|
|
|
|
|
MLDS back-end history
|
|
---------------------
|
|
|
|
We started working on a new back-end for the Mercury compiler in July
|
|
1999. This new back-end, called the MLDS back-end, generates much
|
|
higher level C code than original back-end. The first prototype
|
|
compiled "hello world" in September 1999. The compiler successfully
|
|
compiled itself using the MLDS back-end on 12 May 2000.
|
|
|
|
|
|
Mercury 0.10, 25 February 2001
|
|
------------------------------
|
|
|
|
HIGHLIGHTS
|
|
|
|
Changes to the Mercury language:
|
|
* We've added support for explicit type qualification.
|
|
* We've added support for tuples.
|
|
* We've added support for record syntax.
|
|
* Type class methods can now be defined by listing the clauses
|
|
directly in the instance declaration.
|
|
* The syntax for defining insts and modes has been changed.
|
|
The old syntax is still accepted but is deprecated.
|
|
|
|
Changes to the Mercury standard library:
|
|
* We've added several new standard library modules:
|
|
- `pprint', for pretty printing.
|
|
- `counter', for managing counters.
|
|
- `enum', a typeclass for types which can be converted to and from integers.
|
|
- `sparse_bitset', an abstract data type for storing sparse sets of integers
|
|
or enumerations.
|
|
- `bitmap', an abstract data type for storing sets of integers.
|
|
- `hash_table', an generic hash table implementation
|
|
* The `store' module now makes use of existential types.
|
|
|
|
Changes to the Mercury implementation:
|
|
* We've implemented a new back-end for the Mercury compiler.
|
|
This features improved compilation speed, offers better portability,
|
|
and sometimes generates substantially better code.
|
|
(The original back-end is still included.)
|
|
* There's a version of the new back-end which generates code
|
|
for Microsoft's new .NET system.
|
|
* There's a version of the new back-end which compiles directly
|
|
to assembler, using the GCC back-end.
|
|
* Various improvements to `mtags'.
|
|
|
|
Additional packages in the mercury-extras distribution:
|
|
* Moose: a parser generator for Mercury.
|
|
* concurrency: support for multi-threading/concurrency.
|
|
* stream: an implementation of generic I/O streams, using type classes.
|
|
* xml: a library for parsing XML.
|
|
|
|
DETAILED LISTING
|
|
|
|
Changes to the Mercury language:
|
|
|
|
* We've added support for explicit type qualification.
|
|
|
|
An expression of the form "Term `with_type` Type",
|
|
e.g. "X `with_type` list(int)", can be used in place of
|
|
the specified Term to constrain the type of that term.
|
|
This is sometimes useful for resolving type ambiguities,
|
|
which can occur as a result of overloading or polymorphism.
|
|
|
|
See the "Explicit type qualification" and "Variable scoping"
|
|
sections of the language reference manual for details.
|
|
|
|
* We've added support for tuple types, similar to those in most
|
|
other functional languages. Tuples use the syntax `{A, B, ...}'.
|
|
See the "Builtin types" section of the "Types" chapter of the
|
|
Mercury Language Reference Manual for details.
|
|
|
|
* We've added support for record syntax, so that fields of
|
|
constructors can be conveniently extracted and updated
|
|
without writing lots of trivial access predicates.
|
|
See the "Field access functions" section of the "Types" chapter
|
|
of the Mercury Language Reference Manual for details.
|
|
|
|
Note that the syntax has changed slightly since the version
|
|
that appeared in the release of the day in early January 2000.
|
|
`Value =^ field' is now the syntax for DCG field selection,
|
|
rather than `Value := ^ field'. Field update functions are
|
|
named 'field :=' rather than 'field:='. We also allow field
|
|
access functions to take extra arguments.
|
|
|
|
* The behaviour of the Mercury parser (parser__read_term) applied
|
|
to terms with functor `{}/N' has been changed. The parser from
|
|
Mercury 0.9 parsed "{1, 2, 3}" as `{}(','(1, ','(2, 3)))'.
|
|
It is now parsed as `{}(1, 2, 3)'.
|
|
|
|
* The operator `^' is now used for record syntax, and cannot be
|
|
used for user-defined functions or constructors.
|
|
|
|
* You can now declare functions by giving a determinism but without
|
|
supplying the modes. The default function modes will be assumed.
|
|
This is particularly useful for partial functions.
|
|
For example:
|
|
GetEvens = list__filter_map(
|
|
(func(X) = X is semidet :- X mod 2 = 0)).
|
|
|
|
* We've generalized the higher-order term syntax a little:
|
|
in `Foo(Args)', we now allow Foo to be any term, not just
|
|
a variable.
|
|
|
|
* The syntax for defining insts and modes has been changed to be
|
|
more uniform. For example, the old syntax
|
|
|
|
:- inst myfree = free.
|
|
:- mode out :: myfree -> ground.
|
|
|
|
would now be written
|
|
|
|
:- inst myfree == free.
|
|
:- mode out == myfree >> ground.
|
|
|
|
The old syntax is still accepted but is deprecated. Support for it may
|
|
eventually be dropped.
|
|
|
|
* Type class methods can now be defined by listing the clauses
|
|
directly in the instance declaration. You no longer need to define a
|
|
separate predicate or function for each type class method definition.
|
|
|
|
Changes to the standard library:
|
|
|
|
* We've added some new library predicates: assoc_list__keys_and_values,
|
|
list__map2, list__map3, map__foldl2, tree234__foldl2, relation__traverse,
|
|
std_util__aggregate2, and builtin__promise_only_solution_io.
|
|
|
|
* We've added function versions of std_util__solutions,
|
|
std_util__solutions_set, std_util__aggregate, map__search,
|
|
map__insert and map__update.
|
|
|
|
* We've added functions to allow record syntax to be used
|
|
with some of the types in the standard library:
|
|
array__elem/2, 'array__elem :='/3,
|
|
bt_array__elem/2, 'bt_array__elem :='/3,
|
|
map__elem/2, 'map__elem :='/3,
|
|
map__det_elem/2, 'map__det_elem :='/3.
|
|
|
|
* We've added a pretty printing module, `pprint', to the standard library.
|
|
|
|
* We've added a new function to the Mercury standard library:
|
|
std_util__construct_tuple/1.
|
|
|
|
* Functions `int:^/2' and `integer:^/2' have been removed.
|
|
Use `int__xor/2' and `integer__xor/2' instead.
|
|
The operator `^' is now used for record syntax.
|
|
|
|
* We've added reverse modes for `int__xor'.
|
|
|
|
* There is a new predicate `random__permutation', for
|
|
computing a random permutation of a list.
|
|
|
|
* There is a new library module `counter' for managing counters.
|
|
|
|
* We've added a new library module `sparse_bitset', which implements
|
|
an abstract data type for storing sets of integers or enumerations.
|
|
|
|
* There is a new library module `enum' which contains a typeclass
|
|
describing types which can be converted to and from integers.
|
|
|
|
* Four new parametric instantiations `maybe/1', `maybe_error/1',
|
|
`pair/2' and `pair/1' have been added to the `std_util' library
|
|
module. These make it more convenient to work with non-ground
|
|
terms of the corresponding type.
|
|
|
|
* The `store' module now makes use of existential types.
|
|
|
|
The `store__init/1' predicate and the `store__some_store_type' type
|
|
are now deprecated; the new existentially typed predicate
|
|
`store__new/1' should be used instead.
|
|
|
|
* We've reimplemented the `string__format/3' procedure.
|
|
|
|
The new implementation is a lot more efficient and fixes several
|
|
bugs in the old implementation. The new implementation also
|
|
eliminates some subtle differences in behaviour between
|
|
string__format and the standard ANSI/ISO C printf() function:
|
|
|
|
- For the old string__format, the default precision was 15
|
|
(i.e. the number of significant figures in an IEEE double
|
|
precision float), but for ISO C's printf(), the default
|
|
precision is 6.
|
|
|
|
- For the old string__format, for the e, E, f, F, g and G conversions,
|
|
the "precision" field in the format always specified the
|
|
number of significant figures, but for ISO C's printf(), the
|
|
precision only specifies as the number of significant
|
|
figures for the g and G conversions, whereas for the e, E,
|
|
f, and F conversions the precision specifies the number of
|
|
digits after the decimal point.
|
|
|
|
- For the old string__format, floating point numbers were
|
|
truncated to the specified precision, but for ISO C's
|
|
printf(), they are rounded rather than being truncated.
|
|
|
|
* We've added a new function, math__solve_quadratic/3.
|
|
|
|
* We've changed the semantics of deconstruct/4, in light of the introduction
|
|
of existentially quantified types. Previously, if deconstruct/4 was given
|
|
a value of type `univ' it automagically unwrapped it and gave back the
|
|
functor, arity and arguments of the unwrapped value. This behaviour was
|
|
not documented, but made sense because there was no way to unwrap a
|
|
univ without knowing (or guessing) its type. Now that univ is defined
|
|
as a normal (existentially quantified) type, this behaviour is unnecessary,
|
|
and a wart besides, so has been removed. If you have a univ and you want
|
|
to get the unwrapped value's functor, arity and arguments, then you can
|
|
call "univ_value(Univ)" to extract the value before calling deconstruct.
|
|
(Doing that also works in Mercury 0.9 and Mercury 0.10.)
|
|
|
|
* We've added func versions of the remaining preds in int.m that
|
|
did not already have them.
|
|
|
|
* We've added a new `bitmap' library module.
|
|
|
|
* We've added std_util__dynamic_cast/2 for type-safe runtime dynamic
|
|
type casting for ground types.
|
|
|
|
* We've extended the array module with array__sort/1, array__foldl/3 and
|
|
array__foldr/3.
|
|
|
|
* We've added a new `hash_table' library module.
|
|
|
|
Changes to the Mercury implementation:
|
|
|
|
* We've implemented a new back-end for the Mercury compiler.
|
|
|
|
The new back-end, which is enabled by using the `--high-level-code'
|
|
(or `-H') option or the `hlc.gc' grade, generates much higher-level
|
|
C code that does not require the use of GNU C extensions such as
|
|
global register variables or non-local gotos. It is also simpler
|
|
and more portable than the old back-end.
|
|
|
|
The main drawback of the new back-end is that for tail calls it only
|
|
optimizes direct tail recursion; loops written using tail calls
|
|
between two or more mutually recursive procedures are not guaranteed
|
|
to use constant stack space.
|
|
|
|
Preliminary benchmarking suggests that compilation speed is probably
|
|
about 20% better with the new back-end, and the generated executables
|
|
are likely to be smaller (though this will depend on the platform,
|
|
optimization options, etc.). Speed of the generated code varies:
|
|
sometimes it is better than the old back-end, sometimes it is worse.
|
|
There are a few optimizations that we have not yet implemented for
|
|
the new back-end that might make a significant difference for some
|
|
applications. But there are also some optimizations which we have
|
|
implemented for the new back-end that have not been implemented for
|
|
the old back-end. We encourage those for whom performance is
|
|
important to try their application with both the old and new
|
|
back-ends and compare for themselves.
|
|
|
|
The new back-end is not yet quite as mature or complete as the old back-end.
|
|
It does not yet support the following standard Mercury features:
|
|
- abstractly exported equivalence types defined as `float'
|
|
- calling compare/3, or the `in = in' mode of unification,
|
|
for certain standard library types (std_util__type_desc/0,
|
|
and std_util__type_ctor_desc/0).
|
|
- calling copy/2 on higher-order terms
|
|
It also does not support the following implemention-specific
|
|
features that the old back-end supports:
|
|
- demangling of symbol names in the profiler
|
|
- fact tables for procedures with determinism `nondet' or `multi'
|
|
- the Mercury debugger (mdb)
|
|
- the Morphine trace analysis system
|
|
- the Aditi deductive database interface
|
|
- the `--split-c-files' option
|
|
- the `--introduce-accumulators' option
|
|
- dynamic linking (via the dl__mercury_sym procedure in
|
|
extras/dynamic/dl.m in the mercury-extras distribution)
|
|
for procedures with arguments of type `float' or `char'
|
|
|
|
* There's a new back-end that targets .NET.
|
|
|
|
Thanks to Microsoft's generous and ongoing support, both financial
|
|
and otherwise, we've been able to port Mercury to Microsoft's new
|
|
.NET system. There's another new back-end for the Mercury compiler,
|
|
based on the `--high-level-code' back-end, that compiles to IL, the
|
|
Microsoft .NET Intermediate Language.
|
|
|
|
This back-end is enabled using the new `--target il' option
|
|
(or just `--il' for short), or the `ilc' grade.
|
|
|
|
Compiler support for this new back-end is mostly complete,
|
|
but large parts of the standard library are still not yet
|
|
implemented for this new port.
|
|
|
|
This is still work in progress.
|
|
|
|
For more details, see the README.DotNet file, and
|
|
<http://www.cs.mu.oz.au/research/mercury/dotnet.html>.
|
|
|
|
* Native code compiler.
|
|
|
|
There's a new back-end for the Mercury compiler that compiles
|
|
directly to assembler, rather than going via C. This
|
|
back-end is enabled using the new `--target asm' option.
|
|
|
|
This new back-end is implemented by linking the Mercury compiler
|
|
with the (relatively) language independent GNU Compiler Collection
|
|
back-end. In other words, there is now a Mercury front-end for GCC.
|
|
|
|
Note that this should be considered as a beta release of the native
|
|
code compiler. Furthermore our current version of the native code
|
|
compiler is based on an unreleased snapshot version of the GCC
|
|
back-end.
|
|
|
|
So far we have only tested it on i686-pc-linux-gnu (Intel x86-based
|
|
PCs running Linux). But in theory it should work fine on other
|
|
platforms too.
|
|
|
|
For details see <http://www.cs.mu.oz.au/mercury/download/gcc-backend.html>.
|
|
|
|
* The old back-end now generates faster code at low optimization levels.
|
|
|
|
* The compiler is now a little bit faster.
|
|
|
|
* The names of some of the `--enable-*' options to `configure' have changed.
|
|
|
|
See the output of `configure --help' for details.
|
|
|
|
Changes to the development environment:
|
|
|
|
* The debugger has been improved in several respects:
|
|
|
|
- It has some new forward movement commands:
|
|
* `next' steps over a call, like gdb's `next' command;
|
|
* `exception' skips forward until an exception is thrown.
|
|
- It can perform retry across I/O.
|
|
- It can now print parts of terms, and fields of terms can be
|
|
specified by field name as well as by position number.
|
|
- It has a more flexible mechanism for setting browsing parameters.
|
|
- It now handles ambiguous procedure specifications in "break"
|
|
commands gracefully.
|
|
- The state of the debugger can now be saved and restored, using the
|
|
`save' and `source' commands (respectively).
|
|
|
|
For details, see the documentation of the `next', `exception',
|
|
`break', `set', and `save' commands in the "Debugger commands" section
|
|
of the "Debugging" chapter of the Mercury User's Guide. (The changes
|
|
to `retry' and `print' have unfortunately not been documented yet.)
|
|
|
|
* Several improvements have been made to `mtags' to make it easier to
|
|
find predicate/function definitions and to improve support for
|
|
enhanced features of Vim. The command-line options to `mtags' have
|
|
changed and Vim-style tags files are now output as the default (but
|
|
will work with Vi as well). Do `mtags --help' for more information.
|
|
|
|
|
|
Mercury 0.10.1, 3 April 2001
|
|
----------------------------
|
|
|
|
This is mainly a bug-fix release.
|
|
|
|
There are however some new packages in the mercury-extras distribution:
|
|
* lex: a lexical analyzer library for Mercury.
|
|
* curs: a simplified binding to the ncurses/panel libraries for terminal I/O.
|
|
|
|
|
|
Mercury 0.11, 24 December 2002
|
|
------------------------------
|
|
|
|
HIGHLIGHTS
|
|
==========
|
|
|
|
Changes to the Mercury language:
|
|
* Support for constrained polymorphic modes.
|
|
* Addition of state variable syntax.
|
|
* Improved support for higher-order functions.
|
|
* Predicate and function equivalence type and mode declarations.
|
|
* Support for defining predicates or functions
|
|
using different clauses for different modes.
|
|
* Support for Haskell-like "@" expressions.
|
|
* Generalized foreign language interface.
|
|
|
|
Changes to the Mercury compiler:
|
|
* A new `--make' option, for simpler building of programs.
|
|
* A new `--smart-recompilation' option, for fine-grained dependency tracking.
|
|
* A new optional warning: `--warn-non-tail-recursion'.
|
|
* A new optimization: `--constraint-propagation'.
|
|
* A new optimization: `--loop-invariants'.
|
|
* Support for arbitrary mappings from module name to source file name.
|
|
|
|
Portability improvements:
|
|
* Mac OS X is now supported "out-of-the-box".
|
|
* On Windows we now support generating non-Cygwin executables.
|
|
* Better conformance to ANSI/ISO C.
|
|
|
|
Changes to the compiler back-ends:
|
|
* The native code Linux/x86 back-end is now "release quality".
|
|
* The .NET CLR back-end is much improved.
|
|
|
|
Major improvements to the Mercury debugger, including:
|
|
* Support for source-linked debugging using vim (rather than emacs).
|
|
* Command-line completion.
|
|
* Ability to display values of higher-order terms.
|
|
* Declarative debugging.
|
|
* Support for transparent retries across I/O.
|
|
|
|
A new profiler, which we call the Mercury deep profiler or mdprof:
|
|
* Supports both time and memory profiling.
|
|
* Gathers information about individual call sites as well as procedures.
|
|
* Eliminates the assumption that all calls to a procedure have equal cost.
|
|
* Allows users to explore the gathered data interactively with a web browser.
|
|
|
|
Numerous minor improvements to the Mercury standard library.
|
|
|
|
A new testing tool in the extras distribution.
|
|
A new regex module for string matching and search-and-replace in the
|
|
extras distribution.
|
|
|
|
DETAILED LISTING
|
|
================
|
|
|
|
Changes to the Mercury language:
|
|
|
|
* We have added support for constrained polymorphic modes. See the section on
|
|
Constrained Polymorphic Modes in the Modes chapter of the Mercury Language
|
|
Reference Manual.
|
|
|
|
* A more general alternative to DCG syntax has been added to the language
|
|
to simplify the manipulation of threaded state. See the section on State
|
|
Variables in the Syntax chapter in the Mercury Language Reference Manual.
|
|
|
|
* If a higher-order function term has inst 'ground' it is now assumed to have
|
|
the standard higher-order function inst 'func(in, .., in) = out is det'.
|
|
This makes higher-order functional programming much easier, particularly when
|
|
passing functions to polymorphic predicates.
|
|
|
|
This change is not completely backwards compatible since, for safety,
|
|
we must now disallow calls that would cause a variable that has a
|
|
nonstandard function inst to become 'ground'.
|
|
|
|
* Predicate and function type and mode declarations can now be expressed
|
|
in terms of higher-order predicate and function types and insts, rather
|
|
than explicitly listing the argument types and modes. This is useful
|
|
where several predicates or functions must have the same type and
|
|
mode signature.
|
|
|
|
For example:
|
|
:- type foldl_pred(T, U) == pred(T, U, U).
|
|
:- inst foldl_pred == (pred(in, in, out) is det).
|
|
:- pred p `with_type` foldl_pred(T, U) `with_inst` foldl_pred.
|
|
|
|
For more information see the "Predicate and function type declarations"
|
|
section of the "Types" chapter and the "Predicate and function mode
|
|
declarations" section of the "Modes chapter" of the Mercury Language
|
|
Reference Manual.
|
|
|
|
* The constructor for lists is now called '[|]' rather than '.'.
|
|
`./2' will eventually become the module qualification operator.
|
|
This change only affects programs which use `./2' explicitly.
|
|
Programs which only use the `[H | T]' syntax will be unaffected.
|
|
|
|
* We've added a new kind of expression to the language.
|
|
A unification expression, written `X @ Y', unifies X and Y
|
|
and returns the result.
|
|
|
|
Unification expressions are most useful when writing switches:
|
|
p(X, X) :- X = f(_, _).
|
|
can now be written as
|
|
p(X @ f(_, _), X).
|
|
|
|
See the "Data-terms" section of the "Syntax" chapter of the
|
|
Mercury Language Reference Manual for more details.
|
|
|
|
* We've extended the language to allow you to specify different clauses
|
|
for different modes of a predicate or function. This is done by
|
|
putting mode annotations in the head of each clause.
|
|
For example, you can write
|
|
|
|
:- mode p(in).
|
|
:- mode p(out).
|
|
p(X::in) :- ... /* clause for the `in' mode */
|
|
p(X::out) :- ... /* clause for the `out' mode */
|
|
|
|
For predicates or functions which have different clauses for different
|
|
modes, you need to either (1) add a `pragma promise_pure' declaration
|
|
for the predicate or function, and ensure that the declarative semantics
|
|
remains the same in each mode, or (2) declare the predicate as impure.
|
|
|
|
* We now allow `:- pragma promise_semipure' declarations. For more
|
|
information, see the "Impurity" chapter of the Mercury Language
|
|
Reference Manual.
|
|
|
|
* We've added `:- pragma c_import_module' declarations, which are
|
|
used to make the C declarations for predicates and functions with
|
|
`:- pragma export' declarations in the imported module visible
|
|
to any C code in the importing module. `mmake' uses
|
|
`:- pragma c_import_module' declarations to make sure that the
|
|
header file for the imported module is built before it is needed,
|
|
which it can't do if the header file is explicitly #included.
|
|
|
|
* The foreign language interface has been generalized to support
|
|
interfacing with languages other than C.
|
|
|
|
In particular, the Mercury compiler's .NET back-end now supports
|
|
interfacing with C#, IL, and "Managed C++" (C++ with Microsoft's
|
|
extensions for the .NET CLR). Mercury procedures can be defined
|
|
using inline code fragments written in any of these languages.
|
|
|
|
For details, see the new "Foreign language interface" chapter of
|
|
the Mercury Language Reference Manual.
|
|
|
|
* We've removed the undocumented operators `export_adt', `export_cons',
|
|
`export_module', `export_op', `export_pred', `export_sym', `export_type',
|
|
`import_adt', `import_cons', `import_op', `import_pred', `import_sym',
|
|
`import_type' `use_adt', `use_cons', `use_op', `use_pred', `use_sym'
|
|
and `use_type'. These operators were reserved for module system
|
|
extensions which are unlikely to be implemented.
|
|
|
|
Changes to the Mercury standard library:
|
|
|
|
* The Prolog-style term comparison operators @<, @=<, @>, @>= are now
|
|
builtin.
|
|
|
|
* A new builtin function ordering/2 has been added.
|
|
|
|
* We've added a function to io.m to construct io__error codes from error
|
|
messages: `io__make_io_error'.
|
|
|
|
* The assumptions that we make about user supplied comparison predicates and
|
|
functions have been relaxed to allow more general orderings. The new
|
|
assumptions are documented in builtin.m.
|
|
|
|
* The builtin predicates !/0 and !/2 from Mercury's Prolog heritage have been
|
|
removed (`!' is now a prefix operator used in the state variable syntax).
|
|
|
|
* We have added the type class `pprint__doc/1' and a new concatenation
|
|
operator, `++/2', which should make it easier to construct doc values.
|
|
* Performance bugs in `pprint__to_doc' have now been fixed. Even
|
|
very large terms can now be converted to docs and pretty printed without
|
|
causing a machine to thrash or run out of memory.
|
|
|
|
* `io__read_file' and `io__read_file_as_string' now have better error
|
|
handling. The result types have changed, so code using these predicates
|
|
will need minor modifications.
|
|
* We've added predicates `io__input_stream_foldl', `io__input_stream_foldl_io'
|
|
and `io__input_stream_foldl2_io', which apply a predicate to each character
|
|
of an input stream in turn.
|
|
* We've added predicates `io__binary_input_stream_foldl',
|
|
`io__binary_input_stream_foldl_io' and `io__binary_input_stream_foldl2_io',
|
|
which apply a predicate to each byte of a binary input stream in turn.
|
|
* We've added versions of `io__print', `io__write' and `io__write_univ'
|
|
that allow the caller to specify how they should treat values of noncanonical
|
|
types, e.g. types in which a single semantic value may have more than one
|
|
syntactic expression.
|
|
* We've added four new predicates to allow programs to retrieve current
|
|
streams: `io__current_input_stream', `io__current_output_stream',
|
|
`io__current_binary_input_stream', and `io__current_binary_output_stream'.
|
|
* We've added a predicate to io.m to return the last modification time
|
|
of a file: `io__file_modification_time'.
|
|
* We've added cc_multi modes to io__write_list/5 and io__write_list/6.
|
|
* You can now close stdin, stdout and stderr.
|
|
|
|
* We've added four functions to list.m for mapping functions over
|
|
corresponding members of lists: list__map_corresponding/3,
|
|
list__map_corresponding3/4, list__filter_map_corresponding/3
|
|
and list__filter_map_corresponding3/4.
|
|
* We've added some other new functions to list.m, namely
|
|
list__last_det/2, list__split_last/3 and list__split_last_det/3.
|
|
* We've added cc_multi modes to list__foldl/4 and list__foldr/4.
|
|
* We've added a predicate list__map_foldl2.
|
|
* As mentioned above, the constructor for lists has changed from './2'
|
|
to `[|]/2'. This change affects the behaviour of the term manipulation
|
|
predicates in the standard library when dealing with values of
|
|
type `term__term/1' representing lists. The affected predicates are
|
|
parser__read_term, parser__read_term_from_string, term__type_to_term,
|
|
term__term_to_type, term_io__read_term and term_io__write_term.
|
|
Also beware that std_util__functor and std_util__deconstruct now
|
|
return `[|]' rather than `.' for lists, and calls to std_util__construct
|
|
which construct lists may need to be updated.
|
|
* We've added the predicate list__is_empty/1 and list__is_not_empty/1.
|
|
* We've added the predicate list__remove_adjacent_dups/3.
|
|
|
|
* We've added a function version of error/1, called func_error/1, to require.m.
|
|
|
|
* ops.m now defines a typeclass which can be used to define operator
|
|
precedence tables for use by parser.m and term_io.m. See
|
|
samples/calculator2.m for an example program.
|
|
|
|
The `ops__table' type has been renamed `ops__mercury_op_table'.
|
|
`ops__init_op_table' has been renamed `ops__init_mercury_op_table'.
|
|
`ops__max_priority' is now a function taking an operator table argument.
|
|
|
|
* The predicates and functions in int.m, float.m, math.m and array.m now
|
|
generate exceptions rather than program aborts on domain errors and
|
|
out-of-bounds array accesses. There are new functions
|
|
`float__unchecked_quotient/2', `int__unchecked_quotient/2' and
|
|
`int__unchecked_rem/2' for which no checking is performed and the
|
|
behaviour if the right operand is zero is undefined.
|
|
|
|
* We've removed the reverse modes of the arithmetic functions in
|
|
float.m and extras/complex_numbers. (Because of rounding errors,
|
|
the functions aren't actually reversible.)
|
|
|
|
* float__pow now works for negative exponents, and runs much faster
|
|
for large exponents.
|
|
|
|
* We've removed the destructive update modes of string__set_char,
|
|
string__set_char_det and string__unsafe_set_char. The compiler
|
|
currently always stores constant strings in static data, even
|
|
if they are passed to procedures with mode `di', so any attempt
|
|
to update a constant string will cause a crash. Fixing this properly
|
|
will be a lot of work, so for now we have just removed the modes.
|
|
|
|
* We've added string__suffix, string__words/1, string__foldr,
|
|
string__foldl_substring and string__foldr_substring.
|
|
|
|
* The exception module has a new predicate `try_store', which is
|
|
like `try_io', but which works with stores rather than io__states.
|
|
|
|
* We've fixed a bug in time.m. Type `tm' didn't store the day of the month,
|
|
which meant that the functions which required that field (e.g. time__asctime,
|
|
time__mktime) did not work.
|
|
|
|
The order of the fields of type `time__tm' has been changed so that
|
|
comparison of values of type `tm' whose `tm_dst' fields are identical
|
|
is equivalent to comparison of the times those values represent.
|
|
|
|
* std_util.m now contains predicates and functions `map_maybe',
|
|
`fold_maybe', `map_fold_maybe' and `map_fold2_maybe', which are
|
|
analogues of `list__map', `list__foldl', `list__map_foldl' and
|
|
`list__map_foldl2' operating on values of type `maybe' instead
|
|
of `list'.
|
|
|
|
* We've added a predicate to io.m to return the last modification time
|
|
of a file (io__file_modification_time).
|
|
|
|
* There is a variant of io__call_system, io__call_system_return_signal
|
|
which on interrupt returns the number of the signal which interrupted
|
|
the command rather than just an error message.
|
|
|
|
* We've added several new predicates for deconstructing terms to
|
|
std_util.m. `named_argument' and `det_named_argument' are analogous
|
|
to `argument' and `det_argument' respectively, but specify the desired
|
|
argument by its name, not its position. We have also added committed choice
|
|
version of all the predicates that deconstruct terms. These differ from the
|
|
existing versions in that they do not abort when called upon to deconstruct
|
|
non-canonical terms, such as values of types with user-defined equality.
|
|
|
|
* We've added a new predicate `intersect_list' in each of the modules
|
|
implementing sets in the Mercury standard library.
|
|
|
|
* We've added a predicate version of `set__fold'.
|
|
|
|
* We've added function versions of `builtin__unsafe_promise_unique',
|
|
`ops__init_op_table' and `ops__max_priority'.
|
|
|
|
* We've added a version of `getopt__process_options' which returns
|
|
the option arguments as well as the nonoption arguments. Both versions
|
|
allow multi as well nondet predicates to specify the default values
|
|
of options.
|
|
|
|
* We've added a new predicate `getopt__process_options_track', which can be
|
|
usefully invoked more than once to process separate sets of options.
|
|
|
|
* All these predicates in getopt.m now allow the allow negation of
|
|
accumulating options. Negating an accumulating option empties
|
|
the accumulated list of strings. They also accept a `maybe_string_special'
|
|
option type.
|
|
|
|
* We've added some functions to the term_io module to return printable
|
|
representations of term components as strings.
|
|
|
|
* We've made the outputs of the string concatenation primitives unique.
|
|
|
|
* New convenience/readability predicates `int__even/1' and `int__odd/1'.
|
|
|
|
* New predicate benchmark_det_io for benchmarking code that performs I/O.
|
|
|
|
* We've removed the long obsolete `int__builtin_*' and
|
|
`float__builtin_float_*' predicates, which were synonyms
|
|
for the arithmetic functions dating from when Mercury didn't
|
|
have functions.
|
|
|
|
* We've added int:'/'/2 as a synonym for int:'//'/2 and false/0 as a
|
|
built-in synonym for fail/0 (both left-overs from Mercury's Prolog
|
|
heritage.)
|
|
|
|
* dir:'/'/2 is now a synonym for `dir__make_path_name'.
|
|
|
|
* We've removed the long obsolete predicates `io__read_anything',
|
|
`io__write_anything', and `io__print_anything', which were long ago
|
|
renamed as `io__read', `io__write', and `io__print' respectively.
|
|
|
|
* We've added random__random/5, which produces a random integer in a
|
|
given range, and random__randcount/3, which returns the number of
|
|
distinct random numbers that can be generated.
|
|
|
|
Changes to the extras distribution:
|
|
|
|
* The lex subdirectory now contains a new module, regex, which provides
|
|
for more traditional string-based ways of defining regular expressions
|
|
and provides string matching and search-and-replace functionality.
|
|
|
|
* There's a new testing tool called "quickcheck", which is similar to
|
|
Haskell's "QuickCheck". See quickcheck/tutes/index.html.
|
|
|
|
* The interface to Moose has been changed in a non-backwards compatible
|
|
way to support user-defined modes for the parser state and integrate
|
|
better with lex.
|
|
|
|
Changes to the Mercury compiler:
|
|
|
|
* There is a new `--make' option which performs most of the functions
|
|
of Mmake. The advantages of `mmc --make' are that no `mmake depend'
|
|
step is necessary and the dependencies are more accurate. Parallel
|
|
builds are not yet supported. See the "Using Mmake" chapter of the
|
|
"Mercury User's Guide" for details.
|
|
|
|
* The Mercury compiler can now perform smart recompilation, enabled by the
|
|
`--smart-recompilation' option. With smart recompilation, when the
|
|
interface of a module changes, only modules which use the changed
|
|
declarations are recompiled. Smart recompilation does not yet work
|
|
with `--intermodule-optimization'.
|
|
|
|
* The Mercury compiler can now handle arbitrary mappings from source files
|
|
to module names. If the program contains modules for which the source
|
|
file name does not match the module name, before generating the
|
|
dependencies the command `mmc -f SOURCES' must be run, where `SOURCES'
|
|
is a list of the names of all of the source files. If the names of the
|
|
source files all match the contained module names, `mmc -f' need not be run.
|
|
|
|
* There is a new `--use-grade-subdirs' option which is similar to
|
|
`--use-subdirs', but allows multiple grades to be built in a
|
|
directory at the same time. `--use-grade-subdirs' does not
|
|
work with Mmake (it does work with `mmc --make').
|
|
|
|
* The compiler and scripts accept a `--mercury-stdlib-dir' option,
|
|
which overrides the configured location of the Mercury standard
|
|
library. There is also an environment variable MERCURY_STDLIB_DIR
|
|
which has the same effect. The environment variables which were
|
|
previously used to override the location of the standard library
|
|
(MERCURY_ALL_C_INCL_DIRS, MERCURY_ALL_MC_C_INCL_DIRS, MERCURY_INT_DIR,
|
|
MERCURY_C_LIB_DIR, MERCURY_MOD_LIB_MODS, MERCURY_TRACE_LIB_MODS) are
|
|
now deprecated, and will be removed in a future release.
|
|
MERCURY_C_INCL_DIR has already been removed.
|
|
|
|
* We've added a new compiler option `--warn-non-tail-recursion', which
|
|
causes the compiler to issue a warning about any directly recursive
|
|
call that is not a tail call.
|
|
|
|
* The automatically generated header files for modules containing
|
|
`pragma export' declarations are now named `<module>.mh', not
|
|
`<module>.h'. This avoids conflicts with system header files.
|
|
|
|
* We've fixed a long-standing bug in the handling of module imports.
|
|
Previously, if `module1' imported `module2' which imported `module3' in
|
|
its interface section, then any types, insts, modes and typeclasses defined
|
|
in the interface of `module3' could be used in `module1' even
|
|
if `module1' did not import `module3' directly.
|
|
|
|
This change will break some existing programs, but that is easily fixed
|
|
by adding any necessary `:- import_module' or `:- use_module' declarations.
|
|
|
|
* Options for the Mercury runtime can now be set at compile time using
|
|
the new `--runtime-flags' option of ml and c2init.
|
|
|
|
* We've added a new optimization pass -- constraint propagation.
|
|
|
|
Constraint propagation attempts to transform the code so
|
|
that goals which can fail are executed as early as possible.
|
|
It is enabled with the `--constraint-propagation' option
|
|
(or `--local-constraint-propagation' for a more restricted
|
|
version of the transformation).
|
|
|
|
* The Mercury compiler can now perform inter-module optimization using
|
|
information from transitively imported modules. This is especially
|
|
useful for back-ends which do not support abstract equivalence types
|
|
properly (for example the .NET backend). To disable this behaviour and
|
|
only optimize using information from directly imported modules, use the
|
|
option `--no-read-opt-files-transitively'.
|
|
|
|
* For each `--Xflags' option there is now a `--Xflag' option which allows a
|
|
single quoted argument to be passed to the invoked program. This is useful
|
|
where the argument is a directory name containing spaces.
|
|
|
|
* The `--convert-to-goedel' option has been removed.
|
|
It never really worked anyway.
|
|
|
|
Portability improvements:
|
|
|
|
* Mac OS X is now supported "out-of-the-box".
|
|
|
|
See README.MacOSX for details.
|
|
|
|
* On Windows we now support generating non-Cygwin executables.
|
|
|
|
The Mercury compiler source distribution can be configured using
|
|
`configure --with-cc="gcc -mno-cygwin"'. This option ensures
|
|
that the Mercury libraries are only linked with the standard
|
|
Windows libraries, not the Cygwin Unix emulation library,
|
|
so Mercury programs don't need Cygwin, and use DOS/Windows-style
|
|
path names rather than Cygwin's Unix-style path names.
|
|
|
|
Note that you still need Cygwin to install and use Mercury.
|
|
The change is that the programs which you build using Mercury
|
|
don't need Cygwin anymore.
|
|
|
|
* Better conformance to ANSI/ISO C.
|
|
|
|
We now pass all the tests in the Mercury test suite
|
|
when the compiler is built with the "lcc" C compiler,
|
|
which is more strict about ANSI/ISO C conformance than GNU C.
|
|
This should also make it easier to port to other C compilers.
|
|
|
|
Changes to the Mercury debugger:
|
|
|
|
* The debugger can now print goals just as Prolog debuggers do. At an exit
|
|
port of e.g. append, the command "print goal" will print the current goal
|
|
in a form such as "append([1], [2], [1, 2])".
|
|
|
|
* You can now navigate terms in the debugger by argument name as well as by
|
|
argument number.
|
|
|
|
* The debugger can now print higher order values.
|
|
|
|
* The debugger can now print type_info structures. However, since such
|
|
structures are normally of interest to implementors only, the debugger
|
|
will print such values only if the user gives the command "print_optionals
|
|
on".
|
|
|
|
* The debugger can now perform command line completion when compiled
|
|
with GNU Readline support enabled.
|
|
|
|
* We've added a 'view' command to `mdb', which opens a `vim' window and
|
|
in it displays the current source location, updated at each event. This
|
|
requires X11 and a version of `vim' with the `clientserver' feature
|
|
enabled.
|
|
|
|
* The `--window' mdb option now creates a window for mdb, not
|
|
the program. The main advantage of the new behaviour is that
|
|
redirection of the program's input and output works. The old
|
|
behaviour is still available with `mdb --program-in-window'.
|
|
|
|
* The debugger now includes support for declarative debugging. The `dd'
|
|
command starts diagnosis at any exit, fail or exception port in mdb. See
|
|
the Mercury User's Guide for more details.
|
|
|
|
* When a program is compiled in a debugging grade, the debugger can be
|
|
asked, via the command `table_io start', to make I/O primitives (such as
|
|
io__open_file, io__write_string etc) idempotent. This means that a given
|
|
call to e.g. io__open_file will open the specified file only once,
|
|
even if retry commands cause the call to be executed more than once.
|
|
|
|
A new profiler, which we call the Mercury deep profiler or mdprof:
|
|
|
|
* The old Mercury profiler is based on the technology of the standard Unix
|
|
profiler gprof. This technology makes the assumption that all calls to a
|
|
given C function (in Mercury, a given function or predicate in a given mode)
|
|
have the same cost, whether the cost being measured is CPU time, memory cells
|
|
allocated, memory words allocated etc. In C programs, this assumption is
|
|
usually close enough to correct for the output of gprof to be useful. In
|
|
Mercury, due to the presence of parametric polymorphism and the significantly
|
|
higher frequency of higher order code, different call sites are far more
|
|
likely to have distinct performance characteristics than in C, so the output
|
|
of a gprof-style profiler is usually not accurate enough to be useful.
|
|
|
|
The new profiler records, for each of its measurements, not just the current
|
|
predicate/function and its caller, but the entire chain of ancestors. This
|
|
"deep context" is what gives the profiler its name. Actually, to keep
|
|
overheads down, we don't walk the stack at every measurement; we just
|
|
associate the current context with each measurement, and update the current
|
|
context when it changes. Given this fact, it costs very little extra to
|
|
record measurements on every aspect of performance (counts of calls, exits,
|
|
fails and redos, counts of memory cells and memory words allocated, and time
|
|
spent). We thus have only one deep profiling grade component, .profdeep,
|
|
as opposed to the old profiler which has several grade components
|
|
for different subsets of these measurements.
|
|
|
|
* The deep context recorded by the deep profiler records the identities of
|
|
the call sites as well as the identities of predicates and functions
|
|
in the list of ancestors. If a predicate p contains two calls to predicate q,
|
|
this allows the deep profiler to report that one call to q costs next to
|
|
nothing while the other one is a major performance problem.
|
|
|
|
* The deep profiler gathers so much data that giving it to the user all at once
|
|
would swamp the user with too much information. We therefore implemented the
|
|
deep profiler as a CGI program. Users can use thus use a web browser to
|
|
explore the information contained in profiling data files.
|
|
|
|
* The deep profiler currently does not handle programs that catch exceptions.
|
|
|
|
* Further information about the deep profiler is available in the paper
|
|
"Deep profiling: engineering a profiler for a declarative programming
|
|
language" by Thomas C. Conway and Zoltan Somogyi, available from our web
|
|
site at <http://www.cs.mu.oz.au/mercury/information/papers.html#mu_01_24>.
|
|
|
|
Changes to the compiler back-ends:
|
|
|
|
* The native code Linux/x86 back-end is now "release quality".
|
|
|
|
The native code back-end, which was first released in Mercury 0.10,
|
|
compiles directly to assembler, rather than going via C.
|
|
This back-end is enabled using the `--target asm' option. It is
|
|
implemented by linking the Mercury compiler with the (relatively)
|
|
language independent GNU Compiler Collection back-end. In other words,
|
|
it is a Mercury front-end for GCC.
|
|
|
|
This release is the first to be based on an officially released
|
|
version of GCC (it is based on GCC 3.2). In this release, the native
|
|
code back-end now passes all of the applicable tests in the Mercury test
|
|
suite, including bootstrapping the Mercury compiler. Currently it is only
|
|
supported on i*86-pc-linux-gnu (Intel x86-based PCs running Linux).
|
|
|
|
For details see <http://www.cs.mu.oz.au/mercury/download/gcc-backend.html>.
|
|
|
|
* .NET CLR back-end much improved.
|
|
|
|
The .NET CLR back-end, which generates MSIL code for Microsoft's new
|
|
.NET Common Language Runtime, has been substantially improved.
|
|
Mercury data structures are mapped to .NET CLR data types in a more
|
|
natural and more efficient manner. A lot more of the standard library
|
|
is now supported. Text files on Windows are now output with proper
|
|
Windows CR-LF line endings. Many bugs have been fixed.
|
|
|
|
This back-end supports the whole of the Mercury language, but the
|
|
Mercury standard library implementation for the .NET CLR is still
|
|
not yet complete. The .NET CLR back-end now passes about half of
|
|
the tests in the Mercury test suite.
|
|
|
|
This back-end is selected when you use the `--grade il' option.
|
|
|
|
See <http://www.cs.mu.oz.au/mercury/dotnet.html> and/or
|
|
<http://www.cs.mu.oz.au/mercury/information/dotnet/mercury_and_dotnet.html>.
|
|
|
|
* The cost in disk space of enabling debugging is now much smaller.
|
|
|
|
When debugging is enabled, the compiler creates several data structures
|
|
for use by the Mercury debugger mdb, and includes the definitions of these
|
|
data structures in the generated C file. These definitions could be very
|
|
large (several megabytes), because readable C code is an inherently verbose
|
|
medium for expressing e.g. the values of pointers. By generating denser,
|
|
less readable C code, we have greatly reduced the size of these definitions,
|
|
and the sizes of the references to them in the executable code. The sizes
|
|
of the C files generated by the compiler with debugging enabled are now
|
|
typically between a quarter and a third of their previous sizes.
|
|
|
|
Mercury 0.12, 9 September 2005
|
|
------------------------------
|
|
|
|
HIGHLIGHTS
|
|
==========
|
|
|
|
Changes to the Mercury language:
|
|
* Infix `.' is now accepted as a module name separator.
|
|
* Field access syntax can now be used at the top-level in func and mode
|
|
declarations and in the head of a clause for a user-defined field access
|
|
function.
|
|
* We now support impure higher-order code.
|
|
* We now allow user-defined comparison predicates.
|
|
* User-defined equality and comparison predicates for a type are now
|
|
required to be defined in the same module as the type.
|
|
* Experimental support for user-defined constrained types has been added.
|
|
* We now support the use of `..' as an infix operator.
|
|
|
|
Changes to the Mercury standard library:
|
|
* We've added several new modules: cord, for sequences with O(1) consing and
|
|
concatenation, array2d, for two-dimensional arrays, and version_array,
|
|
version_array2d, version_bitmap, version_hash_table, and version_store,
|
|
implementing non-unique versions of these types supporting O(1) access for
|
|
non-persistent use. A new module term_to_xml has been added for converting
|
|
arbitrary terms to XML documents. Two new modules, set_tree234 and
|
|
set_ctree234, have been added to provide operations on sets with better
|
|
worst-case behavior (but worse constant factors) than the current
|
|
implementation. Ten new modules, svarray, sveqvclass, svmap, svmulti_map,
|
|
svbimap, svset, svbag, svqueue, svrelation and svvarset now provide more
|
|
convenient ways to update arrays, equivalence classes, maps, multi_maps,
|
|
bimaps, sets, bags, queues, relations and varsets in code that uses state
|
|
variables.
|
|
* New procedures have been added to many of the existing standard library
|
|
modules. Most notably, these include procedures for creating
|
|
directories and symbolic links, for checking file types and file
|
|
accessibility, for detecting floating point infinities and NaNs.
|
|
* The dir module now handles Microsoft Windows pathnames correctly.
|
|
|
|
Changes to the Mercury compiler:
|
|
* We have added optional support for a new type-accurate garbage collector
|
|
as an alternative to using the Boehm et al conservative collector.
|
|
* Better support for incremental program development:
|
|
there's two new compiler options, `--allow-stubs' and `--no-warn-stubs',
|
|
to support execution of incomplete programs.
|
|
* There's a new warning option `--warn-dead-procs' for detecting unreachable
|
|
code.
|
|
* It's now easier to use shared libraries on Linux/x86 systems
|
|
with `mmc --make'.
|
|
* A new analysis: `--analyse-exceptions'.
|
|
The compiler can use the results of this analysis to try and improve
|
|
some optimizations.
|
|
|
|
Portability improvements:
|
|
* We have made the implementation compatible with gcc 3.4.
|
|
* Shared libraries now work on Mac OS X.
|
|
|
|
Changes to the Mercury debugger:
|
|
* Users can now arrange to have the goal and/or some variables printed
|
|
every time execution arrives at a breakpoint.
|
|
* Users can now arrange to associate a condition with a breakpoint.
|
|
Execution won't stop at the breakpoint if the condition is false.
|
|
* Users can now limit the output from stack traces.
|
|
* Users can now put breakpoints on unify and compare predicates.
|
|
* Users can now save runtime values to files.
|
|
* Users can now tell the declarative debugger to trust entire modules or
|
|
individual predicates or functions.
|
|
* The declarative debugger can track the origins of subterms.
|
|
* The declarative debugger can now use the divide-and-query search strategy.
|
|
|
|
Changes to the compiler back-ends:
|
|
* The .NET CLR back-end now bootstraps.
|
|
* Improvements to the Java back-end.
|
|
* The cost in disk space of enabling debugging is now much smaller.
|
|
|
|
Numerous minor improvements to the Mercury standard library.
|
|
|
|
Changes to the extras distribution:
|
|
* Added easyx, a new Xlib based graphics library suitable for implementing
|
|
simple interactive graphical applications.
|
|
* Major improvements to the OpenGL binding.
|
|
* We've added a binding to GLUT (the GL utility toolkit).
|
|
* The OpenGL, GLUT and Tcl/Tk bindings have been ported to Mac OS X.
|
|
|
|
DETAILED LISTING
|
|
================
|
|
|
|
Changes to the Mercury language:
|
|
|
|
* The deprecated support for NU-Prolog style `when' declarations has been
|
|
removed.
|
|
|
|
* We have experimental support for user-defined constrained types, as
|
|
documented in the reference manual section on "Solver types". Variables
|
|
of a constrained type can have constraints placed upon them before they
|
|
are instantiated, allowing for various styles of constraint logic
|
|
programming.
|
|
|
|
* We now allow user-defined comparison predicates, using the syntax
|
|
:- type t ---> t where equality is unify_t, comparison is compare_t.
|
|
|
|
See the "User-defined equality and comparison" chapter of the
|
|
Mercury Language Reference Manual for details.
|
|
|
|
* User-defined equality and comparison predicates for a type are now
|
|
required to be defined in the same module as the type.
|
|
|
|
* Infix `.' is now accepted as a module name separator. Hence it is
|
|
now possible to write io.write_string and list.member to mean the
|
|
same thing as io__write_string and list__member, for instance. This
|
|
has required changing the associativity of `.' from xfy to yfx and
|
|
from precedence 600 to 10.
|
|
|
|
* Field access notation can now be used at the top-level in func and
|
|
mode declarations and in the head of a clause for a user-defined
|
|
field access function. That is, one can now write
|
|
|
|
:- func a ^ f(b) = c.
|
|
:- mode a ^ f(b) = c is <detism>.
|
|
A ^ f(B) = ...
|
|
|
|
* Mercury's support for impure code now also includes support for
|
|
impure higher-order code.
|
|
|
|
Specifically, impurity annotations can be used on higher-order types,
|
|
lambda expressions, and higher-order calls; higher-order terms are
|
|
permitted to call impure or semipure code provided that they are
|
|
appropriately annotated as such.
|
|
|
|
For details, see the "Higher-order impurity" section of the "Impurity"
|
|
chapter of the Mercury Language Reference Manual.
|
|
|
|
* `..' is now accepted as an infix operator. That means a list of
|
|
successive integers can now be written as X .. Y. For example:
|
|
|
|
1 .. 5 = [1, 2, 3, 4, 5]
|
|
|
|
|
|
Changes to the Mercury standard library:
|
|
|
|
* We've add the function queue.from_list/1 as a synonym for
|
|
queue.list_to_queue/1, function queue.to_list/1 (and predicate
|
|
queue.to_list/2) as the converse of queue.from_list/1, queue.put_on_front/2
|
|
(and predicate queue.put_on_front/3) to put items on to the front of a
|
|
queue, queue.put_list_on_front/2 (and predicate queue.put_list_on_front/3)
|
|
to put a list of items on to the front of a queue, and predicate
|
|
queue.get_from_back/3 which removes the last element from a queue.
|
|
|
|
* We've added the function pqueue.from_assoc_list/1 as a synonym
|
|
for pqueue.assoc_list_to_pqueue/1.
|
|
|
|
* We've added functions set.from_list/1 and set.from_sorted_list/1
|
|
as synonyms for set.list_to_set/1 and set.sorted_list_to_set/1
|
|
respectively. Similar additions have also been made to the
|
|
set_unordlist, set_ordlist and set_bbbtree modules.
|
|
|
|
* We've added some new higher-order predicates, rbtree.foldl2/6
|
|
rbtree.foldl3 and rbtree.transform_value to the rbtree module. The
|
|
predicate rbtree.remove/3 has been deprecated.
|
|
|
|
* We've add some new predicates and functions to int.m.
|
|
int.fold_up/4, int.fold_down/4, int.fold_up/5, int.fold_down/5,
|
|
int.fold_up2/7 and int.fold_down2/7 support iteration over
|
|
contiguous integer ranges.
|
|
|
|
* The predicate int.to_float/2 has now been deprecated.
|
|
|
|
* We've added a new library module, `array2d', for two-dimensional arrays.
|
|
|
|
* We've added a new module, cord, for sequences with O(1) consing and
|
|
concatenation. A cord is essentially a tree structure with data stored
|
|
in the leaf nodes. Joining two cords together to construct a new cord
|
|
is therefore an O(1) operation.
|
|
|
|
* The dir module now handles Microsoft Windows pathnames correctly.
|
|
|
|
* dir__split_name and dir__basename are now semidet, not det.
|
|
dir__split_name fails for root directories or pathnames not
|
|
containing a directory separator.
|
|
dir__basename fails for root directories.
|
|
|
|
* We've added some new predicates and functions to the dir module:
|
|
basename_det/1,
|
|
expand_braces/1,
|
|
is_directory_separator/1,
|
|
make_directory/4,
|
|
make_single_directory/4,
|
|
foldl2/6,
|
|
parent_directory/0,
|
|
path_name_is_absolute/1,
|
|
path_name_is_root_directory/1,
|
|
recursive_foldl2/7.
|
|
|
|
* We've added several new predicates to the io module:
|
|
have_symlinks/0,
|
|
make_symlink/4,
|
|
follow_symlink/4,
|
|
check_file_accessibility/5,
|
|
file_type/4,
|
|
input_stream_foldl2_io_maybe_stop/{6,7},
|
|
binary_input_stream_foldl2_io_maybe_stop/{6,7}.
|
|
|
|
* We've added several new predicates and functions to the bimap module:
|
|
det_insert,
|
|
forward_search,
|
|
reverse_search,
|
|
from_corresponding_lists,
|
|
map_keys,
|
|
map_values,
|
|
det_insert_from_assoc_list,
|
|
det_insert_from_corresponding_lists,
|
|
set_from_assoc_list,
|
|
set_from_corresponding_lists,
|
|
delete_key,
|
|
delete_value,
|
|
delete_keys,
|
|
delete_values,
|
|
overlay,
|
|
apply_forward_map_to_list,
|
|
apply_reverse_map_to_list,
|
|
foldl
|
|
|
|
* We've added predicates relation__lookup_key_set_from/3 and
|
|
relation__lookup_key_set_to/3.
|
|
|
|
* The type of the arguments giving the initial set of visited nodes
|
|
to relation__dfs and relation__dfsrev has changed from set_bbbtree
|
|
to sparse_bitset.
|
|
|
|
* Efficiency of the operations in the relation module has been
|
|
greatly improved.
|
|
|
|
* Some predicates and functions have been added to the sparse_bitset module:
|
|
to_set/1,
|
|
from_set/1,
|
|
member/2,
|
|
foldl/4,
|
|
foldr/4.
|
|
|
|
* exception.m now contains a predicate finally/6 which can be used to
|
|
ensure that resources are released whether a called closure exits
|
|
normally or throws an exception.
|
|
|
|
* exception.m now contains a predicate throw_if_near_stack_limits which
|
|
can be used to prevent an application running out of stack space.
|
|
|
|
* We've changed the interface of exception.try_all/2 to separate
|
|
exceptional results from normal results.
|
|
|
|
* We've added predicates multi_map.to_flat_assoc_list/2 and
|
|
multi_map.from_flat_assoc_list/2.
|
|
|
|
* Several new functions have been added to the string module, namely
|
|
elem/2, unsafe_elem/2, chomp/1, lstrip/1, lstrip/2, rstrip/1, rstrip/2,
|
|
strip/1, prefix_length/2, suffix_length/2, string/1, string/2, string/4
|
|
and string.det_to_float/1.
|
|
|
|
* We've added some new predicates, list__map2_foldl, list__map_foldl3,
|
|
and list__foldl4 to list.m.
|
|
|
|
* We've added a predicate, list__cons/3 to list.m. This is sometimes
|
|
useful with higher-order code. It can also be useful with state
|
|
variables. We've also added a function version.
|
|
|
|
* We've added some new predicates, map__common_subset, map__foldl3,
|
|
map__overlay_large_map and map__transform_value, to map.m.
|
|
|
|
* We've added a predicate, map_fold, to set.m.
|
|
|
|
* We've added a function, pred_to_bool, to bool.m.
|
|
|
|
* We've added the three predicates, `is_nan/1', `is_inf/1' and
|
|
`is_nan_or_inf/1' to float.m. These predicates are for use only on
|
|
systems which support IEEE floating point arithmetic.
|
|
|
|
* We've added a function version of `hash_table__search/3'.
|
|
|
|
* We've added a predicate, copy_mutvar, to store.m.
|
|
|
|
* We've added a function, clk_tck, to time.m.
|
|
|
|
* builtin.m now contains types and insts `unify' and `compare' for use
|
|
in defining user-defined equality and comparison predicates.
|
|
|
|
* builtin.m now defines insts `new' and `old' as synonyms for `free' and
|
|
`any', respectively, since some of the HAL literature uses this terminology.
|
|
Likewise it defines modes `no' for `new >> old' and `oo' for `old >> old'.
|
|
|
|
* We've fixed some problems with the use of `cc_nondet'.
|
|
|
|
The incorrect cc_nondet modes of the following predicates have been removed:
|
|
deconstruct.arg/4
|
|
deconstruct.named_arg/4
|
|
deconstruct.limited_deconstruct/6
|
|
std_util.arg_cc/3
|
|
std_util.argument_cc/3
|
|
std_util.named_argument_cc/3
|
|
std_util.limited_deconstruct_cc/5
|
|
These have been replaced by cc_multi versions in which success or failure
|
|
is indicated by returning a maybe type.
|
|
|
|
* We've added functions get_equivalent_elements, get_minimum_element and
|
|
remove_equivalent_elements to eqvclass.m.
|
|
|
|
* We've added semidet functions max_key and min_key to return the maximum and
|
|
minimum keys in maps and 2-3-4 trees.
|
|
|
|
* We've added predicates member, remove_leq, remove_gt, foldl and filter
|
|
to sparse_bitset.m.
|
|
|
|
* builtin.m now contains types and insts `unify' and `compare' for use
|
|
in defining user-defined equality and comparison predicates.
|
|
|
|
* The following predicates, which were added in 0.11.0, have been deprecated:
|
|
io.current_input_stream/3
|
|
io.current_output_stream/3
|
|
io.current_binary_input_stream/3
|
|
io.current_binary_output_stream/3
|
|
They were identical to the following long-existing predicates with
|
|
similar names:
|
|
io.input_stream/3
|
|
io.output_stream/3
|
|
io.binary_input_stream/3
|
|
io.binary_output_stream/3
|
|
|
|
* The following functions have been added to the integer module:
|
|
integer.zero/0
|
|
integer.one/0
|
|
integer.det_from_string/1
|
|
integer.pow/2
|
|
|
|
The predicate integer.pow/3 has been deprecated.
|
|
|
|
* We've added some functions, rational.int/1, rational.from_integer/1,
|
|
rational.from_integers/2 and rational.reciprocal/1 to rational.m
|
|
The function rational.rational_from_integers/2 has been deprecated.
|
|
|
|
* A new module `term_to_xml' has been added to the standard library. This
|
|
module contains predicates to write arbitrary Mercury terms to an output
|
|
stream as XML. Automatic generation of DTDs for Mercury types is also
|
|
supported. Once a Mercury term is in XML it can be converted to many other
|
|
formats such as HTML or XUL using an appropriate stylesheet.
|
|
|
|
Changes to the Mercury compiler:
|
|
|
|
* We have added optional support for a new type-accurate garbage collector
|
|
as an alternative to using the Boehm et al conservative collector.
|
|
|
|
The new collector is enabled by `--grade hlc.agc'.
|
|
For details about how it works, see the paper
|
|
"Accurate garbage collection in an uncooperative environment"
|
|
which is available via our web page.
|
|
|
|
Note that the new collector is a very naive copying collector, and still
|
|
has a number of serious limitations which may make it undesirable for
|
|
most applications. It only works with `--high-level-code'. The heap
|
|
size is fixed at program startup; the collector does not attempt to
|
|
resize the heap. It does not do cheap heap reclamation on backtracking.
|
|
There is no support for passing terms on the Mercury heap to C code.
|
|
In most cases, the Boehm et all conservative collector will perform better.
|
|
|
|
* There's a new warning option `--warn-dead-procs' which can be used
|
|
for detecting unreachable code.
|
|
|
|
This is not yet enabled by default, because it can cause some spurious
|
|
warnings in modules containing code which mixes Mercury clauses and
|
|
`pragma foreign_proc' declarations for the same procedure.
|
|
|
|
* `mmc --make' now works correctly with Microsoft Visual C++.
|
|
|
|
* It's now easier to use shared libraries on Linux/x86 systems with
|
|
`mmc --make'. See the documentation for the `--mercury-linkage'
|
|
and `--linkage' options and the `MERCURY_LINKAGE' Mmake variable
|
|
in the Mercury User's Guide.
|
|
|
|
* The behaviour of the `--pre-link-command' and `--extra-init-command'
|
|
options has changed. They now take a command which will be passed
|
|
the names of all source files in the program or library, with the
|
|
name of the main module's source file passed first.
|
|
See the "Build system options" section of the "Invocation" chapter
|
|
of the Mercury User's Guide for details.
|
|
|
|
* It is now possible to reconfigure an existing Mercury installation
|
|
to use a different C compiler. See the "C compilers" chapter
|
|
of the Mercury User's Guide for details.
|
|
|
|
* Inlining of builtins can now be disabled using the `--no-inline-builtins'
|
|
option. This is done by default when debugging, as without this option the
|
|
execution of builtins is not traced.
|
|
|
|
* The Mercury compiler now uses `.' and not `:' as the module separator
|
|
in all output.
|
|
|
|
* The environment variables which were previously used to override the
|
|
location of the standard library (MERCURY_ALL_C_INCL_DIRS,
|
|
MERCURY_ALL_MC_C_INCL_DIRS, MERCURY_INT_DIR, MERCURY_C_LIB_DIR,
|
|
MERCURY_MOD_LIB_MODS, MERCURY_TRACE_LIB_MODS) have been removed.
|
|
|
|
* There is a new analysis: `--analyse-exceptions'. This identifies
|
|
predicates that will not throw an exception. This information is
|
|
made available to the optimizing passes of the compiler.
|
|
|
|
Portability improvements:
|
|
|
|
* We have made the implementation compatible with gcc 3.4.
|
|
* Shared libraries now work on Mac OS X.
|
|
|
|
Changes to the Mercury debugger:
|
|
|
|
* Users can now limit the output from stack traces.
|
|
|
|
The mdb command `stack' now takes an optional integer argument that
|
|
specifies the maximum number of stack frames to be printed.
|
|
|
|
* Users can now put breakpoints on unify and compare predicates.
|
|
|
|
The syntax for procedure specifications now has provision for specifying
|
|
unify and compare predicates.
|
|
|
|
* Users can now save runtime values to files.
|
|
|
|
We've added a new mdb command, `save_to_file', that saves a specified term
|
|
to a specified file.
|
|
|
|
* The declarative debugger can now be told to trust entire modules or
|
|
individual predicates or functions using the `trust' mdb command.
|
|
|
|
* The declarative debugger can now also tell you where a value
|
|
appearing in an atom came from (i.e. the call which constructed the value).
|
|
|
|
* The declarative debugger also now supports a divide-and-query search mode.
|
|
You can tell the declarative debugger to use this search mode by invoking
|
|
it with the command `dd -s divide_and_query'.
|
|
|
|
* The "pretty" and "raw_pretty" print formats have had their names swapped, so
|
|
the "pretty" format is now prettier than the "raw_pretty" format.
|
|
|
|
Changes to the compiler back-ends:
|
|
|
|
* The .NET CLR back-end now bootstraps.
|
|
|
|
We've fixed a lot of bugs, and implemented a lot more of the Mercury
|
|
standard library. As well as being able to bootstrap in grade `il',
|
|
we also now pass more than 90% of the applicable tests in the
|
|
Mercury test suite. See README.DotNet for details.
|
|
|
|
* Improvements to the Java back-end.
|
|
|
|
We've fixed a lot of bugs, and implemented a lot more of the Mercury
|
|
standard library. See README.Java for further details on the status
|
|
of this backend.
|
|
|
|
Mercury 0.12.1, 21 November 2005
|
|
--------------------------------
|
|
|
|
This release is primarily a bug-fix release.
|
|
It fixes a problem with predicates that have existentially typed
|
|
arguments, makes sure that I/O tabling does not inadvertently
|
|
inline predicates that have a `:- pragma no_inline' declaration
|
|
attached to them, and makes various improvements to the MS-Windows
|
|
ports.
|
|
|
|
Mercury 0.12.2, 25 January 2006
|
|
-------------------------------
|
|
|
|
This release fixes some bugs with `mmc --make' and `--smart-recompilation'.
|
|
|
|
|
|
Mercury 0.13.0, 14 September 2006
|
|
---------------------------------
|
|
|
|
HIGHLIGHTS
|
|
==========
|
|
|
|
Changes to the Mercury language:
|
|
* The Mercury typeclass system now supports functional dependencies.
|
|
* A new language construct allows programmers to promise that any given
|
|
goal is pure or semipure.
|
|
* Two new language constructs allow programmers to promise that all solutions
|
|
of a given goal are equivalent with respect to the relevant equality
|
|
theories.
|
|
* We now have support for optional module initialisation and finalisation.
|
|
* We now have support for module-local mutable variables.
|
|
* We now have support for recognizing switches in which multiple switch arms
|
|
have shared code.
|
|
* A new pragma allows programmers to promise that in a predicate or function
|
|
defined by mode-specific clauses, the mode-specific definitions have
|
|
equivalent semantics.
|
|
* We now allow users to control how each argument of a `pragma memo' predicate
|
|
is tabled.
|
|
* Support for the old-style lambda, mode and pragma syntax has been removed.
|
|
* ':' is now the type qualification operator, not a module qualifier.
|
|
* To ensure soundness, goals in negated contexts using non-local variables
|
|
with dynamic modes (inst "any") must now be marked as impure.
|
|
|
|
Changes to the Mercury standard library:
|
|
* We have removed the predicates dealing with runtime type information (RTTI)
|
|
from std_util.m. Any users impacted by this change should look for required
|
|
functionality in the construct, deconstruct and type_desc modules of the
|
|
standard library, in forms that have been mostly unchanged since the
|
|
0.11 release. In most cases, the differences are quite minor, but provide
|
|
more expressive power.
|
|
* We have moved the all-solutions predicates from std_util.m into a new
|
|
library module, solutions.m. These predicates are still available in
|
|
std_util.m but these versions are now deprecated.
|
|
* We have moved the univ type, and related predicates, from std_util.m
|
|
into a new library module, univ.m.
|
|
* We have moved the maybe type, and related predicates, from std_util.m
|
|
into a new library module, maybe.m.
|
|
* We have moved the pair type, and related predicates, from std_util.m
|
|
into a new library module, pair.m.
|
|
* We have moved the unit type from std_util.m into a new library module,
|
|
unit.m.
|
|
* We have made the predicates semidet_succeed/0, semidet_fail/0 and
|
|
cc_multi_equal/2 into builtins. Formerly these were exported by std_util.m.
|
|
* We have added an `injection' module, for reversible maps that are injective.
|
|
|
|
Changes to the Mercury compiler:
|
|
* The compiler now generates error messages for mismatches between format
|
|
strings and lists of values to be printed in calls to string.format and
|
|
io.format.
|
|
* The compiler now generates better error messages for determinism errors
|
|
involving single-solution contexts.
|
|
* We have significantly improved the compiler's performance on predicates
|
|
with many clauses.
|
|
* We have deleted the old --split-c-files option, as it conflicted with the
|
|
implementation of module initialisation and finalisation.
|
|
|
|
Portability Improvements:
|
|
* We've ported Mercury to the x86_64 (AMD64 / Intel EMT64) architecture.
|
|
* We've made the implementation compatible with gcc 4.1.
|
|
|
|
Changes to the Mercury debugger:
|
|
* Users can now see a listing of the source code lines referred to by the
|
|
current environment (see the documentation for the `list' command in
|
|
the Mercury Users' Guide).
|
|
* Users can now keep hold of a term, referring to it even when execution has
|
|
left the goal at which the term was available as the value of a program
|
|
variable.
|
|
* Users can now see the set of places where two terms differ from each other.
|
|
* The `set' command has been replaced by several other commands: the `format',
|
|
`format_param', `list_context_lines', `list_path', `xml_browser_cmd',
|
|
`xml_tmp_filename', `fail_trace_counts', `pass_trace_counts' and
|
|
`max_io_actions' commands.
|
|
* The `save_to_file' command has been renamed the `dump' command.
|
|
* The `save' command now saves the entire persistent state of the debugger
|
|
(with one small exception that cannot be reestablished by an mdb command from
|
|
an arbitrary point of execution).
|
|
* The declarative debugger now supports an `undo' command, and allows users to
|
|
select the search algorithm.
|
|
* The declarative debugger can now exploit information from the "code
|
|
footprints" of passed and failed test cases to find bugs with fewer
|
|
questions. We have also added two tools, mslice and mdice, to manipulate
|
|
files containing such footprints. See the "Trace counts" section of the
|
|
Mercury User's Guide for details.
|
|
* Subterm dependency tracking in the declarative debugger is now significantly
|
|
faster.
|
|
|
|
Changes to the compiler backends:
|
|
* We have implemented an optimization, --optimize-constructor-last-call,
|
|
that can turn recursive calls that are followed only by unifications that
|
|
construct output arguments into tail calls. This can reduce the stack space
|
|
requirements of the predicates to which it is applicable from linear
|
|
in the size of the input data to constant.
|
|
* We have implemented an optimization, --tuple, that can replace several
|
|
arguments that are usually passed to predicates together with a single
|
|
tuple. This can reduce parameter passing overheads.
|
|
* The compiler can now optimize away the trail manipulation code from parts
|
|
of the program that cannot affect the trail.
|
|
* The compiler now optimizes away any instructions referring to values of dummy
|
|
types. A type is a dummy type if it has one function symbol of arity zero.
|
|
* Higher order calls are now cheaper on the low level C backend.
|
|
|
|
Changes to the extras distribution:
|
|
* We've added a library of data structures designed to work with solver types.
|
|
* We've added a library to generate Windows installer packages.
|
|
* We've added a program to generate optimisation flags for the compiler.
|
|
|
|
|
|
DETAILED LISTING
|
|
================
|
|
|
|
Changes to the Mercury language:
|
|
|
|
* We have added support for functional dependencies to the typeclass system.
|
|
See the "Type classes" section of the Mercury Language Reference Manual for
|
|
details.
|
|
|
|
* A new language construct allows programmers to promise that any given
|
|
goal is pure or semipure. Given Goal, a goal that uses impure and/or
|
|
semipure code, the goal
|
|
|
|
promise_pure ( Goal )
|
|
|
|
promises that Goal presents a pure interface. Given Goal, a goal that
|
|
uses impure code, the goal
|
|
|
|
promise_semipure ( Goal )
|
|
|
|
promises that Goal presents a semipure interface.
|
|
|
|
* A new language construct allows programmers to promise that all solutions
|
|
of a given goal are equivalent with respect to the relevant equality
|
|
theories. Given Goal, a goal that computes values for two variables,
|
|
X and Y, the goal
|
|
|
|
promise_equivalent_solutions [X, Y] ( Goal )
|
|
|
|
promises that all solutions of Goal are equivalent with respect to the
|
|
equality theories of the types of X and Y. This means that the
|
|
promise_equivalent_solutions goal will be det if Goal is cc_multi,
|
|
and that the promise_equivalent_solutions goal will be semidet if Goal
|
|
is cc_nondet.
|
|
|
|
A related language construct allows programmers to promise that although
|
|
the solutions of a given goal are not necessarily equivalent with respect
|
|
to the relevant equality theories, it is nevertheless immaterial which one
|
|
is chosen in a particular context. The language construct is the `arbitrary'
|
|
goal, and the context is established by a `promise_equivalent_solution_sets'
|
|
goal. Consider a type representing maps from keys to values which is
|
|
implemented using 2-3 trees. In such a type, the precise shape of the tree
|
|
doesn't matter; two trees should be considered equal if they contain the same
|
|
set of keys and map them to the same values:
|
|
|
|
:- type tree23(K, V)
|
|
---> two(tree23(K, V), K, V, tree23(K, V)
|
|
; three(tree23(K, K, V, tree23(K, V), K, V, tree23(K, V))
|
|
where equality is tree23_equal
|
|
and comparison is tree23_compare.
|
|
|
|
Two values of e.g. type tree23(int, string) may differ in their top level
|
|
function symbol even through they denote the same map. Deconstructing a
|
|
value of such a type may therefore theoretically yield either "two" or
|
|
"three" as the top level function symbol, although in practice which one
|
|
you get is determined by the concrete structure of the term. Unifications
|
|
of such values with specific function symbols are therefore permitted only
|
|
in committed choice contexts. Unfortunately, one cannot simply put the
|
|
deconstruction into the scope of a promise_equivalent_solutions goal,
|
|
since the solutions are not equivalent in all contexts. However, the
|
|
solutions will be equivalent in *some* contexts. Consider this function
|
|
to count the number of key-value pairs in the map:
|
|
|
|
count(Tree) = Count :-
|
|
promise_equivalent_solution_sets [Count] (
|
|
(
|
|
arbitrary [Tree1, Tree2] (
|
|
Tree = two(Tree1, _Key, _Value, Tree2)
|
|
),
|
|
Count = 1 + count(Tree1) + count(Tree2)
|
|
;
|
|
arbitrary [Tree1, Tree2, Tree3] (
|
|
Tree = three(Tree1, _Key1, _Value1, Tree2,
|
|
_Key2, _Value2, Tree3)
|
|
),
|
|
Count = 2 + count(Tree1) + count(Tree2) + count(Tree3)
|
|
)
|
|
).
|
|
|
|
The construct `arbitrary [Tree1, Tree2] Goal', where Goal computes Tree1
|
|
and Tree2, tells the compiler that it is OK to commit to the first solution
|
|
of Goal, because regardless of whether the goal succeeds and if so with
|
|
which values of Tree1 and Tree2, the set of solutions of the surrounding
|
|
`promise_equivalent_solution_sets [Count] Goal' will not be affected.
|
|
Regardless of whether Tree is bound to "two" or "three", the body of count
|
|
will compute the right value for Count.
|
|
|
|
A goal of the form `arbitrary [Vars] Goal' will be det if Goal is cc_multi,
|
|
and it will be semidet if Goal is cc_nondet. Goals of that form may occur
|
|
only inside `promise_equivalent_solution_sets' goals. There is no restriction
|
|
on the determinism of `promise_equivalent_solution_sets' goals.
|
|
|
|
* We have added support for optional module initialisation. See the
|
|
"Module initialisation" section of the Mercury Language Reference
|
|
Manual for details.
|
|
|
|
* We have added support for optional module finalisation. See the
|
|
"Module finalisation" section of the Mercury Language Reference
|
|
Manual for details.
|
|
|
|
* We have added support for module-local mutable variables.
|
|
See the "Module-local mutable variables" section of the Mercury Language
|
|
Reference Manual for details.
|
|
|
|
* We now have support for recognizing switches in which multiple switch arms
|
|
have shared code. Where previously programmers had to write code like this
|
|
|
|
(
|
|
X = a,
|
|
... code for a ...
|
|
;
|
|
X = b(...),
|
|
... code for b ...
|
|
;
|
|
X = c,
|
|
... code for c ...
|
|
... shared code ...
|
|
;
|
|
X = d(...),
|
|
... code for d ...
|
|
... shared code ...
|
|
)
|
|
|
|
to have the disjunction recognized as a switch on X, they can now write
|
|
code like this:
|
|
|
|
(
|
|
X = a,
|
|
... code for a ...
|
|
;
|
|
X = b(...),
|
|
... code for b ...
|
|
;
|
|
(
|
|
X = c,
|
|
... code for c ...
|
|
;
|
|
X = d(...),
|
|
... code for d ...
|
|
),
|
|
... shared code ...
|
|
)
|
|
|
|
* If a predicate or function is defined by mode-specific clauses, like this:
|
|
|
|
reversible_sort(Raw::in, Sorted::out) :-
|
|
list.sort(Raw, Sorted).
|
|
reversible_sort(Raw::out, Sorted::in) :-
|
|
is_sorted(Sorted),
|
|
list.perm(Sorted, Raw).
|
|
|
|
the compiler by default assumes that the definitions of the different modes
|
|
have different semantics. Programmers can tell the compiler that the
|
|
mode-specific definitions, though syntactically distinct, are semantically
|
|
equivalent by including a pragma:
|
|
|
|
:- pragma promise_equivalent_clauses(reverse_sort/2).
|
|
|
|
* To ensure soundness, goals in negated contexts using non-local variables
|
|
with dynamic modes (inst "any") must now be marked as impure.
|
|
|
|
If a goal uses a variable with a dynamic mode (inst "any"),
|
|
and that goal occurs inside a negated context (such as the
|
|
condition of an if-then-else, or a lambda expression),
|
|
and the variable also occurs outside of that negated context,
|
|
then the compiler will infer that goal to be impure,
|
|
and so such goals must normally be marked as "impure".
|
|
|
|
This change was required because Mercury implements negation using
|
|
the standard negation-as-failure approach, which is not sound if the
|
|
negated goal binds any non-local variables.
|
|
|
|
As usual, the programmer can use "promise_pure" if they are
|
|
sure that the goal is in fact pure, e.g. because they know that
|
|
the goal inside the negation will not instantiate the variable.
|
|
|
|
Changes to the Mercury standard library:
|
|
|
|
* We have added the function `divide_equivalence_classes' to the `eqvclass'
|
|
module.
|
|
|
|
* We have added an `injection' module, for reversible maps that are injective.
|
|
|
|
* We have added list.foldl_corresponding/5, list.foldl2_corresponding/7,
|
|
list.map2_foldl2/8 and list.det_split_list/4.
|
|
|
|
* We have added string.word_wrap/2.
|
|
|
|
* We have added set.fold4/10.
|
|
|
|
* We have added semidet_true/0 and semidet_false/0 as synonyms for
|
|
semidet_succeed/0 and semidet_fail/0.
|
|
|
|
* We have added impure_true/0 and semipure_true/0.
|
|
|
|
Changes to the Mercury compiler:
|
|
|
|
* The compiler now generates error messages for known mismatches between format
|
|
strings and lists of values to be printed in calls to string.format and
|
|
io.format, unless the user specifies the --no-warn-known-bad-format-call
|
|
option.
|
|
|
|
If the user specifies the --warn-unknown-format-call option, the compiler
|
|
will also generate error messages for calls to string.format and io.format
|
|
in which the format string or the structure of the list of values to be
|
|
printed are not statically available.
|
|
|
|
Changes to the extras distribution:
|
|
|
|
* We've added a library of data structures designed to work for solver types.
|
|
|
|
The module extras/solver_types contains versions of the standard
|
|
library's array, assoc_list, list and map modules that are designed to
|
|
work with terms that have inst `any'.
|
|
|
|
* We've added a library to generate Windows installer packages.
|
|
|
|
The directory extras/windows_installer_generator contains a library to
|
|
generate Wix source files. WiX is an XML language that is used to generate
|
|
Microsoft Windows Installer (.msi) packages.
|
|
|
|
* We've added a program to generate optimisation flags for the compiler.
|
|
|
|
The directory extras/gator contains a program to search for the
|
|
optimal set of compiler flags for a given program. The search
|
|
algorithm used is a genetic algorithm, which can run in parallel over
|
|
multiple hosts (by default, 1).
|
|
|
|
|
|
Mercury 0.13.1, 1 December 2006
|
|
-------------------------------
|
|
|
|
This release is primarily a bug-fix release.
|
|
The problems fixed include:
|
|
|
|
* polymorphic insts and mode-specific clauses did not work together.
|
|
* polymorphic insts and export pragmas did not work together.
|
|
* the compiler was not correctly enforcing the restriction that type
|
|
variables in instance declarations should be distinct.
|
|
* the compiler sometimes performed superclass reduction incorrectly,
|
|
causing it to reject valid typeclass constraints.
|
|
* installation of static archives on Mac OS X using mmc --make now
|
|
works correctly. Previously, static archives caused linking problems
|
|
because the table of contents was not being updated after installation.
|
|
* non-exported typeclasses sometimes resulted in incomplete interface
|
|
files being generated.
|
|
|
|
In addition to the above bug-fixes we have the following addition to the
|
|
standard library.
|
|
|
|
Changes to the Mercury standard library:
|
|
* We have added a new module `rtree', that provides region trees.
|
|
These are a standard data structure for querying spatial information.
|
|
|
|
|
|
NEWS for Mercury 10.04.2, 5 October 2010
|
|
-----------------------------------------
|
|
|
|
This release is a bug-fix release. A number of problems that caused
|
|
the compiler to abort have been fixed, some broken RTTI operations
|
|
in the java grade have been fixed, and we have added a workaround
|
|
for a problem with GCC version 4.4.
|
|
|
|
|
|
NEWS for Mercury 10.04.1, 30 August 2010
|
|
----------------------------------------
|
|
|
|
This release is primarily a bug-fix release. It fixes some problems in
|
|
the code generator and the source-to-source debugger. In addition,
|
|
there are some changes to the standard library.
|
|
|
|
Changes to the Mercury standard library:
|
|
* We have added cc_multi modes for map.foldl2/6 and tree234.foldl2/6.
|
|
* We have improved the performance of cords, hash tables and
|
|
version hash tables.
|
|
|
|
|
|
NEWS for Mercury 10.04, 19 July 2010
|
|
------------------------------------
|
|
|
|
Changes to the release numbering:
|
|
|
|
Stable releases are now numbered according to the year and month the
|
|
release was made, eg 10.04 is the release made in April 2010.
|
|
Previously the release naming scheme was 0.x where x was the x'th
|
|
major release of the system.
|
|
|
|
Changes to the Mercury language:
|
|
|
|
* We have removed support for automatic initialisation of solver variables.
|
|
|
|
* A new pragma, foreign_enum, allows the constructors of Mercury
|
|
enumeration types to be assigned values from foreign language code.
|
|
|
|
* A new pragma, foreign_export_enum, allows the constructors of Mercury
|
|
enumeration types to be referred to in foreign language code.
|
|
|
|
* Some of the restrictions on typeclass instances have been relaxed, allowing
|
|
support for polymorphic instances with functional dependencies.
|
|
|
|
* We now support trace goals, which can be used to print progress messages or
|
|
log messages in the middle of arbitrary computations.
|
|
|
|
* Mutables can now be marked as constant, which is useful when working with
|
|
constant data structures that cannot be conveniently represented as constant
|
|
terms.
|
|
|
|
* Mutables can now be marked as thread-local, which can take on different
|
|
values for each thread.
|
|
|
|
* promise_equivalent_solutions scopes (et al.) must now also list variables
|
|
with inst any that may be constrained by the goal.
|
|
|
|
* We now support !X ^ field_list := Term as a synonym for
|
|
!:X = !.X ^ field_list := Term.
|
|
|
|
* We now support higher-order `any' insts.
|
|
|
|
* We now support "implementation-defined literals", such as `$file', `$line',
|
|
`$pred', which are useful for producing better run-time error messages.
|
|
|
|
* We now support currying of multi-moded predicates or functions when the
|
|
mode to curry can be determined from the insts of the higher-order
|
|
arguments.
|
|
|
|
* We now support `try' goals for catching exceptions.
|
|
|
|
Changes to the Mercury standard library:
|
|
|
|
* A new module, parsing_utils, has been added to provide support for
|
|
implementing recursive descent parsers.
|
|
|
|
* The string.to_int family of predicates now fails (or throws an exception
|
|
for the det_ versions) on base 10 numbers that do not fit in the range
|
|
[int.min_int+1, int.max_int]. Numbers outside this range lead to overflow.
|
|
Numbers not in base 10 are assumed to denote bit patterns and are not
|
|
checked for overflow.
|
|
|
|
* A module for handling directed graphs, digraph.m, has been added. This
|
|
supersedes relation.m and svrelation.m in that it has a more consistent
|
|
interface (which supports state variable notation), provides more type
|
|
safety by using phantom types, and has a number of efficiency improvements.
|
|
Further use of relation.m and svrelation.m is deprecated.
|
|
|
|
* An improved pretty printer module, pretty_printer.m, has been added. This
|
|
supersedes pprint.m in that it is more economical, produces better
|
|
quality output (line overruns are completely avoided wherever possible),
|
|
has better control over the amount of output produced, and supports
|
|
user-specifiable formatting for arbitrary types. Further use of pprint is
|
|
deprecated.
|
|
|
|
* We have added extra modes to many of the fold style predicates in the
|
|
library in order to better support (mostly-)unique accumulators.
|
|
|
|
* The foldr family of functions and predicates has been added to the map
|
|
and tree234 modules. We have also extended the arities for map_foldl
|
|
to map_foldl3 in both modules, and added versions of both map_foldl*
|
|
and just plain foldl* in which the higher order argument does not take
|
|
the key as an argument.
|
|
|
|
* We have added the following predicate to the int module:
|
|
int.nondet_int_in_range/2.
|
|
|
|
* We have added the following functions to the integer module:
|
|
integer.from_base_string/2
|
|
integer.det_from_base_string/2
|
|
|
|
* We have added a new builtin predicate, unsafe_cast_any_to_ground/1, that
|
|
can be useful when manipulating polymorphic values that have inst any.
|
|
|
|
* Predicates and functions which create strings from lists of characters
|
|
now fail, throw an exception or return an error value if they find
|
|
a null character. Unexpected null characters in strings are a potential
|
|
source of security vulnerabilities.
|
|
|
|
We have added the predicates string.semidet_from_char_list/2 and
|
|
string.semidet_from_rev_char_list/2. These fail rather than throwing
|
|
an exception if they find a null character.
|
|
|
|
* We have added string.remove_suffix_det, a version of string.remove_suffix
|
|
that throws an exception if the suffix is not there.
|
|
|
|
* string.float_to_string now trims redundant trailing zeroes (although
|
|
at least one fractional digit is always present). This change affects the
|
|
output from the debugger and io.print etc.
|
|
|
|
* The globals field in the I/O state is no longer unique. The modes of
|
|
the access predicates, io.set_globals/3 and io.get_globals/3 have been
|
|
changed accordingly.
|
|
|
|
* We have added io.update_globals/3 which allows for atomic updates to
|
|
the globals field in the I/O state in the presence of multiple threads.
|
|
|
|
* We have moved some of the concurrency primitives out of the extras
|
|
distribution and into a new standard library module called `thread',
|
|
and its submodules `thread.channel', `thread.mvar', and `thread.semaphore'.
|
|
The predicates `thread.can_spawn', `thread.channel.try_take'
|
|
and `thread.mvar.try_take' have also been added.
|
|
|
|
* Processes no longer terminate until all threads have finished. Previously
|
|
a process would terminate as soon as the original thread finished.
|
|
|
|
* The following predicate has been added to the set module:
|
|
set.filter_map/3
|
|
|
|
* The following predicates have been added to the array modules:
|
|
array.fold/4
|
|
array.foldl2/6
|
|
version_array.foldl/4
|
|
|
|
* The following predicates have been added to the list module:
|
|
list.filter_map_foldl/5
|
|
list.map_corresponding/4
|
|
list.map2_foldl3/10
|
|
list.map_corresponding_foldl/6
|
|
list.map_corresponding_foldl2/8
|
|
list.map_corresponding_foldl3/10
|
|
list.map_corresponding3_foldl/7
|
|
list.negated_filter/3
|
|
list.foldl3_corresponding/9
|
|
list.foldl_corresponding3/6
|
|
list.foldl2_corresponding3/8
|
|
list.foldl3_corresponding3/10
|
|
list.foldl4_corresponding3/12
|
|
list.split_upto/4
|
|
list.contains/2
|
|
list.find_index_of_match/4
|
|
list.find_first_match/3
|
|
|
|
We have also added versions of list.foldl/4 and list.foldr/4 that have
|
|
determinism multi.
|
|
|
|
* The following functions have been added to the string module:
|
|
string.split_at_separator/2
|
|
string.split_at_char/2
|
|
string.split_at_string/2
|
|
string.remove_suffix_if_present/2
|
|
string.remove_prefix_if_present/2
|
|
string.is_all_digits/1
|
|
string.all_match/2
|
|
string.remove_prefix/3
|
|
|
|
* The following functions and predicates have been added to the bag module:
|
|
bag.count/1
|
|
bag.count_unique/1
|
|
bag.member/2
|
|
bag.member/3
|
|
|
|
* A unique mode has been added to cord.foldl_pred/4
|
|
|
|
* The following function has been added to the pqueue module
|
|
pqueue.length/1
|
|
|
|
* The following predicate has been added to the maybe module
|
|
maybe_is_yes/2
|
|
|
|
* We have changed the interface of the ops module to make lookups of operators
|
|
more efficient.
|
|
|
|
* We have added string.c_pointer_to_string/{1,2} and string.from_c_pointer/1
|
|
to convert c_pointers to a human readable form.
|
|
|
|
* The bitmap module has been modified and extended to make it more suitable
|
|
for use as a general container for binary data. See runtime/mercury_types.h
|
|
for the new definition of the bitmap type for interoperability with C code.
|
|
|
|
Bitmaps now have fields `bit', `bits' and `byte' for getting and
|
|
setting a single bit, a group of bits (up to machine word size),
|
|
and an aligned eight bit byte respectively.
|
|
|
|
bitmap.get/2 has been deprecated; use bitmap.bit/2 instead.
|
|
|
|
There is a new type bitmap.slice/0 to represent segments of bitmaps.
|
|
|
|
There are new functions to move data around in bulk:
|
|
copy_bits/5
|
|
copy_bits_in_bitmap/4
|
|
copy_bytes/5
|
|
copy_bytes_in_bitmap/4
|
|
|
|
Other added functions include:
|
|
shrink_without_copying/2
|
|
append_list/1
|
|
to_byte_string/1
|
|
|
|
* The operations in bitmap.m and version_bitmap.m which treat bitmaps
|
|
as sets have been modified to throw an exception when the input
|
|
bitmaps are not the same size. Before this change bitmap.intersect/2
|
|
computed the wrong answer when the input bitmaps were of different sizes.
|
|
|
|
* bitmap.difference/2 and version_bitmap.difference/2 now compute difference,
|
|
not xor. bitmap.xor/2 and version_bitmap.xor/2 have been added.
|
|
|
|
* bitmap.to_string(BM) now returns "<0:>" for an empty bitmap BM.
|
|
Previously it returned "<0:00>".
|
|
|
|
* Version bitmaps now have a field `bit' for getting and setting a single bit.
|
|
|
|
version_bitmap.get/2 has been deprecated; use version_bitmap.bit/2 instead.
|
|
|
|
* The io module now contains predicates io.read_bitmap/{4,5,6,7},
|
|
io.write_bitmap{3,4,5,6} and io.read_file_as_bitmap/{3,4}.
|
|
io.write_bytes/{3,4} are now marked as obsolete. Note that the
|
|
interface of io.read_bitmap/* has changed since the first release
|
|
of the day implementation.
|
|
|
|
* There are new modules bit_buffer, bit_buffer.write and bit_buffer.read
|
|
which give a bit-oriented interface to byte-oriented streams.
|
|
|
|
* There is a new typeclass stream.bulk_reader/5. Instances of
|
|
stream.bulk_reader/5 support reading of multiple items at once
|
|
into a container such as an array or a bitmap.
|
|
|
|
* Comparison of version_arrays is now the same as for arrays.
|
|
|
|
* We have added predicates char.is_hex_digit/2 and char.int_to_hex_char/2.
|
|
|
|
* We have changed term.variable so that it records the context where
|
|
the variable was used. This required the backward mode of
|
|
term.var_list_to_term_list to be removed. The backwards mode is
|
|
now accessed via term.term_list_to_var_list.
|
|
|
|
There is a new function, get_term_context, to return the context of any term.
|
|
|
|
* We have renamed some library predicates whose names were ambiguous.
|
|
|
|
* The type software_error/0 has been moved from the require module into
|
|
the exception module.
|
|
|
|
* construct.num_functors/1 now fails rather than returning -1 for types
|
|
with no functors. There is a new function construct.det_num_functors/1
|
|
which aborts for types which do not have functors.
|
|
|
|
* We have added predicates deconstruct.functor_number/3 and
|
|
deconstruct.deconstruct_du/4 which return functor numbers suitable
|
|
for use by construct.construct, rather than functor strings.
|
|
|
|
* We have added a function construct.get_functor_lex/2 which converts
|
|
an ordinal functor number into a lexicographic functor number.
|
|
|
|
* A new module string.builder has been added to the standard library.
|
|
The new module provides instances of the stream typeclasses that can
|
|
be used to build up a string using char and string writers.
|
|
|
|
* We have added the types `string.line' and `string.text_file' and made
|
|
input streams instances of stream.reader/4 with those unit types.
|
|
This means stream.get/4 can be used to efficiently read lines
|
|
and files as string.
|
|
|
|
* We have added a predicate io.remove_file_recursively/4
|
|
which can remove non-empty directories.
|
|
|
|
* We have added the predicates `dir.current_directory',
|
|
`dir.relative_path_name_from_components'.
|
|
|
|
* We have added the predicates rev_list, split_last, get_first, get_last,
|
|
filter, foldl_pred, foldr_pred, map_foldl, map_foldl[23], cord_list_to_cord
|
|
and cord_list_to_list to the cord module.
|
|
|
|
* We have added two predicates that are useful for custom term construction:
|
|
construct.find_functor/5
|
|
type_desc.same_type/2
|
|
|
|
* We have added new predicates to the tree234 and map modules for constructing
|
|
2-3-4 trees and maps directly (without the creation of intermediate trees)
|
|
from sorted lists:
|
|
tree234.from_sorted_assoc_list/2
|
|
tree234.from_rev_sorted_assoc_list/2
|
|
map.from_rev_sorted_assoc_list/2
|
|
map.from_sorted_assoc_list now also constructs the tree directly, so now
|
|
it requires its input list to be duplicate-free.
|
|
|
|
* We have added tree234.map_values_only and map.map_values_only, which are
|
|
versions of tree234.map_values and map.map_values which do not give the
|
|
higher order argument the key associated with the value being transformed.
|
|
|
|
* We have replaced the hash_table and version_hash_table implementations
|
|
with separate chaining schemes. Consequently delete works, and double
|
|
hashing predicates are not required.
|
|
|
|
* We have added optional synchronisation to the version_array and
|
|
version_hash_table implementations. They are now thread safe, but slower,
|
|
by default.
|
|
|
|
* We have added a calendar module to the standard library. This module
|
|
contains utilities for working with the Gregorian calendar.
|
|
|
|
Changes to the Mercury compiler:
|
|
|
|
* The Java backend has been substantially improved and now supports
|
|
all the core features of the language and most of the standard library.
|
|
The Java backend is roughly three times slower (after allowing for JIT)
|
|
than the C backends.
|
|
|
|
The Java backend improvements were contributed by Mission Critical IT
|
|
<http://www.missioncriticalit.com/>.
|
|
|
|
* Interfacing with Mercury code from Java is also improved:
|
|
* Polymorphic Mercury types are now translated to Java classes
|
|
with generics, allowing for greater type safety in the Java code.
|
|
* Exported Mercury procedures retain their argument order in the
|
|
corresponding Java versions (output arguments are handled with a new
|
|
Ref Java type).
|
|
|
|
* We have added support for trail segments, which allow programs to grow
|
|
the trail on demand.
|
|
|
|
* Shared libraries are now used by default on Linux/x86 systems.
|
|
|
|
* Support for the reserve tag grades has been removed.
|
|
|
|
* We have added an Erlang back-end.
|
|
|
|
The Erlang back-end was contributed by Mission Critical IT
|
|
<http://www.missioncriticalit.com/>.
|
|
|
|
* In parallel grades we now support thread-local trailing.
|
|
|
|
* The compiler now issues a warning when an inst declaration is not
|
|
consistent with any of the types in scope.
|
|
|
|
* We have added support for simultaneous execution of jobs with `mmc --make'.
|
|
|
|
* We have added support for `mmc --make' to recompile modules if options have
|
|
changed.
|
|
|
|
* We have added an option for `mmc --make' to compile more recently modified
|
|
source files first.
|
|
|
|
* We have added support for stack segments, which allows programs to grow
|
|
stacks on demand.
|
|
|
|
* We have made it easier to use single-precision floats, which do not need
|
|
to be boxed on 32-bit machines.
|
|
|
|
* A new option, `--generate-standalone-interface', simplifies the task
|
|
of calling Mercury procedures from programs written in other languages.
|
|
|
|
* We have added a new option, `--inform-ite-instead-of-switch'. If this is
|
|
enabled, the compiler will generate informational messages about
|
|
if-then-elses that it thinks should be converted to switches for the
|
|
sake of program reliability.
|
|
|
|
* We have removed support for Managed C++ as a foreign language for the IL
|
|
backend.
|
|
|
|
* The width of error message lines can be adjusted with a new option,
|
|
`--max-error-line-width'.
|
|
|
|
* Generation of 64-bit code on Mac OS X is now supported,
|
|
i.e. the x86_64*apple*darwin* architecture is now supported.
|
|
|
|
* We have added another debugger, called the source-to-source debugger (ssdb).
|
|
It is more limited than mdb, but it does work with backends other than the
|
|
low-level C backend, e.g. the Java backend.
|
|
|
|
Changes to the Mercury deep profiler:
|
|
|
|
* The deep profiler now supports measuring a proxy for time: a counter that
|
|
is incremented at each call. Since calls happen a lot more frequently than
|
|
clock interrupts, this can yield useful profiles for shorter-running
|
|
programs.
|
|
|
|
Changes to the samples directory:
|
|
|
|
* The samples directory now includes an example of how to implement a
|
|
solver type.
|
|
|
|
Changes to the extras distribution:
|
|
|
|
* The extras distribution now includes a binding to the Allegro and
|
|
AllegroGL game programming libraries.
|
|
|
|
* `mtogl', the Mercury binding to the Tk widget `togl' has been removed
|
|
from the distribution.
|
|
|
|
Changes to the Mercury debugger:
|
|
|
|
* A `track' mdb command has been added.
|
|
|
|
* The `dd' command now accepts a `--reset-knowledge-base' option.
|
|
|
|
* You can now put breakpoints on individual events inside procedures.
|
|
|
|
* mdb now ignores lines beginning with a `#' character
|
|
in sourced files. This is useful for commenting mdb scripts.
|
|
|
|
DETAILED LISTING
|
|
================
|
|
|
|
Changes to the Mercury language:
|
|
|
|
* Support for the automatic initialisation of solver variables has been
|
|
removed because it was source of confusing errors and was not used in
|
|
practice anyway.
|
|
|
|
A consequence of this is that solver types are now properly polymorphic,
|
|
i.e. types like `foo(bar)' where:
|
|
|
|
:- solver type foo(T).
|
|
:- solver type bar.
|
|
|
|
are now supported.
|
|
|
|
* The new pragma, foreign_enum, can be used to establish a
|
|
mapping between values in a foreign language and the constructors
|
|
of a Mercury enumeration type. This can be useful when writing
|
|
Mercury bindings to foreign code libraries.
|
|
|
|
For example,
|
|
|
|
:- type matrix_mode
|
|
---> texture
|
|
; modelview
|
|
; projection.
|
|
|
|
:- pragma foreign_enum("C", matrix_mode/0, [
|
|
texture - "GL_TEXTURE"
|
|
modelview - "GL_MODELVIEW"
|
|
projection - "GL_PROJECTION"
|
|
]).
|
|
|
|
When passed to C foreign clauses, values of type matrix_mode/0 will have
|
|
the corresponding C value specified by the foreign_enum pragma.
|
|
|
|
* The new pragma, foreign_export_enum, can be used to establish a
|
|
mapping between the constructors of a Mercury enumeration type and
|
|
a symbolic name for values of that type in the foreign language.
|
|
|
|
For example, given the type
|
|
|
|
:- type status ---> ok ; error.
|
|
|
|
the declaration
|
|
|
|
:- pragma foreign_export_enum("C", status/0, [prefix("STATUS_")]).
|
|
|
|
allows code in C foreign_proc and foreign_code pragma bodies to refer
|
|
to the value `ok' via the name `STATUS_ok' and to the value `error'
|
|
via the name `STATUS_error'.
|
|
|
|
* The restriction on typeclass instances that all type variables appearing in
|
|
the range of a functional dependency must be monomorphic has been relaxed.
|
|
We now support cases where the type variables in the range are determined
|
|
by the type variables in the domain, using the functional dependency
|
|
information from any instance constraints.
|
|
|
|
For example, given the typeclass
|
|
|
|
:- typeclass foo(A, B) <= (A -> B).
|
|
|
|
the following instance is now valid:
|
|
|
|
:- instance foo(list(S), list(T)) <= foo(S, T).
|
|
|
|
since the variable T, in the range, is determined from the variable S by the
|
|
functional dependencies on the foo(S, T) constraint.
|
|
|
|
* A new language construct allows programmers to include debugging and/or
|
|
logging code in the middle of arbitrary computations. Trace goals
|
|
may have both compile time and run time conditions placed on their execution.
|
|
However, if they are enabled, then they can perform I/O (even if the
|
|
surrounding code can't); they can also access the values of mutables.
|
|
|
|
Their capabilities, syntax and intended use are shown by the following
|
|
example.
|
|
|
|
:- mutable(logging_level, int, 0, ground, []).
|
|
|
|
:- pred time_consuming_task(data::in, result::out) is det.
|
|
|
|
time_consuming_task(In, Out) :-
|
|
trace [
|
|
compile_time(flag("do_logging") or grade(debug)),
|
|
run_time(env("VERBOSE")),
|
|
io(!IO),
|
|
state(logging_level, !LoggingLevel)
|
|
] (
|
|
io.write_string("Time_consuming_task start\n", !IO),
|
|
( !.LoggingLevel > 1 ->
|
|
io.write_string("Input is ", !IO),
|
|
io.write(In, !IO),
|
|
io.nl(!IO)
|
|
;
|
|
true
|
|
)
|
|
),
|
|
...
|
|
% perform the actual task
|
|
|
|
* Higher-order terms can now have an `any' inst, which means that they can
|
|
legally use non-local solver variables even though these variables may
|
|
become further bound when in it is called. Higher-order terms with an
|
|
`any' inst cannot be called or applied in a negated context (a negation,
|
|
the condition of an if-then-else, or the body of a higher-order expression
|
|
that does not itself have an `any' inst).
|
|
|
|
Such terms can be expressed by using `any_pred' and `any_func' in place of
|
|
`pred' and `func', as in the following examples:
|
|
|
|
AnyPred = (any_pred(X::ia, C::in) is semidet :-
|
|
geqc(X, A, C) % X >= A + C
|
|
),
|
|
...
|
|
call(AnyPred, Z, 5) % Z >= A + 5
|
|
|
|
AnyFunc = (any_func(X::ia) = (Y::ia) is semidet :-
|
|
X = Y + A
|
|
),
|
|
...
|
|
Z = apply(AnyFunc, W) % W = Z + A
|
|
|
|
* Try goals provide syntactic sugar for catching exceptions. An example is:
|
|
|
|
:- pred p_carefully(io::di, io::uo) is det.
|
|
|
|
p_carefully(!IO) :-
|
|
(try [io(!IO)] (
|
|
io.write_string("Calling p\n", !IO),
|
|
p(Output, !IO)
|
|
)
|
|
then
|
|
io.write_string("p returned: ", !IO),
|
|
io.write(Output, !IO),
|
|
io.nl(!IO)
|
|
catch S ->
|
|
io.write_string("p threw a string: ", !IO),
|
|
io.write_string(S, !IO),
|
|
io.nl(!IO)
|
|
catch 42 ->
|
|
io.write_string("p threw 42\n", !IO)
|
|
catch_any Other ->
|
|
io.write_string("p threw something: ", !IO),
|
|
io.write(Other, !IO),
|
|
% Rethrow the object.
|
|
throw(X)
|
|
).
|
|
|
|
Changes to the Mercury compiler:
|
|
|
|
* The option `--trail-segments', or grade component `.trseg', causes
|
|
programs to execute using trail segments, where segments can be allocated
|
|
at runtime, instead of using a fixed size trail. This can prevent trail
|
|
exhaustion, but execution time will be increased.
|
|
|
|
* There's a new back-end that targets Erlang.
|
|
|
|
Compiler support for this new back-end is mostly complete,
|
|
but large parts of the standard library are still not yet
|
|
implemented for this new port.
|
|
|
|
For more details, see the README.Erlang.
|
|
|
|
* The compiler now issues a warning when an inst declaration isn't
|
|
consistent with any of the types in scope.
|
|
|
|
This makes it easier to diagnose mode errors caused by insts that are not
|
|
consistent with the type they are intended to be consistent with.
|
|
|
|
* Simultaneous execution of jobs with `mmc --make' can be enabled with
|
|
the `--jobs <n>' option.
|
|
|
|
* `mmc --make' can record what compiler options were used for each module
|
|
by enabling the `--track-flags' option. Then `mmc --make' can know to
|
|
recompile modules whose options have changed, even if the files haven't
|
|
been touched.
|
|
|
|
* `mmc --make' can compile more recently modified files first, if the option
|
|
`--order-make-by-timestamp' is enabled.
|
|
|
|
* The option `--stack-segments', or grade component `.stseg', causes
|
|
programs to execute using stack segments, where segments can be allocated
|
|
at runtime, instead of using fixed sized stacks. The program won't run out
|
|
of stack space and stack sizes can be much smaller, but execution time will
|
|
be increased.
|
|
|
|
* Single-precision floats can now be selected for the C backends by using the
|
|
`.spf' grade component, or passing the `--single-prec-float' option to the
|
|
compiler.
|
|
|
|
* The option `--generate-standalone-interface', causes the compiler to
|
|
create a "stand-alone" interface to the Mercury runtime and a set of
|
|
Mercury libraries. This interface allows programs written in languages
|
|
such as C or C++ to initialise the Mercury runtime and libraries prior to
|
|
calling any foreign exported procedures defined in those libraries.
|
|
|
|
* We have removed support for Managed C++ as a foreign language for the IL
|
|
backend. This was desirable because it wasn't used, because it has been
|
|
deprecated by Microsoft, and because it complicated the dependencies for the
|
|
IL backend.
|
|
|
|
Changes to the Mercury standard library:
|
|
|
|
* The predicates io.seek_binary/5 and io.binary_stream_offset/4 have been
|
|
deprecated. They have been replaced by the predicates:
|
|
io.seek_binary_input/5, io.seek_binary_output/5,
|
|
io.binary_input_stream_offset/4 and io.binary_output_stream_offset/4.
|
|
|
|
Changes to the Mercury debugger:
|
|
|
|
* A `track' mdb command has been added. This command invokes the declarative
|
|
debugger and executes it's `track' command, before returning to the mdb
|
|
prompt.
|
|
|
|
* The `dd' command now accepts a `--reset-knowledge-base' option.
|
|
This option resets the declarative debugger's knowledge base of previous
|
|
question answers.
|
|
|
|
* You can now put breakpoints on individual events inside procedures.
|
|
Commands of the form "break <procedure-specification> <portname>"
|
|
will cause execution to stop only at the specified port in the specified
|
|
procedure. If there is more than event of the given port type in the
|
|
procedure, mdb will prompt the user to select one.
|
|
|
|
* mdb now ignores lines beginning with a `#' character
|
|
in sourced files. This is useful for commenting mdb scripts.
|
|
|
|
|
|
NEWS for Mercury 11.01, 27 April 2011
|
|
-------------------------------------
|
|
|
|
Upcoming changes to the Mercury standard library:
|
|
|
|
* In the next release after 11.01 we intend to change the argument order of
|
|
many of the predicates in the standard library so as to make them more
|
|
conducive to the use of state variable notation.
|
|
|
|
For example, map.insert/4 will be changed from
|
|
|
|
map.insert(map(K, V)::in, K::in, V::in, map(K, V)::out) is semidet.
|
|
|
|
to
|
|
|
|
map.insert(K::in, V::in, map(K, V)::in, map(K, V)::out) is semidet.
|
|
|
|
As part of this change, the sv* modules will be deprecated; they will
|
|
be removed from the library in a later release.
|
|
|
|
Note that none of these upcoming changes affect the 11.01 release.
|
|
|
|
|
|
HIGHLIGHTS
|
|
==========
|
|
|
|
Changes to the Mercury language:
|
|
|
|
* We have added two new kinds of scopes to the language.
|
|
|
|
A scope introduced by one of the new keywords require_det, require_semidet,
|
|
require_multi, require_nondet, require_cc_multi, require_cc_nondet,
|
|
require_erroneous and require_failure, as the name implies, requires
|
|
the goal inside the scope to have the given determinism.
|
|
|
|
A scope introduced by the keyword require_complete_switch requires the
|
|
goal inside the scope, if it is a switch on the variable named by the scope,
|
|
to be a complete switch, i.e. to have arms for all the function symbols
|
|
in the type of the switched-on variable.
|
|
|
|
Changes to the Mercury standard library:
|
|
|
|
* We have added semidet modes for hash_table.fold/4 and
|
|
version_hash_table.fold/4.
|
|
|
|
* We have added new predicates and functions added to the assoc_list module.
|
|
The predicates map_keys_only/3 map_values_only/3 and map_values/3 complement
|
|
the functions of the same name. The predicates filter/3, negated_filter/3,
|
|
filter/4, merge/3, which also have function versions, do jobs very similar
|
|
to the predicates of the same name in the list module, but do the relevant
|
|
operations on keys instead of entire list elements.
|
|
|
|
+ We have moved the lazy evaluation module out of the extras distribution and
|
|
into a new standard library module called `lazy'. It has also been made
|
|
backend-agnostic.
|
|
|
|
* We have made changes to the list module of the standard library:
|
|
|
|
+ We added a new predicate list.member_index0/3. It is like list.member/2
|
|
except that it also takes a parameter representing the zero-based index of
|
|
the element within the list.
|
|
|
|
+ We added a new predicate list.map3_foldl/7 which maps over a list producing
|
|
three lists and one folded value.
|
|
|
|
+ We added semidet modes with unique accumulators for list.foldl3/8,
|
|
list.foldl4/10, list.foldl5/12, and list.foldl6/14.
|
|
|
|
* We have added the predicates divide/4 and divide_by_set/4 to the tree_bitset
|
|
module of the standard library.
|
|
|
|
* We have added the predicates set_ctree234.member/2 and
|
|
set_ctree234.non_empty/1. We have add the function
|
|
set_ctree234.from_list/1.
|
|
|
|
* We have added the predicate set_bbbtree.count/2 and the
|
|
function set_bbbtree.count/1. These replace the predicate
|
|
set_bbbtree.size/2 which is now deprecated.
|
|
|
|
* We have added the predicate set_ordlist.non_empty/1.
|
|
|
|
* We have added the predicate set_tree234.non_empty/1 and the
|
|
function set_tree234.from_list/1.
|
|
|
|
* We have added the predicates set_unordlist.non_empty/1 and
|
|
set_unordlist.count/2, and the function set_unordlist.count/1.
|
|
|
|
* All of the modules in the standard library that implement the set ADT,
|
|
(set, set_ordlist, set_unordlist, set_bbbtree, set_tree234,
|
|
and set_ctree234), now support folding over sets with up to six
|
|
accumulators. Modes that provide unique and mostly-unique accumulators
|
|
for set fold have also been added.
|
|
|
|
* We have made the following changes to the array module of the standard
|
|
library:
|
|
|
|
+ We have added the functions unsafe_elem/2 and append/2.
|
|
|
|
+ We have added the predicates svset/4, unsafe_svset/4, foldl2/4, foldl2/6,
|
|
foldr/4, foldr2/6, map_foldl/5, map_corresponding_foldl/6, and member/2.
|
|
|
|
* We have added the predicates version_array.foldl2/6, version_array.foldr/4,
|
|
and version_array.foldr2/6 to the standard library.
|
|
|
|
* We have added semidet modes with unique and mostly-unique accumulators for
|
|
the following predicates:
|
|
bimap.foldl2/6
|
|
bimap.foldl3/8
|
|
cord.foldl_pred/4
|
|
cord.map_foldl/5
|
|
list.map_corresponding_foldl2/8
|
|
list.map_corresponding_foldl3/10
|
|
list.map_corresponding3_foldl/7
|
|
map.foldl3/8
|
|
|
|
* We have added the predicate unsorted_aggregate2/6 to the solutions module
|
|
of the standard library.
|
|
|
|
* We have added several predicates and functions to the require module
|
|
of the standard library. The predicates sorry/2 and sorry/3 report
|
|
the absence of a feature, while the predicates unexpected/2 and unexpected/3
|
|
report an internal error in the program; all have function versions too.
|
|
The predicate expect/3 calls unexpected if a condition isn't satisfied.
|
|
We now have expect/4 as well as expect/3. For expect/4 as well as expect/3,
|
|
the first and last arguments are the expected condition and the error message
|
|
respectively, but with expect/4, there are two arguments in the middle
|
|
to specify the location of the error (normally the name of the module
|
|
and of the predicate respectively). We also added expect_not/3 and
|
|
expect_not/4, which are like expect/3 and expect/4 respectively,
|
|
except they expect the condition to be *false*, not true.
|
|
|
|
Changes to the Mercury compiler:
|
|
|
|
* We have added a new backend that generates C#.
|
|
|
|
* Support for building and linking against frameworks on Mac OS X has
|
|
been improved.
|
|
|
|
Changes to the extras distribution:
|
|
|
|
* We have added a binding to the Cairo 2D graphics library.
|
|
|
|
|
|
DETAILED LISTING
|
|
================
|
|
|
|
Changes to the Mercury compiler:
|
|
|
|
* We have added a new backend that generates C#.
|
|
For more details, see the README.CSharp.
|
|
|
|
The new backend was contributed by Mission Critical IT
|
|
<http://www.missioncriticalit.com/>.
|
|
|
|
* We have added two new options, --framework and --framework-directory
|
|
in order to simplify building and linking against frameworks on Mac OS X.
|
|
(-F is supported as a synonym for --framework-directory.)
|
|
|
|
* Switches on strings in which all output arguments in all switch arms are
|
|
bound to constants are now implemented using lookup tables on the LLDS
|
|
back end. This should make the generated code more compact as well as faster.
|
|
|
|
|
|
NEWS for Mercury 11.07.2, 3 August 2012
|
|
---------------------------------------
|
|
|
|
This is a bug-fix release: it fixes the following:
|
|
|
|
* The name of the C# compiler in newer versions of Mono is now recognised.
|
|
|
|
* The configure script now distinguishes between the MS C# compiler and the
|
|
Chicken Scheme compiler.
|
|
|
|
* Thread local storage now works on Mac OS X when using clang as the C
|
|
compiler.
|
|
|
|
* Various build issues on Solaris 10 have been resolved.
|
|
|
|
* The --erlang option now sets all the relevant grade components correctly.
|
|
|
|
* The binary input and output streams are now set to binary translation
|
|
mode when using the MSVC CRT.
|
|
|
|
* The standard library's lexer module now correctly tokenizes binary, octal
|
|
and hexadecimal integer literals.
|
|
|
|
* Some bugs in the UTF-8 routines used by the C grades have been fixed.
|
|
Also, the performance of these routines has been improved.
|
|
|
|
* The exit status is now correctly set when --warn-non-tail-recursion
|
|
is being used.
|
|
|
|
Changes to the Mercury standard library:
|
|
|
|
* We have added additional modes to map.foldr/4, map.foldr/6 and the
|
|
list.foldl<N>_corresponding3 predicates.
|
|
|
|
* The predicates parsing_utils.float_literal/3 and
|
|
parsing_utils.float_literal_as_string/4 now accept an optional plus sign in
|
|
the exponent.
|
|
|
|
* The obsolete predicates string.remove_suffix_det/2 and string.index_det/2
|
|
have been removed.
|
|
|
|
* The predicate time.times/4 is now implemented for the csharp grade.
|
|
|
|
* The version_hash_table module is now supported in the csharp and java
|
|
grades.
|
|
|
|
* The unsafe versions of the predicates in the array2d module are now more
|
|
efficient.
|
|
|
|
Changes to the Mercury compiler:
|
|
|
|
* The compiler now outputs #line directives in C# code it generates.
|
|
|
|
|
|
NEWS for Mercury 11.07.1, 2 March 2012
|
|
--------------------------------------
|
|
|
|
This is a bug-fix release. It fixes a problem that was preventing the standard
|
|
library from building in the csharp grade on Cygwin and also adds support for
|
|
using GCC in C99 (or GNU99) mode with Mercury. In addition, there are a number
|
|
of minor changes to the standard library.
|
|
|
|
Changes to the Mercury standard library:
|
|
|
|
* We have added the predicate map.keys_and_values/3.
|
|
|
|
* We have added the predicates set.is_singleton/2, set_bbbtree.is_singleton/2,
|
|
set_ctree234.is_singleton/2 and set_unordlist.is_singleton/2.
|
|
|
|
* We have added the function list.foldl_corresponding/4.
|
|
|
|
|
|
NEWS for Mercury 11.07, 22 December 2011
|
|
----------------------------------------
|
|
|
|
HIGHLIGHTS
|
|
==========
|
|
|
|
Changes to the Mercury language:
|
|
|
|
* The `char' type now represents a Unicode code point.
|
|
|
|
* Unicode characters can now be encoded in string literals using an
|
|
escape sequence. The escape sequence \uXXXX (or \UXXXXXXXX), where XXXX
|
|
(or XXXXXXXX) is a Unicode character code in hexadecimal, is replaced with
|
|
the corresponding Unicode character.
|
|
|
|
* Expressions used to initialise mutables may now contain impure
|
|
or semipure function calls.
|
|
|
|
Changes to the Mercury standard library:
|
|
|
|
* We have improved Unicode support in the standard library.
|
|
|
|
* We have deprecated substring procedures which take start and count
|
|
arguments in favour of procedures which take start and end arguments.
|
|
|
|
* We have changed the argument order of many of the predicates in the array,
|
|
bag, bimap, eqvclass, map, multi_map, queue and set modules in order
|
|
to make them more conducive to the use of state variable notation.
|
|
|
|
Changes to the Mercury compiler:
|
|
|
|
* Support for using clang (<http://clang.llvm.org/>) as a C compiler with
|
|
Mercury has been added. See README.clang for further details
|
|
|
|
* We have significantly improved support for using Microsoft Visual C as
|
|
a C compiler with Mercury. See README.MS-VisualC for further details.
|
|
|
|
* The Java code generated by the Java backend is now compatible with Java 1.7.
|
|
|
|
Changes to the Mercury profiler:
|
|
|
|
* We have added a new form of profiling, memory retention profiling, to mprof
|
|
that allows it to generate reports describing the origin of objects that
|
|
are live on the heap at selected points in a program.
|
|
See the Mercury User's Guide for details.
|
|
|
|
|
|
DETAILED LISTING
|
|
================
|
|
|
|
Changes to the Mercury standard library:
|
|
|
|
* We have improved Unicode support in the standard library.
|
|
|
|
+ Procedures in the string module now understand either UTF-8 or
|
|
UTF-16 encodings, depending upon the backend.
|
|
|
|
+ Text I/O routines now read and write files in UTF-8 encoding.
|
|
|
|
* We have deprecated substring procedures which take start and count
|
|
arguments in favour of procedures which take start and end arguments.
|
|
The new procedures are more convenient to call, make more sense with
|
|
variable-width character encodings, and pave the way for potentially
|
|
replacing string offsets with an abstract type.
|
|
|
|
* We have added additional modes for set.map/3 and set.map_fold/5.
|
|
|
|
* The argument order of the following predicates has been changed so as to
|
|
make them more conducive to the use of state variable notation:
|
|
array.set/4, array.semidet/4, array.slow_set/4, array.semidet_slow_set/4,
|
|
array.resize/4, array.shrink/3, bag.insert/3, bag.insert_list/3,
|
|
bag.insert_set/3, bag.remove/3, bag.det_remove/3, bag.remove_list/3,
|
|
bag.remove_set/3, bag.delete/3, bag.remove_all/3, bag.delete_all/3,
|
|
bag.remove_smallest/3, bimap.insert/4, bimap.det_insert/4, bimap.set/4,
|
|
eqvclass.ensure_element/3, eqvclass.new_element/3,
|
|
eqvclass.ensure_equivalence/4, eqvclass.new_equivalence/4,
|
|
eqvclass.remove_equivalent_elements/3, map.insert/4, map.det_insert/4,
|
|
map.det_insert_from_corresponding_lists/4,
|
|
map.det_insert_from_assoc_list/3, map.set_from_corresponding_lists/4,
|
|
map.set_from_assoc_list/3, map.update/4, map.det_update/4, map.delete/3,
|
|
map.delete_list/3, map.remove/4, map.det_remove/4, map.remove_smallest/4,
|
|
multi_map.insert/4, multi_map.det_insert/4, multi_map.update/4,
|
|
multi_map.det_update/4, multi_map.det_replace/4, multi_map.set/4,
|
|
multi_map.add/4, multi_map.delete/4, multi_map.remove/4, and
|
|
multi_map.remove_smallest/4, queue.put/3, queue.put_list/3,
|
|
queue.get/3, queue.delete_all/3, queue.put_on_front/3,
|
|
queue.get_from_back/3, queue.put_list_on_front/3,
|
|
queue.get_from_back/3, rbtree.insert/4, rbtree.update/4, rbtree.set/4,
|
|
rbtree.delete/3, rbtree.remove_smallest/4, rbtree.remove_largest/4,
|
|
set.insert/3, set.insert_list/3, set.delete/3, set.delete_list/3,
|
|
set.remove/3, set.remove_list/3, set.remove_least/3, tree234.insert/4,
|
|
set_bbbtree.insert/3, set_bbbtree.insert_list/3, set_bbbtree.delete/3,
|
|
set_bbbtree.delete_list/3, set_bbbtree.remove/3, set_bbbtree.remove_list/3,
|
|
set_bbbtree.remove_least/3, set_bbbtree.remove_largest/3,
|
|
set_ordlist.insert/3, set_ordlist.insert_list/3, set_ordlist.delete/3,
|
|
set_ordlist.delete_list/3, set_ordlist.remove/3, set_ordlist.remove_list/3,
|
|
set_ordlist.remove_least/3, set_unordlist.insert/3,
|
|
set_unordlist.insert_list/3, set_unordlist.delete/3,
|
|
set_unordlist.delete_list/3, set_unordlist.remove/3,
|
|
set.unordlist.remove_list/3, set_unordlist.remove_least/3,
|
|
sparse_bitset.insert/3, sparse_bitset.insert_list/3, sparse_bitset.delete/3,
|
|
sparse_bitset.delete_list/3, sparse_bitset.remove/3,
|
|
sparse_bitset.remove_list/3, sparse_bitset.remove_leq/3,
|
|
sparse_bitset.remove_gt/3, sparse_bitset.remove_least/3,
|
|
term.create_var/3, tree234.set/4, tree234.remove/4, tree234.remove_smallest/4,
|
|
tree234.update/4, tree_bitset.insert/3, tree_bitset.insert_list/3,
|
|
tree_bitset.delete/3, tree_bitset.delete_list/3, tree_bitset.remove/3,
|
|
tree_bitset.remove_list/3 and tree_bitset.remove_least/3
|
|
|
|
* We have added the following new functions for creating singleton
|
|
maps: bimap.singleton/2, injection.singleton/2, map.singleton/2,
|
|
rbtree.singleton/2 and tree234.singleton/2 .
|
|
|
|
* The following procedures have been added to the standard library:
|
|
|
|
array2d.init/3
|
|
bitmap.init/2
|
|
cord.init/0
|
|
hash_table.init/3
|
|
hash_table.init_default/1
|
|
mvar.init/0
|
|
mvar.read/4
|
|
mvar.try_put/5
|
|
store.init/1
|
|
semaphore.init/1
|
|
semaphore.init/3
|
|
version_array.init/2
|
|
version_array2d.init/3
|
|
version_bitmap.init/2
|
|
version_hash_table.init/3
|
|
version_hash_table.unsafe_init/3
|
|
version_hash_table.init_default/1
|
|
version_hash_table.unsafe_init_default/1
|
|
version_store.init/0
|
|
|
|
They replace the following procedures, which are now obsolete and will be
|
|
removed in a later release:
|
|
|
|
array2d.new/3
|
|
bitmap.new/2
|
|
hash_table.new/3
|
|
hash_table.new_default/1
|
|
semaphore.new/1
|
|
semaphore.new/3
|
|
store.new/1
|
|
string.foldl2_substring/8
|
|
string.foldl_substring/5
|
|
string.foldl_substring/6
|
|
string.foldr_substring/5
|
|
string.foldr_substring/6
|
|
string.substring/3
|
|
string.substring/4
|
|
string.unsafe_substring/3
|
|
string.unsafe_substring/4
|
|
version_array.new/2
|
|
version_array2d.new/3
|
|
version_bitmap.new/2
|
|
version_hash_table.new/3
|
|
version_hash_table.new_default/1
|
|
version_hash_table.unsafe_new/3
|
|
version_hash_table.unsafe_new_default/1
|
|
version_store.new/0
|
|
|
|
* The following procedures are have been deprecated and will be removed in
|
|
a future release: dir.basename_det/1, list.replace_nth_det/3,
|
|
list.replace_nth_det/4, list.index0_det/2, list.index1_det/2,
|
|
list.index0_det/2, list.index1_det/2, list.last_det/1, stack.top_det/1,
|
|
stack.pop_det/3, string.remove_suffix_det/2, string.index_det/2,
|
|
string.index_det/3, string.set_char_det/3, string.set_char_det/4 and
|
|
type_desc.ground_pseudo_type_desc_type_to_type_desc_det/1.
|
|
|
|
The versions of these procedures that use "det_" as a prefix should be
|
|
used instead. (We have added these where they did not already exist.)
|
|
|
|
* The deprecated modules graph, group and relation are no longer included
|
|
in the library.
|
|
|
|
* The following predicates have been added to the modules that provide sets
|
|
in the library: set.is_empty/1, set_bbbtree.is_empty/1,
|
|
set_ctree234.is_empty/1, set_ordlist.is_empty/1, set_tree234.is_empty/1,
|
|
set_unordlist.is_empty/1, sparse_bitset.is_empty/1, tree_bitset.is_empty/1,
|
|
set.filter/4, set_bbbtree.filter/3, set_bbbtree.filter/4, set_ctree.filter/3,
|
|
set_ctree.filter/4, set_ordlist.filter/3, set_ordlist.filter/4,
|
|
set_tree.filter/3, set_tree.filter/4, set_unordlist.filter/3,
|
|
set_unordlist.filter/4, sparse_bitset.filter/3, sparse_bitset.filter/4,
|
|
tree_bitset.filter/3, tree_bitset.filter/4.
|
|
|
|
All the is_empty predicates are synonyms for the existing empty/1 predicates
|
|
in those modules.
|
|
|
|
* We have added the predicate pqueue.det_remove/4. It is like pqueue.remove/4
|
|
except that it throws an exception instead of failing if the priority queue
|
|
is empty.
|
|
|
|
* The new modules svlist, svstack and svpqueue provide state variable friendly
|
|
versions of predicates in the list, stack and pqueue modules.
|
|
(As with the other sv* modules these modules are intended to pave the
|
|
way for an eventual change of the predicate argument ordering in the
|
|
list, stack and pqueue modules.)
|
|
|
|
* We have added additional modes with unique and mostly-unique accumulators
|
|
to rbtree.foldl/4, rbtree.foldl2/6 and tree_bitset.foldl/4.
|
|
|
|
* A new function, array.generate/2, and new predicate, array.generate_foldl/5,
|
|
can be used to create and fill new arrays.
|
|
|
|
* We have added the new predicate assoc_list.foldl_keys/4 and
|
|
assoc_list.foldl_values/4 for folding over just keys or values
|
|
an association list.
|
|
|
|
* We have added the new function array.from_reverse_list/1, which creates
|
|
a new array from a list with the elements of the array occurring in
|
|
the reverse order to that of the list.
|
|
|
|
* We have added a version of the field update function for arrays that
|
|
omits the bounds check, 'unsafe_elem :='/3.
|
|
|
|
* We have added the predicates array.foldl3/8, array.foldl4/10, array.foldl5/12,
|
|
array.foldr3/8, array.foldr4/10 and array.foldr5/12.
|
|
|
|
* We have added the predicate maybe.map_fold3_maybe/9 and also added
|
|
additional modes for maybe.fold_maybe/4, maybe.map_fold_maybe/5,
|
|
and maybe.map_fold2_maybe/7.
|
|
|
|
* The implementation of multi_map.det_update/4 has been fixed so that it
|
|
conforms to the documented behaviour. The new predicate multi_map.replace/4
|
|
has been added.
|
|
|
|
* We have added a version of math.sqrt/1, math.unchecked_sqrt/1, that omits
|
|
the domain check.
|
|
|
|
|
|
NEWS for Mercury 13.05.2, 2 December 2013
|
|
-----------------------------------------
|
|
|
|
This is a bug-fix release.
|
|
|
|
* The following functions in the standard library's cord module now use
|
|
constant stack space: list/1, rev_list/1, cord_list_to_cord/1 and
|
|
cord_list_to_list/1.
|
|
* Linker options set via the LDFLAGS and EXTRA_LDFLAGS mmake variables
|
|
are now applied to all executables in the Mercury system. Likewise,
|
|
for shared libraries and the LD_LIBFLAGS and EXTRA_LD_LIBFLAGS mmake
|
|
variables. (Bug #288)
|
|
* We have added a workaround for a problem that was preventing the
|
|
asm_fast grades working with GCC 4.8. (Bug #293)
|
|
* Fix inst for constant type_infos. (Bug #297)
|
|
* Fix compiler abort during liveness detection. (Bug #51)
|
|
* We have fixed a bug that caused a compiler abort in the last
|
|
call modulo constructor optimisation in the Java grade. (Bug #300)
|
|
* Respect memory alignment requirements for doubles. (Bug #299)
|
|
* Fix incorrect handling of deconstructions in pass for float registers
|
|
support. (Bug #301)
|
|
|
|
Changes to the Mercury standard library:
|
|
|
|
* We have added the predicates map.equal/2 and tree234.equal/2 which
|
|
test maps and 2-3-4 trees respectively for semantic equality.
|
|
|
|
|
|
NEWS for Mercury 13.05.1, 14 June 2013
|
|
--------------------------------------
|
|
|
|
This is a bug-fix release.
|
|
|
|
* Various build problems on Solaris and NetBSD have been fixed.
|
|
* The C# compiler for use by the csharp grade can now be specified using
|
|
a new option to the configure script, `--with-csharp-compiler'. This
|
|
fixes a problem where it was not possible to build the Mercury libraries
|
|
in the csharp grade against version 4.0 of the .NET framework using
|
|
Mono. (See README.CSharp for further details.)
|
|
* In C grades, closing a file stream multiple times no longer causes a
|
|
segmentation fault. (Bug #161)
|
|
* `--warn-dead-procs' no longer emits warnings for procedures if they are
|
|
foreign exported to any language. Previously, warnings were incorrectly
|
|
emitted if there were only foreign_export pragmas for foreign languages
|
|
unsupported by the current backend. (Bug #183)
|
|
* The compiler now emits a warning if the variable that is the subject
|
|
of a require_complete_switch scope does not appear in the scoped goal.
|
|
(Bug #257)
|
|
* A bug that caused a compiler abort in the low-level C backend has been
|
|
fixed.
|
|
|
|
Changes to the Mercury standard library:
|
|
|
|
* We have added the function bimap.count/1.
|
|
|
|
* An equality predicate is now defined for version_hash_tables.
|
|
|
|
|
|
NEWS for Mercury 13.05, 16 May 2013
|
|
-----------------------------------
|
|
|
|
Changes to the Mercury standard library:
|
|
|
|
* We have swapped the argument order of the predicates set.singleton_set/2,
|
|
set_bbbtree.singleton_set/2, set_ordlist.singleton_set/2 and
|
|
set_unordlist.singleton_set/2 so that it conforms with the order in the
|
|
other set modules.
|
|
|
|
* All the modules that operate on sets now have two new predicates.
|
|
One is insert_new: if the item is not already in the set, it inserts
|
|
the item, otherwise it fails. The other is all_true: it succeeds if
|
|
and only if all elements in the set pass a test.
|
|
|
|
* The map and varset modules each have a new predicate that deletes
|
|
a sorted list of items from a map or varset, and can do so faster than
|
|
usual by exploiting the order.
|
|
|
|
* The map, bimap and tree234 modules each have a new predicate that does
|
|
a search, and if the search is unsuccessful, does an insertion during
|
|
the *same* traversal.
|
|
|
|
* The argument order of the following predicates has been changed so as to
|
|
make them more conducive to the use of state variable notation:
|
|
pqueue.insert/4, pqueue.remove/4, stack.push/3, stack.push_list/3,
|
|
stack.pop/3 and stack.det_pop/3.
|
|
|
|
* We have added versions of the operations in the math module that omit the
|
|
domain checks.
|
|
|
|
* We have added new predicates to the parsing_utils module:
|
|
input_string/3, get_skip_whitespace_pred/2 and next_char_no_progress/4.
|
|
|
|
* The lexer module returns base 10 integer literals in the string
|
|
representation, if the integer is too large for an `int'.
|
|
|
|
* We have add the following new predicates to the list module:
|
|
list.all_true_corresponding/3, list.all_false_corresponding/3 and
|
|
list.same_length3/3.
|
|
|
|
* We have added the type maybe.maybe_error/2 which is polymorphic in the
|
|
error type.
|
|
|
|
* We have added predicates to the calendar module for folding over the days
|
|
in a given range of dates: foldl_days/5, foldl2_days/7 and foldl3_days/9.
|
|
|
|
* We have added two functions to both the hash_table and version_hash_table
|
|
modules: copy/1 and from_assoc_list/4.
|
|
|
|
Changes to the Mercury compiler:
|
|
|
|
* Generation of 64-bit code on Windows using the MinGW64 port of GCC
|
|
is now supported, i.e. the x86_64-w64-mingw32 architecture is now
|
|
supported.
|
|
|
|
* We have improved compilation times for very large programs. In
|
|
particular, compilation times for predicates containing the following
|
|
have been improved:
|
|
- large ground terms
|
|
- large disjunctions
|
|
- large numbers of higher order constructs and/or code that uses
|
|
large hierarchies of type classes
|
|
|
|
* We have implemented a type representation optimisation, where a functor
|
|
with exactly one argument can be represented by a tagged pointer to the
|
|
argument value, which itself does not require the tag bits.
|
|
|
|
* In C grades, consecutive enumeration arguments in discriminated
|
|
union types can now be packed into a single word.
|
|
|
|
* Double-precision `float' constructor arguments are now stored in
|
|
unboxed form in high-level C grades.
|
|
|
|
* Double-precision `float' constructor arguments are now stored in
|
|
unboxed form on 32-bit architectures in the low-level C grades.
|
|
This was previously so for 64-bit architectures.
|
|
|
|
* Double-precision float arguments can now be passed via dedicated Mercury
|
|
abstract machine registers to avoid boxing, in low-level C grades on
|
|
32-bit architectures. Float variables can occupy two words on the
|
|
Mercury stack to avoid boxing.
|
|
|
|
* The option `--warn-non-tail-recursion' no longer requires
|
|
`--high-level-code'.
|
|
|
|
* A new option, `--sign-assembly', provides supports for signing
|
|
assemblies generated by the C# backend with a strong name.
|
|
|
|
* A new option, `--cstack-reserve-size', allows the size of the C
|
|
stack for executables to be changed on Microsoft Windows systems.
|
|
|
|
Changes to the Mercury debugger:
|
|
|
|
* We have added new capabilities to the "level", "retry" and "finish" mdb
|
|
commands. If these commands are given the argument "clentry", they will
|
|
operate on the ancestor of the current call that represents entry to the
|
|
clique of mutually recursive procedures that the current call belongs to.
|
|
If they are given the argument "clparent", they will operate on the parent
|
|
of that call.
|
|
|
|
* The mdb command "stack" can now find and mark cliques of mutually recursive
|
|
calls on the stack, and can (and by default, will) impose a limit on the
|
|
number of lines it prints for each clique.
|
|
|
|
Changes to the extras distribution:
|
|
|
|
* We have added a binding to the GLFW library.
|
|
|
|
|
|
NEWS for Mercury 14.01.2, not released
|
|
--------------------------------------
|
|
|
|
This is a bug-fix release.
|
|
|
|
* Fix array.sort, which has been buggy since 2001. You may wish to
|
|
reference array.sort_fix_2014 to ensure that you are using the fixed version.
|
|
* Fix the handling of nondet code by the auto-parallelisation analysis in
|
|
mdprof_create_feedback. (Bug #364)
|
|
* Fix string.between_codepoints so that the clamping of start/end points
|
|
works as documented.
|
|
|
|
|
|
NEWS for Mercury 14.01.1, 8 September 2014
|
|
------------------------------------------
|
|
|
|
This is a bug-fix release.
|
|
|
|
* The function string.string/1 and related functions now handle version
|
|
arrays properly.
|
|
* Fix resource leaks in dir fold predicates.
|
|
* The mfilterjavac program is now generated with the correct file extension
|
|
on Windows.
|
|
* A problem that caused compilation of the Boehm GC to fail on 64-bit
|
|
openSUSE 13.1 systems has been fixed. (Github issue #14)
|
|
* The documentation now builds correctly on Cygwin systems.
|
|
* The script configure_mingw_cross now supports 64-bit Windows targets.
|
|
* We have added workarounds for problems with (arguably broken)
|
|
system headers on MinGW and MinGW64 systems.
|
|
* The MinGW port now builds in the absence of POSIX threads library.
|
|
* Low-level C parallel grades now work on Windows instead of crashing
|
|
at startup. (Bug #338)
|
|
* We now use thread-safe alternatives to strerror(). (Bug #340)
|
|
* We have added the configure option --enable-gc-mmap.
|
|
* We configure Boehm GC to use mmap in threaded grades on Linux to avoid
|
|
conflicts with glibc malloc leading to memory corruption.
|
|
* A problem that caused string.format/[23] to sometimes return incorrect
|
|
results when formatting floats with the 'g' conversion specifier has
|
|
been fixed. This bug only affected the non-C backends. (Bug #342)
|
|
* string.format now handles special float values (i.e. nan, inf, and -inf)
|
|
correctly with the non-C backends.
|
|
* A bug that caused io.write_float/[34] to append ".0" to float special values
|
|
has been fixed. This bug affected the C and C# backends.
|
|
* In the C# and Java grades, the predicate string.from_char_list now
|
|
implements the documented behaviour for input lists containing null
|
|
characters (i.e. it throws an exception).
|
|
Likewise, for string.from_reverse_char_list in the C# grade.
|
|
* We have fixed a problem that caused `mmc --make' to attempt to install
|
|
libraries in non-existent grades.
|
|
|
|
Changes to the Mercury compiler:
|
|
|
|
* The compiler now supports stripping of executables in a separate
|
|
post-link step. The new options, --strip-executable-command,
|
|
--strip-executable-shared-flags and --strip-executable-static-flags
|
|
are used to control this.
|
|
(This is now the default on Mac OS X systems.)
|
|
|
|
|
|
NEWS for Mercury 14.01, 10 February 2014
|
|
----------------------------------------
|
|
|
|
Changes to the Mercury language:
|
|
|
|
* Repeated type variables may now occur in the heads of type class instances.
|
|
For example, instance declarations like the following are now allowed:
|
|
|
|
:- instance foo(list(T), map(T, T)).
|
|
|
|
Changes to the Mercury standard library:
|
|
|
|
* We have added the function cord.condense/1.
|
|
|
|
* The following functions in the standard library's cord module now use
|
|
constant stack space: foldl/3, foldl_pred/4.
|
|
|
|
* We have added the following predicates to the array and version_array
|
|
modules: is_empty/1, all_true/2 and all_false/2.
|
|
|
|
* We have added the following predicates and functions to the map module:
|
|
det_min_key/1, det_max_key/1, foldl2_values/6 and foldl3_values/8.
|
|
|
|
* We have added the following predicates to the list module: foldr2/6,
|
|
foldr3/8, det_take/3 and map_foldr/5.
|
|
|
|
* We have added the following predicates to the bag module:
|
|
foldl/4, foldl2/6, and to_list_only_duplicates/2. The predicates
|
|
old union/3, intersect/3, least_upper_bound/3 and subtract/3 all had
|
|
complexities that depended strongly on the size of their second argument,
|
|
and much more weakly on the size of their first argument. We have renamed
|
|
these to union_small/3, intersect_small/3, least_upper_bound_small/3 and
|
|
subtract_small/3 respectively, and replaced them with new implementations
|
|
of the original four predicates whose complexity is proportional to
|
|
the total size of the two input arguments.
|
|
|
|
* We have added the following predicates to the assoc_list module:
|
|
foldl2_values/6 and foldl3_values/8.
|
|
|
|
* We have added the following predicates and functions to the pqueue module:
|
|
is_empty/1, peek/3, peek_key/2, peek_value/2, det_peek/3, merge/3,
|
|
det_peek_key/1 and det_peek_value/1.
|
|
|
|
* We have added the predicate bimap.equal/2.
|
|
|
|
* We have added the following predicates to the int module: fold_up3/9 and
|
|
fold_down3/9.
|
|
|
|
Changes to the Mercury compiler:
|
|
|
|
* On Mac OS X systems the compiler is now configured use the version of the
|
|
host system as the default value for the deployment target.
|
|
|
|
A new configuration option, `--with-macosx-deployment-target', allows
|
|
an alternative value to be selected at configuration time.
|
|
|
|
Portability improvements:
|
|
|
|
* We have made the implementation compatible with GCC 4.8 and Visual Studio
|
|
2013.
|
|
|
|
* We have made the implementation compatible with OS X 10.9.
|
|
|
|
Changes to the extras distribution:
|
|
|
|
* We've added a library that provides support for accessing the function
|
|
trail from Mercury code.
|
|
|
|
|
|
NEWS for Mercury 20.01.2, 3 May 2020
|
|
====================================
|
|
|
|
This is a bug-fix release.
|
|
|
|
* We have a fixed bug that prevented the runtime from building correctly
|
|
in C grades on 32-bit platforms when *not* using GCC as the C compiler.
|
|
|
|
* [Mantis bug #461]. We have fixed an assertion failure affecting programs
|
|
in low-level C parallel grades as they exit.
|
|
|
|
|
|
NEWS for Mercury 20.01.1, 1 March 2020
|
|
======================================
|
|
|
|
This is a bug-fix release.
|
|
|
|
* We have added a new option `--warn-suspicious-recursion` that asks the
|
|
compiler to warn about recursive calls which are likely to have problems,
|
|
such as leading to infinite recursion. (This feature was present in the
|
|
20.01 release but not announced.)
|
|
|
|
* We now allow combined higher-order types and insts as direct arguments of
|
|
functors in discriminated unions, as in the following type:
|
|
|
|
:- type job
|
|
---> job(pred(int::out, io::di, io::uo) is det).
|
|
|
|
For any construction unification using this functor the argument must have
|
|
the required higher-order inst; it is a mode error if it does not. When
|
|
terms of type `job` with inst `ground` are deconstructed, the argument is
|
|
inferred to have the given inst, allowing a higher-order call in that mode.
|
|
(This feature was present in the 20.01 release but not announced.)
|
|
|
|
* [Mantis bug #496]. The compiler now emits a reminder about the limitation
|
|
of common subexpression elimination in the presence of uniqueness when
|
|
this is a possible cause of determinism errors.
|
|
|
|
As of version 20.01, common subexpression elimination does not transform
|
|
|
|
(
|
|
X = f(A1, ..., An),
|
|
goal A
|
|
;
|
|
X = f(B1, ..., Bn),
|
|
goal B
|
|
)
|
|
|
|
into
|
|
|
|
X = f(X1, ..., Xn),
|
|
(
|
|
A1 = X1, ..., An = Xn,
|
|
goal A
|
|
;
|
|
B1 = X1, ..., Bn = Xn,
|
|
goal B
|
|
)
|
|
|
|
when the insts of some of the arguments of `X` are at least partially unique.
|
|
This is because the current mode analysis cannot track uniqueness through
|
|
the extra unifications that this transformation introduces.
|
|
|
|
|
|
NEWS for Mercury 20.01, 28 January 2020
|
|
=======================================
|
|
|
|
Changes to the core libraries license
|
|
-------------------------------------
|
|
|
|
* We have modified the terms under which the Mercury core libraries are
|
|
licensed by adding an exception to the requirements of clause 6 for
|
|
executable files linked against the Mercury core libraries.
|
|
|
|
See the file COPYING.LIB for the terms of the Mercury core library
|
|
license.
|
|
|
|
See the file LICENSE for licensing information in general.
|
|
|
|
The licensing of the compiler and other parts of the system has **not**
|
|
been changed.
|
|
|
|
Changes that may break compatibility
|
|
------------------------------------
|
|
|
|
* When the Mercury compiler looks at code using Mercury keywords (such as
|
|
`"func"` and `"pred"`) and Mercury operators (such as the clause neck
|
|
operator `":-"`) but which cannot be parsed as the Mercury constructs
|
|
that those Mercury keywords and operators are part of, it now generates
|
|
a specific error message for each discrepancy. In the past, when it found
|
|
such code, the compiler considered such code to construct terms and/or
|
|
to call functions and predicates. Usually, the terms did not belong to
|
|
any declared type and the called functions and predicates did not exist,
|
|
leading to confusing error messages from the compiler.
|
|
|
|
The compiler's new approach generates considerably better diagnostics,
|
|
but it does mean that code that uses Mercury's keywords and/or operators
|
|
in ways that are inconsistent with Mercury's own uses of those keywords
|
|
and operators will not compile anymore. Such code will need to be changed,
|
|
typically by changing the names of some function symbols, functions
|
|
or predicates.
|
|
|
|
* Code that switches on a field of a term could previously written directly as
|
|
|
|
(
|
|
Term ^ field = value1,
|
|
...
|
|
;
|
|
Term ^ field = value2,
|
|
...
|
|
)
|
|
|
|
The compiler would then internally rearrange this as
|
|
|
|
Field = Term ^ field,
|
|
(
|
|
Field = value1,
|
|
...
|
|
;
|
|
Field = value2,
|
|
...
|
|
)
|
|
|
|
and then recognize this as a switch on `Field`.
|
|
|
|
However, it turns out that while this transformation is valid
|
|
in the vast majority of cases (well in excess of 99%), it is not valid
|
|
in some rare circumstances involving terms with unique arguments.
|
|
This means that the current version of the compiler is not allowed
|
|
to do the above transformation automatically, so programmers must
|
|
perform it themselves if needed.
|
|
|
|
* We have enabled stricter checking of non-ground final insts to reject more
|
|
mode-incorrect code. Due to compiler limitations, some code that should be
|
|
accepted will now be rejected. They will require modifications to appease
|
|
the compiler. [Mantis bugs #86, #117, #191].
|
|
|
|
* We have enabled stricter checking of the requirement that a type, inst
|
|
or a mode that is *not* exported from a module may not be used in the
|
|
declarations of entities (such as predicates and typeclasses) that *is*
|
|
exported from that module. This may require the explicit export of e.g.
|
|
some types that previously were not exported.
|
|
|
|
* We have enabled stricter checking of type declarations and definitions:
|
|
all declarations and definitions of a type must agree on whether the type
|
|
is a solver type or not, and the definitions (as opposed to the names)
|
|
of solver types may not be exported from their defining module.
|
|
|
|
* We have enabled stricter checking of module accessibility rules.
|
|
If a module `m` has an `import_module` or `use_module` declaration for
|
|
module `x.y.z`, it must also have `import_module` or `use_module`
|
|
declarations for its ancestors `x` and `x.y`. And if the import or use
|
|
of `x.y.z` is in module `m`'s interface, then the import or use of `x.y.z`'s
|
|
ancestor modules must also be in the interface.
|
|
|
|
* The compiler now requires that, in projects that do not build
|
|
a `Mercury.modules` file using e.g. `mmc -f *.m`, submodules must be stored
|
|
in files whose name is the fully qualified module name followed by `.m`.
|
|
(This means that e.g. a module named `a.b.c` must be in a file named
|
|
`a.b.c.m`.) The reason for this change is that without it, the compiler
|
|
cannot tell whether a file named e.g. `lexer.m` contains the Mercury
|
|
standard library module `lexer`, or a submodule of a user-written
|
|
parent module. [Mantis bug #489].
|
|
|
|
* The `:- module` declaration in a separate submodule now must contain the
|
|
fully qualified module name.
|
|
|
|
* References to everything imported via `:- use_module` declarations
|
|
must now be fully module qualified.
|
|
|
|
* `for` is now an operator. (See the extension of the syntax of inst
|
|
declarations below.)
|
|
|
|
* It is now an error for a program to redefine a builtin type. The affected
|
|
type names are:
|
|
|
|
int
|
|
int{8,16,32,64}
|
|
uint
|
|
uint{8,16,32,64}
|
|
float
|
|
character
|
|
string
|
|
{}
|
|
=
|
|
pred
|
|
func
|
|
pure
|
|
semipure
|
|
impure
|
|
''
|
|
|
|
* It is now an error for a program to redefine a builtin inst. The affected
|
|
inst names are:
|
|
|
|
=<
|
|
any
|
|
bound
|
|
bound_unique
|
|
clobbered
|
|
clobbered_any
|
|
free
|
|
ground
|
|
is
|
|
mostly_clobbered
|
|
mostly_unique
|
|
mostly_unique_any
|
|
not_reached
|
|
unique
|
|
unique_any
|
|
|
|
* It is now an error for a program to redefine a builtin mode. The affected
|
|
mode names are:
|
|
|
|
=
|
|
>>
|
|
any_func
|
|
any_pred
|
|
func
|
|
is
|
|
pred
|
|
|
|
* We have deleted the builtin inst synonyms `old` and `new`: their uses
|
|
should be replaced with `any` and `free` respectively.
|
|
|
|
* We have deleted the builtin modes `no` and `oo`: their uses should be
|
|
replaced with `oa` and `ia` respectively.
|
|
|
|
* The minimum version of the Java platform required by Mercury's Java
|
|
backend is now Java SE 8.
|
|
|
|
* The representation of integer constants in the standard library's `term`
|
|
and `lexer` modules has been generalised. The base, signedness and size of
|
|
each integer constant is now recorded. Furthermore, these modules now use
|
|
arbitrary-precision integers to represent the values of integer constants.
|
|
|
|
Code that relies on the old representation of integer constants used by
|
|
the `term` or `lexer` modules may use the `old_term_parser` library in the
|
|
extras instead.
|
|
|
|
* We have changed the semantics of `int.(<<)` and `int.(>>)` so that they throw
|
|
an exception if their second operand is not in [0, bits_per_int). For now,
|
|
the old behaviour of these operations is provided by the functions
|
|
`int.legacy_left_shift/2` and `int.legacy_right_shift/2`. These functions
|
|
will be deleted in a future release.
|
|
|
|
* We have changed the semantics of `int.abs/1` so that it throws an exception
|
|
if its argument is equal to `int.min_int`. The old behaviour of this function
|
|
is provided by the new function `int.unchecked_abs/1`.
|
|
|
|
* We have changed the semantics of `array.map_corresponding_foldl/6` so that it
|
|
throws an exception if the input arrays differ in size.
|
|
|
|
* We have changed the semantics of `array.shrink/3` and `array.resize/4`
|
|
so that they throw an exception if their first argument is negative.
|
|
|
|
* We have changed the semantics of `array.fetch_items/4` so that it always
|
|
throws an exception if its second or third argument is out of bounds.
|
|
Previously, it would return an empty if list if its third argument was less
|
|
than the second even if one, or both, of these arguments was out of bounds.
|
|
|
|
* We have removed the `io.poly_type` equivalence type from the `io` module.
|
|
`string.poly_type` should be used directly. This may require an explicit
|
|
import of the `string` module.
|
|
|
|
* The predicates and functions in the `term` module that provide conversion
|
|
from arbitrary types to terms and vice versa have been moved to their own
|
|
module, `term_conversion`. See the changes to the `term` module below for
|
|
a list of affected predicates and functions.
|
|
|
|
* We have removed legacy support for the following systems:
|
|
|
|
- IRIX
|
|
- OSF/1
|
|
|
|
* The following compilation grades are no longer supported:
|
|
|
|
- asm_jump*
|
|
- jump*
|
|
- hl_nest*
|
|
- hlc_nest*
|
|
- il*
|
|
|
|
Changes to the Mercury language
|
|
-------------------------------
|
|
|
|
* We have added nine new primitive types: `uint`, `int8`, `int16`, `int32`,
|
|
`int64`, `uint8`, `uint16`, `uint32` and `uint64`. The type `uint` is an
|
|
unsigned integer type of the same size as Mercury's `int` type; the types
|
|
`int8`, `int16`, `int32` and `int64` are signed integer types of width
|
|
8, 16, 32 and 64 bits respectively; the types `uint8`, `uint16`, `uint32`
|
|
and `uint64` are unsigned integer types of width 8, 16, 32 and 64 bits
|
|
respectively.
|
|
|
|
Literals of these new types must have a distinguishing suffix, for example:
|
|
|
|
999u
|
|
561i32
|
|
0b1111100111i64
|
|
0o16u8
|
|
0x3e732i64
|
|
|
|
Basic operations on the new primitive types are provided by the
|
|
new standard library modules: `uint`, `int8`, `uint8`, `int16`, `uint16`,
|
|
`int32`, `uint32` `int64`, and `uint64`.
|
|
|
|
* We have added a new kind of scope to the language: determinism checks
|
|
for switch arms. These scopes are introduced by any of the new keywords
|
|
|
|
require_switch_arms_det
|
|
require_switch_arms_semidet
|
|
require_switch_arms_multi
|
|
require_switch_arms_nondet
|
|
require_switch_arms_cc_multi
|
|
require_switch_arms_cc_nondet
|
|
require_switch_arms_erroneous
|
|
require_switch_arms_failure
|
|
|
|
`require_switch_arms_<determinism> [Var] Goal` tells the compiler
|
|
to require `Goal` to be a switch on `Var` in which all the switch arms
|
|
have determinisms at least as tight as `<determinism>`, and to generate
|
|
error messages for any violations of this requirement.
|
|
|
|
* We have changed the meaning of `require_complete_switch` scopes slightly:
|
|
the compiler now generates an error if the goal inside the scope
|
|
is not a switch on the named variable.
|
|
|
|
* We have added a new kind of scope to the language for disabling warnings
|
|
within the scope. A goal such as
|
|
|
|
disable_warnings [singleton_vars] (
|
|
Goal
|
|
)
|
|
|
|
is equivalent to `Goal`, with the exception that the compiler will not
|
|
generate warnings about singleton variables inside `Goal`.
|
|
|
|
* We have extended the syntax of `:- inst` declarations to allow programmers
|
|
to specify which type constructor's values the inst is meant for.
|
|
The syntax consists of adding `for`, followed by the type constructor's
|
|
name and arity, between the name of the inst and its definition, like this:
|
|
|
|
:- inst listskel(Inst) for list/1
|
|
---> []
|
|
; [Inst | listskel(Inst)].
|
|
|
|
For the time being, this is useful only as a documentation of the
|
|
programmer's intention; the compiler does not (yet) prevent the use of insts
|
|
on values of types other than the one they were declared to be for.
|
|
|
|
* We have added an extension to include external files
|
|
in `pragma foreign_decl` and `pragma foreign_code` declarations.
|
|
|
|
* We have added a foreign type assertion `word_aligned_pointer` that
|
|
allows the Mercury implementation to avoid boxing values of the foreign type
|
|
that the assertion is for when the type appears as the sole argument
|
|
of a data constructor.
|
|
|
|
* We have added a new pragma named `consider_used`. This pragma tells
|
|
the compiler to consider the predicate or function it names to be used,
|
|
preventing it from generating unused procedure warnings either for
|
|
any of its procedures, or for any of the procedures they call,
|
|
directly or indirectly.
|
|
|
|
* We have added an optional second field to the `obsolete` pragma.
|
|
When present, it may contain a list of the names and arities of
|
|
predicates and/or functions that programmers should consider using
|
|
instead of the obsolete predicate or function.
|
|
|
|
* We have added an `obsolete_proc` pragma. While the `obsolete` pragma
|
|
declares all modes of a predicate or function to be obsolete, the
|
|
`obsolete_proc` pragma declares only one mode of a predicate or function
|
|
to be obsolete. Like the updated version of the `obsolete` pragma,
|
|
the `obsolete_proc` pragma may have a second argument naming one or more
|
|
suggested replacements.
|
|
|
|
* The Java backend now supports defining foreign types as primitive Java
|
|
types.
|
|
|
|
* Digits in numeric literals may now be separated by underscores in order
|
|
to improve readability.
|
|
|
|
Changes to the Mercury standard library
|
|
---------------------------------------
|
|
|
|
### New Integer Modules
|
|
|
|
* We have added the new modules `uint`, `int8`, `uint8`, `int16`, `uint16`,
|
|
`int32`, `uint32`, `int64` and `uint64`. These modules provide
|
|
the basic operations on the new integer types.
|
|
|
|
Many other standard library modules now have additional predicates
|
|
that support the new integer types; see the entries for those modules
|
|
for details.
|
|
|
|
### New Random Number Generator Framework
|
|
|
|
* We have added a new type class based interface to random number generators
|
|
to the `random` module. The new interface provides predicates for:
|
|
|
|
- generating pseudo-random integers that are uniformly distributed
|
|
in a range.
|
|
- generating pseudo-random floats that are uniformly distributed
|
|
in a range.
|
|
- generating pseudo-random floats from a normal (i.e. Gaussian)
|
|
distribution.
|
|
- generating a random permutation of an array.
|
|
- generating a random permutation of a list.
|
|
|
|
Three new submodules, `random.sfc16`, `random.sfc32` and `random.sfc64`,
|
|
provide instances of the new type classes. Further instances can be found
|
|
in the extras distribution (see below).
|
|
|
|
### New Module: `diet`
|
|
|
|
* This module provides discrete interval encoding trees, which are a highly
|
|
efficient set implementation for fat sets. This module is a contribution
|
|
from Yes Logic Pty. Ltd.
|
|
|
|
### New Module: `edit_seq`
|
|
|
|
* This module provides operations for computing and manipulating edit
|
|
sequences. Given two sequences of items, an edit sequence is the shortest
|
|
sequence of edit operations (deletes, inserts and/or replaces) that will
|
|
transform the first sequence into the second.
|
|
|
|
### New Module: `psqueue`
|
|
|
|
* This module implements a priority search queue ADT. This is a blend between
|
|
a priority queue and a map. This was contributed by Matthias Güdemann.
|
|
|
|
### New Module: `ranges`
|
|
|
|
* This module represents sets of integers using sorted lists of ranges. This
|
|
module exports operations that make it particularly suitable for representing
|
|
domains in finite domain constraint solvers.
|
|
|
|
### New Module: `term_conversion`
|
|
|
|
* This module provides generic operations for the conversion of values of
|
|
arbitrary types to and from terms. These operations were previously
|
|
provided by the `term` module.
|
|
|
|
See the list of changes to the `term` module below.
|
|
|
|
### New Module: `thread.barrier`
|
|
|
|
* This module provides the `barrier/0` type. This type can be used to control
|
|
progress in concurrent code. This module was contributed by
|
|
Mission Critical IT.
|
|
|
|
### New Module: `thread.future`
|
|
|
|
* This module provides the `future/0` and `future_io/0` types. These type can
|
|
be used to compute values in parallel using other threads. This module was
|
|
contributed by Mission Critical IT.
|
|
|
|
### Changes to the `array` module
|
|
|
|
* The following functions and predicates have been added:
|
|
|
|
- `det_least_index/1`
|
|
- `semidet_least_index/1`
|
|
- `det_greatest_index/1`
|
|
- `semidet_greatest_index/1`
|
|
- `foldl_corresponding/5`
|
|
- `foldl2_corresponding/7`
|
|
- `fill/3`
|
|
- `fill_range/5`
|
|
- `swap/4`
|
|
- `unsafe_swap/4`
|
|
|
|
* The following functions have been deprecated and will be removed in a future
|
|
release:
|
|
|
|
- `least_index/1`
|
|
- `greatest_index/1`
|
|
|
|
### Changes to the `array2d` module
|
|
|
|
* The following functions and predicates have been added:
|
|
|
|
- `is_empty/1`
|
|
- `fill/3`
|
|
- `from_array/3`
|
|
|
|
### Changes to the `assoc_list` module
|
|
|
|
* The following predicate has been added:
|
|
|
|
- `svremove/4`
|
|
|
|
* `svremove/4` is like `remove/4` but its arguments are in an order
|
|
more conducive to the use of state variable notation.
|
|
|
|
### Changes to the `bag` module
|
|
|
|
* The following functions and predicates have been added:
|
|
|
|
- `singleton/1`
|
|
- `insert_duplicates/4`
|
|
- `det_insert_duplicates/4`
|
|
- `det_insert_duplicates/3`
|
|
|
|
* The following predicate and function have been deprecated and will be
|
|
remove in a future release.
|
|
|
|
- `to_set_without_duplicates/2`
|
|
- `to_set_without_duplicates/1`
|
|
|
|
### Changes to the `bitmap` module
|
|
|
|
* The following predicates and functions have been added:
|
|
|
|
- `is_empty/1`
|
|
- `det_from_string/1`
|
|
- `get_uint8/1`, `unsafe_get_uint8/1`
|
|
- `set_uint8/4`, `unsafe_set_uint8/4`
|
|
|
|
### Changes to the `builtin` module
|
|
|
|
* The following predicate and function have been deprecated and will be removed
|
|
in a future release:
|
|
|
|
- `promise_only_solution/1`
|
|
- `promise_only_solution_io/4`
|
|
|
|
Existing code that uses either of these should be replaced with code that
|
|
uses a `promise_equivalent_solutions` goal instead.
|
|
|
|
* The following modes have been deprecated and will be removed in a future
|
|
release:
|
|
|
|
- `input/0`
|
|
- `output/0`
|
|
|
|
Existing code that uses these modes should replace their use with `in`
|
|
or `out` respectively.
|
|
|
|
### Changes to the `calendar` module
|
|
|
|
* The following functions and predicates have been added:
|
|
|
|
- `int_to_month/2`
|
|
- `det_int_to_month/1`
|
|
- `int0_to_month/2`
|
|
- `det_int0_to_month/1`
|
|
- `month_to_int/1`
|
|
- `month_to_int0/1`
|
|
- `same_date/1`
|
|
|
|
### Changes to the `char` module
|
|
|
|
* The following predicates and functions have been added:
|
|
|
|
- `is_ascii/1`
|
|
- `is_decimal_digit/1`
|
|
- `is_base_digit/2`
|
|
- `int_to_binary_digit/2`, `det_int_to_binary_digit/1`
|
|
- `int_to_octal_digit/2`, `det_int_to_octal_digit/1`
|
|
- `int_to_decimal_digit/2`, `det_int_to_decimal_digit/1`
|
|
- `int_to_hex_digit/2`, `det_int_to_hex_digit/1`
|
|
- `base_int_to_digit/3`, `det_base_int_to_digit/2`
|
|
- `binary_digit_to_int/2`, `det_binary_digit_to_int/1`
|
|
- `octal_digit_to_int/2`, `det_octal_digit_to_int/1`
|
|
- `decimal_digit_to_int/2`, `det_decimal_digit_to_int/1`
|
|
- `hex_digit_to_int/2`, `det_hex_digit_to_int/1`
|
|
- `base_digit_to_int/3`, `det_base_digit_to_int/2`
|
|
- `is_leading_surrogate/1`, `is_trailing_surrogate/1`
|
|
- `is_control/1`, `is_space_separator/1`, `is_paragraph_separator/1`
|
|
- `is_line_separator/1`, `is_private_use/1`
|
|
|
|
* The following predicates have been deprecated and will either be removed or
|
|
have their semantics changed in a future release:
|
|
|
|
- `is_hex_digit/2`
|
|
- `int_to_hex_char/2`
|
|
- `digit_to_int/2`
|
|
- `int_to_digit/2`
|
|
- `det_int_to_digit/1`, `det_int_to_digit/2`
|
|
|
|
NOTE: existing code that calls `digit_to_int/2` assuming that it will
|
|
only succeed for decimal digits (0-9) may be broken.
|
|
|
|
### Changes to the `cord` module
|
|
|
|
* The following predicates and functions have been added:
|
|
|
|
- `to_list/1` (synonym for the existing `list/1` function)
|
|
- `to_rev_list/1` (synonym for the existing `rev_list/1` function)
|
|
- `rev_cord_list_to_cord/1` (similar to `cord_list_to_cord/1`)
|
|
- `rev_cord_list_to_list/1` (similar to `cord_list_to_list/1`)
|
|
- `cons/3`
|
|
- `snoc/3`
|
|
- `find_first_match/3`
|
|
|
|
### Changes to the `deconstruct` module
|
|
|
|
* The predicate `functor/4` has been modified so that for character and string
|
|
data, any control characters in the functor representation are escaped.
|
|
|
|
### Changes to the `digraph` module
|
|
|
|
* The following predicates and functions have been added:
|
|
|
|
- `return_vertices_in_from_to_order/2`
|
|
- `return_vertices_in_to_from_order/2`
|
|
- `return_sccs_in_from_to_order/1`
|
|
- `return_sccs_in_to_from_order/1`
|
|
|
|
### Changes to the `float` module
|
|
|
|
* The following predicates and function have been added:
|
|
|
|
- `is_finite/1`
|
|
- `is_zero/1`
|
|
- `is_infinite/1` (synonym for the existing `is_inf/1` predicate)
|
|
- `is_nan_or_infinite/1` (synonym for the existing `is_nan_or_inf/1` predicate)
|
|
- `infinity/0`
|
|
|
|
### Changes to the `getopt` and `getopt_io` modules
|
|
|
|
* We have added variants of the `process_options` predicates that return errors
|
|
using a type instead of strings. A new function, `option_error_to_string/1`,
|
|
can be used to convert values of the new error type into strings.
|
|
|
|
### Changes to the `hash_table` module
|
|
|
|
* The following predicates have been added:
|
|
|
|
- `fold2/6`
|
|
- `fold3/8`
|
|
|
|
### Changes to the `int` module
|
|
|
|
* The following predicates and functions have been added:
|
|
|
|
- `all_true_in_range/3`
|
|
- `unchecked_abs/1`
|
|
- `nabs/1`
|
|
|
|
* The following predicate has been deprecated:
|
|
|
|
- `is/2`
|
|
|
|
### Changes to the `integer` module
|
|
|
|
* The following predicates and functions have been added:
|
|
|
|
- `from_string/2`
|
|
- `from_base_string/3`
|
|
- `to_int/2`
|
|
- `det_to_int/1`
|
|
- `to_base_string/2`
|
|
- `negative_one/0`, `two/0`, `ten/0`
|
|
- `is_zero/1`
|
|
- `to_uint/2`
|
|
- `det_to_uint/1`
|
|
- `from_uint/1`
|
|
- `to_int{8,16,32,64}/2`
|
|
- `det_to_int{8,16,32,64}/1`
|
|
- `from_int{8,16,32,64}/1`
|
|
- `to_uint{8,16,32,64}/2`
|
|
- `det_to_uint{8,16,32,64}/1`
|
|
- `from_uint{8,16,32,64}/1`
|
|
|
|
* The following functions have been deprecated and will be removed in a
|
|
future release:
|
|
|
|
- `from_string/1`
|
|
- `from_base_string/2`
|
|
- `int/1`
|
|
|
|
### Changes to the `io` module
|
|
|
|
* The following predicates have been added:
|
|
|
|
- `write_uint/3`, `write_uint/4`
|
|
- `write_int{8,16,32,64}/3`, `write_int{8,16,32,64}/4`
|
|
- `write_uint{8,16,32,64}/3`, `write_uint{8,16,32,64}/4`
|
|
- `write_binary_int8/3`, `write_binary_int8/4`
|
|
- `write_binary_uint8/3`, `write_binary_uint8/4`
|
|
- `write_binary_int{16,32,64}/3`, `write_binary_int{16,32,64}/4`
|
|
- `write_binary_int{16,32,64}_{le,be}/3`, `write_binary_int{16,32,64}_{le,be}/4`
|
|
- `read_binary_int8/[34]`
|
|
- `read_binary_uint8/[34]`
|
|
- `putback_int8/[34]`
|
|
- `putback_uint8/[34]`
|
|
- `read_binary_int{16,32,64}/3`, `read_binary_int{16,32,64}/4`
|
|
- `read_binary_int{16,32,64}_{le,be}/3`, `read_binary_int{16,32,64}_{le,be}/4`
|
|
- `read_binary_uint{16,32,64}/3`, `read_binary_uint{16,32,64}/4`
|
|
- `read_binary_uint{16,32,64}_{le,be}/3`, `read_binary_uint{16,32,64}_{le,be}/4`
|
|
- `read_line_as_string_and_num_code_units/[34]`
|
|
- `print_line/[34]`, `write_line/[34]`
|
|
- `write_array/[56]` (similar to `write_list` but for arrays)
|
|
- `temp_directory/3`
|
|
- `make_temp_directory/3`
|
|
- `make_temp_directory/5`
|
|
- `set_environment_var/5`
|
|
- `have_set_environment_var/0`
|
|
- `seek_binary_input64/5`, `seek_binary_output64/5`
|
|
- `binary_input_stream_offset64/4`, `binary_output_stream_offset64/4`
|
|
|
|
* The `print_line` and `write_line` family of predicates behave like the
|
|
`print` and `write` predicates, but also write a terminating newline.
|
|
|
|
* `print` now outputs arbitrary precision integers in their decimal form
|
|
instead of printing their underlying representation.
|
|
|
|
* The predicate `set_environment_var/5` returns an `io.res` value rather than
|
|
throwing an exception. The predicate `have_set_environment_var/0` can test
|
|
whether the current platform supports the ability to set environment
|
|
variables.
|
|
|
|
* We have made the following predicates exception safe: the current input or
|
|
output stream is restored to the original stream if an exception is thrown
|
|
during their execution:
|
|
|
|
- `read/4`
|
|
- `write_list/6`
|
|
- `write_array/6`
|
|
- `read_binary/4`
|
|
- `write_binary/4`
|
|
|
|
### Changes to the `lexer` module
|
|
|
|
* We have added predicates that read from an explicitly specified input stream,
|
|
not from the current input stream.
|
|
|
|
### Changes to the `list` module
|
|
|
|
* The following predicates and functions have been added:
|
|
|
|
- `any_true/2`
|
|
- `any_false/2`
|
|
- `reverse_prepend/2`
|
|
- `reverse_prepend/3`
|
|
- `take_while/4`
|
|
- `take_while/3`
|
|
- `take_while/2`
|
|
- `drop_while/3`
|
|
- `drop_while/2`
|
|
- `one_or_more_to_list/1`
|
|
- `list_to_one_or_more/2`
|
|
- `list_to_one_or_more_det/2`
|
|
|
|
* The following predicate has been deprecated and will be remove in a future
|
|
release:
|
|
|
|
- `takewhile/4` (use `take_while/4` instead)
|
|
|
|
* The `take/3` and `drop/3` predicates have been modified so that they fail if
|
|
their first argument is less than zero.
|
|
|
|
* The `split_upto/4` and `take_upto/3` predicates and `take_upto/2` function
|
|
have been modified so that they throw an exception if their first argument
|
|
is negative.
|
|
|
|
### Changes to the `map` module
|
|
|
|
* The following predicates have been added:
|
|
|
|
- `foldl5/12`
|
|
- `foldr5/12`
|
|
- `map_foldl4/11`
|
|
- `intersect_list/4`
|
|
- `union_list/4`
|
|
- `select_unselect/4`
|
|
- `select_unselect_sorted_list/4`
|
|
|
|
### Changes to the `math` module
|
|
|
|
* The following function and predicate have been added:
|
|
|
|
- `fma/3`
|
|
- `have_fma/0`
|
|
|
|
* `fma/3` provides the fused multiply-add operation on platforms that
|
|
support that operation. The predicate `have_fma/0` may be used to check for
|
|
this support.
|
|
|
|
### Changes to the `maybe` module
|
|
|
|
* We have a added a new type, `maybe_errors`, to the `maybe` module.
|
|
|
|
* The following predicate and function have been added:
|
|
|
|
- `fold2_maybe/6`
|
|
- `maybe_default/2`
|
|
- `pred_to_maybe/1`
|
|
- `func_to_maybe/1`
|
|
|
|
### Changes to the `parser` module
|
|
|
|
* We have added predicates that read from an explicitly specified input stream,
|
|
not from the current input stream.
|
|
|
|
### Changes to the `pretty_printer` module
|
|
|
|
* The type `formatter_limit` has been renamed to `func_symbol_limit`, since
|
|
this better reflects the type's purpose.
|
|
|
|
* We have replaced the `set_formatter` function with a predicate of the same
|
|
name, since this allows the use of state variable notation when
|
|
setting up more than one type-specific formatter,
|
|
|
|
* We have renamed the `write_doc_to_stream` predicate as `put_doc`, to better
|
|
fit in with the names other predicates that operate on values of the
|
|
`stream.writer` typeclass, and changed its interface to group
|
|
the prettyprinter parameters together in a value of the type
|
|
that was designed for this purpose.
|
|
|
|
### Changes to the `random` module.
|
|
|
|
* The existing random number generator defined in this module has been
|
|
deprecated in favour of the type class based random number generation
|
|
framework described above.
|
|
|
|
As such, the `supply/0` type and the following predicates have been
|
|
deprecated and will be deleted in a future release:
|
|
|
|
- `init/2`
|
|
- `random/3`
|
|
- `random/5`
|
|
- `randmax/3`
|
|
- `randcount/3`
|
|
- `permutation/4`
|
|
|
|
### Changes to the `rbtree` module
|
|
|
|
* The following predicates have been added:
|
|
|
|
- `foldl_values/4`
|
|
- `foldl2_values/6`
|
|
|
|
### Changes to the `require` module
|
|
|
|
* The following predicate and function have been added:
|
|
|
|
- `error/2`
|
|
- `func_error/2`
|
|
|
|
### Changes to the `set` module
|
|
|
|
* The following predicates and/or functions have been added:
|
|
|
|
- `intersection_and_differences/5`
|
|
- `det_remove/3`
|
|
- `det_remove_list/3`
|
|
- `rev_sorted_list_to_set/[12]`
|
|
|
|
* The following predicate and/or functions have been deprecated:
|
|
|
|
- `empty/1`
|
|
- `non_empty/1`
|
|
- `set/1`
|
|
|
|
Similar changes have been made to the other set implementations
|
|
in the library.
|
|
|
|
### Changes to the `std_util` module
|
|
|
|
* The following functions have been deprecated:
|
|
|
|
- `maybe_pred/3`
|
|
- `maybe_func/2`
|
|
|
|
### Changes to the `stream.string_writer` module
|
|
|
|
* The following predicates have been added:
|
|
|
|
- `put_uint/4`
|
|
- `put_int{8,16,32,64}/4`
|
|
- `put_uint{8,16,32,64}/4`
|
|
|
|
* `print` now outputs arbitrary precision integers in their decimal form
|
|
instead of printing their underlying representation.
|
|
|
|
### Changes to the `string` module
|
|
|
|
* Predicates and functions in this module now have defined behaviours
|
|
for strings containing ill-formed sequences. Also, some predicates and
|
|
functions now have defined behaviour on surrogate code points
|
|
(e.g. failing or throwing an exception) that was previously undefined.
|
|
|
|
* The following predicates have been added:
|
|
|
|
- `is_all_alnum/1`
|
|
- `is_empty/1`
|
|
- `is_well_formed/1`
|
|
- `from_code_unit_list_allow_ill_formed/2`
|
|
- `to_utf8_code_unit_list/2`
|
|
- `to_utf16_code_unit_list/2`
|
|
- `from_utf8_code_unit_list/2`
|
|
- `from_utf16_code_unit_list/2`
|
|
- `det_remove_prefix/3`
|
|
- `compare_ignore_case_ascii/3`
|
|
- `to_rev_char_list/2`
|
|
- `compare_substrings/6`
|
|
- `unsafe_compare_substrings/6`
|
|
- `nondet_append/3`
|
|
- `append_string_pieces/2`
|
|
- `unsafe_append_string_pieces/2`
|
|
- `unsafe_sub_string_search_start/4`
|
|
- `index_next_repl/5`
|
|
- `unsafe_index_next_repl/5`
|
|
- `prev_index_repl/5`
|
|
- `unsafe_prev_index_repl/5`
|
|
- `uint_to_string/1`
|
|
- `int{8,16,32,64}_to_string/1`
|
|
- `uint{8,16,32,64}_to_string/1`
|
|
|
|
* The following procedures have been deprecated:
|
|
|
|
- `to_char_list(uo, in)`
|
|
- `to_rev_char_list(uo, in)`
|
|
- `from_char_list(out, in)`
|
|
- `append(out, out, in)`
|
|
- `prefix(in, out)`
|
|
- `suffix(in, out)`
|
|
|
|
* The following obsolete predicates and functions have been removed:
|
|
|
|
- `substring/3`
|
|
- `substring/4`
|
|
- `unsafe_substring/3`
|
|
- `unsafe_substring/4`
|
|
- `foldl_substring/5`
|
|
- `foldl_substring/6`
|
|
- `foldl2_substring/8`
|
|
- `foldl2_substring/8`
|
|
- `foldr_substring/5`
|
|
- `foldr_substring/6`
|
|
|
|
* We have reduced the memory allocated by `to_lower` and `to_upper`.
|
|
|
|
* `string_to_doc/1` now escapes characters in its input argument with
|
|
backslash escapes when required.
|
|
|
|
* [Mantis bug #348]. Float special values, NaNs and Infinities, are now
|
|
converted to strings in a way that is backend- and grade-independent.
|
|
|
|
* [Mantis bug #376]. `base_digit_to_int/3` and `det_base_digit_to_int/2` now
|
|
check for overflow and underflow in all bases, not only base 10.
|
|
|
|
### Changes to the `store` module
|
|
|
|
* Procedures in this module no longer acquire the global lock.
|
|
|
|
### Changes to the `term` module
|
|
|
|
* The following predicates and functions have been added:
|
|
|
|
- `dummy_context_init/0`
|
|
- `is_dummy_context/1`
|
|
- `term_to_int/2`
|
|
- `term_to_uint/2`
|
|
- `term_to_int{8,16,32,64}/2`
|
|
- `term_to_uint{8,16,32,64}/2`
|
|
- `decimal_term_to_int/2`
|
|
- `int_to_decimal_term/2`
|
|
- `int{8,16,32,64}_to_decimal_term/2`
|
|
- `uint_to_decimal_term/2`
|
|
- `uint{8,16,32,64}_to_decimal_term/2`
|
|
- `rename_var_in_term/4`
|
|
- `rename_vars_in_terms/4`
|
|
- `apply_renaming_in_term/3`
|
|
- `apply_renaming_in_terms/3`
|
|
- `apply_renaming_in_var/3`
|
|
- `apply_renaming_in_vars/3`
|
|
- `apply_renaming_in_term/3`
|
|
- `apply_renaming_in_terms/3`
|
|
- `substitute_var_in_term/4`
|
|
- `substitute_var_in_terms/4`
|
|
- `substitute_corresponding_in_term/4`
|
|
- `substitute_corresponding_in_terms/4`
|
|
- `apply_substitution_in_term/3`
|
|
- `apply_substitution_in_terms/3`
|
|
- `apply_rec_substitution_in_term/3`
|
|
- `apply_rec_substitution_in_terms/3`
|
|
|
|
* The following predicates and functions have been moved to the
|
|
`term_conversion` module:
|
|
|
|
- `try_term_to_type/[12]`
|
|
- `term_to_type/2`
|
|
- `det_term_to_type/[12]`
|
|
- `type_to_term/[12]`
|
|
- `univ_to_term/[12]`
|
|
|
|
* The following predicates and functions have been deprecated and will be
|
|
removed in a future release:
|
|
|
|
- `var_id/1`
|
|
- `relabel_variable/[34]`
|
|
- `relabel_variables/[34]`
|
|
- `rename/[34]`
|
|
- `rename_list/[34]`
|
|
- `apply_renaming/[23]`
|
|
- `apply_renaming_to_list/[23]`
|
|
- `apply_variable_renaming_to_var/[23]`
|
|
- `apply_variable_renaming_to_vars/[23]`
|
|
- `apply_variable_renaming/[23]`
|
|
- `apply_variable_renaming_to_list/[23]`
|
|
- `substitute/[34]`
|
|
- `substitute_list/[34]`
|
|
- `substitute_corresponding/[34]`
|
|
- `substitute_corresponding_list/[34]`
|
|
- `apply_substitution/[23]`
|
|
- `apply_substitution_to_list/[23]`
|
|
- `apply_rec_substitution/[23]`
|
|
- `apply_rec_substitution_to_list/[23]`
|
|
|
|
### Changes to the `thread` module
|
|
|
|
* The following predicates have been added:
|
|
|
|
- `spawn_native/4`
|
|
- `spawn/4`
|
|
- `num_processors/3`
|
|
|
|
* `spawn_native/4` allows you to dedicate an OS thread to a Mercury thread.
|
|
|
|
* `num_processors/3` returns the number of processors available for
|
|
parallel work.
|
|
|
|
### Changes to the `thread.mvar` module
|
|
|
|
* The following predicates and functions have been added:
|
|
|
|
- `impure_init/1`
|
|
- `try_read/4`
|
|
|
|
* The following function has been deprecated and will be removed in a
|
|
future release:
|
|
|
|
- `init/1`
|
|
|
|
### Changes to the `thread.semaphore` module
|
|
|
|
* The following predicate has been deprecated and will be removed in a
|
|
future release:
|
|
|
|
- `init/1`
|
|
|
|
### Changes to the `time` module
|
|
|
|
* The following predicates have been added:
|
|
|
|
- `localtime/4`
|
|
- `mktime/4`
|
|
|
|
* The following functions have been deprecated and will be removed in a
|
|
future release:
|
|
|
|
- `localtime/1`
|
|
- `mktime/1`
|
|
- `ctime/1`
|
|
|
|
### Changes to the `tree234` module
|
|
|
|
* The following predicate has been added:
|
|
|
|
- `map_foldl4/11`
|
|
|
|
### Changes to the `version_array` module
|
|
|
|
* The following function has been added:
|
|
|
|
- `from_reverse_list/1`
|
|
|
|
Changes to the Mercury compiler
|
|
-------------------------------
|
|
|
|
### New warning options
|
|
|
|
* `--inform-incomplete-switch`, `--inform-incomplete-switch-threshold N`
|
|
|
|
This option asks the compiler to generate an informational message for
|
|
switches that do not cover all of the function symbols that the switched-on
|
|
variable could be bound to.
|
|
|
|
The option `--inform-incomplete-switch-threshold N` can be used to restrict
|
|
the generation of these messages to only switches that *do* cover at least
|
|
*N* percent of the function symbols that the switched-on variable
|
|
could be bound to.
|
|
|
|
* `--inhibit-style-warnings`
|
|
|
|
This option asks the compiler not to generate any warnings that are purely
|
|
about programming style, and do not point out code that is reasonably
|
|
likely to be wrong.
|
|
|
|
* `--no-warn-accumulator-swaps`
|
|
|
|
We have renamed the `--inhibit-accumulator-warnings` option to
|
|
`--no-warn-accumulator-swaps`.
|
|
|
|
* `--warn-dead-preds`
|
|
|
|
While the existing option `--warn-dead-procs` asks the compiler to generate
|
|
warnings for every unused procedure of the module being compiled, this new
|
|
option asks the compiler to generate a warning for a predicate or function
|
|
only if none of its procedures is used.
|
|
|
|
* `--warn-implicit-stream-calls`
|
|
|
|
This option asks the compiler to generate a warning for every call to a
|
|
predicate `p/N` if there is also a predicate `p/(N+1)` which differs from
|
|
`p/N` only in that it has additional argument at the front of its argument
|
|
list that specifies an I/O stream. This is intended to generate warnings for
|
|
calls to predicates such as `io.write_string/3`, which writes to the current
|
|
output stream, to encourage programmers to call `io.write_string/4` instead.
|
|
If the option is given, the compiler will also generate warnings for calls
|
|
to predicates such as `io.see`, `io.seen`, `io.tell` and `io.told`, which
|
|
set the current input or output streams respectively.
|
|
|
|
* `--warn-inconsistent-pred-order-clauses`, `--warn-inconsistent-pred-order-foreign-procs`
|
|
|
|
Both of these options ask the compiler to generate a warning if, among
|
|
either (a) the set of exported predicates and functions of the module,
|
|
or (b) the set of nonexported predicates and functions of the module,
|
|
the order of their definitions does not match the order of their
|
|
declarations. The first option applies only to predicates and functions
|
|
defined by Mercury clauses; the second applies to predicates and functions
|
|
defined by either Mercury clauses or foreign procedures.
|
|
|
|
The option `--warn-inconsistent-pred-order` is a shorter synonym for
|
|
`--warn-inconsistent-pred-order-clauses`.
|
|
|
|
* `--warn-insts-with-functors-without-type`
|
|
|
|
This option asks the compiler to generate a warning for inst definitions
|
|
that specify functors but do not specify what type they are for.
|
|
|
|
* `--warn-interface-imports-in-parents`
|
|
|
|
This option asks the compiler to generate a warning for modules that are
|
|
imported in the interface of a parent module, but not used in the interface
|
|
of that module.
|
|
|
|
* `--warn-non-contiguous-decls`
|
|
|
|
This option asks the compiler to generate a warning if the mode
|
|
declaration(s) of a predicate or function does not immediately follow its
|
|
`:- pred` or `:- func` declaration. This is option is turned on by default.
|
|
|
|
* `--warn-suspected-occurs-check-failure`
|
|
|
|
We have significantly improved the compiler's ability to detect, and
|
|
to generate warnings about, code that violates the occurs check. This
|
|
option is turned on by default.
|
|
|
|
* `--warn-suspicious-foreign-code`
|
|
|
|
This option asks the compiler to warn about possible errors in the bodies of
|
|
`foreign_code` pragmas.
|
|
|
|
### New verbosity options
|
|
|
|
* `--limit-error-contexts`
|
|
|
|
This option asks the compiler the restrict the errors and warnings it prints
|
|
to those originating from a named file or files and/or specified ranges of
|
|
line numbers.
|
|
|
|
### New link options
|
|
|
|
* `--no-default-runtime-library-directory`
|
|
|
|
This new option prevents the compiler from adding any directories to the
|
|
runtime search path automatically.
|
|
|
|
### New output options
|
|
|
|
* `--output-class-dir`, `--output-class-directory`
|
|
|
|
This option causes the compiler to print the name of the directory in
|
|
which generated Java class files will be placed.
|
|
|
|
* `--output-csharp-compiler`
|
|
|
|
This option causes the compiler to print the command used to invoke
|
|
the C# compiler.
|
|
|
|
* `--output-target-arch`
|
|
|
|
This option causes the compiler to print the target architecture.
|
|
|
|
### New auxiliary output options
|
|
|
|
* `--show-definitions`
|
|
|
|
This option causes the compiler to write out a list of the types, insts,
|
|
modes, predicates, functions, typeclasses and instances defined in a module
|
|
to a file named `<module>.defns`.
|
|
|
|
* `--show-definition-line-counts`
|
|
|
|
This option causes the compiler to write out a list of predicates and
|
|
functions defined in a module, together with the names of the files
|
|
containing them and their approximate line counts, to a file named
|
|
`<module>.defn_line_counts`.
|
|
|
|
### Changes to output options
|
|
|
|
* `--generate-module-order`, `--imports-graph`
|
|
|
|
These options no longer imply `--generate-dependencies`.
|
|
|
|
### Changes to link options
|
|
|
|
* `--mercury-linkage`
|
|
|
|
The compiler no longer sets the runtime search path when
|
|
the value of `--mercury-linkage` is `static`.
|
|
|
|
### Changes to optimizations
|
|
|
|
* We have extended tail call optimization from self recursive calls only
|
|
to mutually recursive calls as well, when generating high level C code,
|
|
C# code, or Java code. (The compiler has long been able apply tail call
|
|
optimization to mutually recursive calls when generating low level C code.)
|
|
|
|
* We have disabled intermodule optimisation of any predicates or functions
|
|
using `try` goals. This fixes a serious issue as `try` goals are not
|
|
properly written to `.opt` files, so when read back would not actually
|
|
catch any exceptions.
|
|
|
|
### Bug fixes
|
|
|
|
* We have fixed some bugs with constrained polymorphic modes.
|
|
|
|
* The compiler now reports an error for binary/octal/hexadecimal integer
|
|
literals that cannot be represented in the compiler's native `int` type.
|
|
|
|
* [Mantis bug #3]. We have fixed a long-standing bug causing crashes in
|
|
deep profiling grades, related to unify/compare for tuples.
|
|
|
|
* [Mantis bug #184]. We have fixed a bug that caused a compiler abort in the
|
|
presence of unsatisfied type class constraints.
|
|
|
|
* [Mantis bug #196]. We have made binary compatibility checks in C grades
|
|
work again; GCC and clang were optimizing them away.
|
|
|
|
* [Mantis bug #264]. Putting a function with a non-default signature into a
|
|
ground term is now no longer allowed. This is because extracting the function
|
|
from the term would assume the default function signature.
|
|
|
|
* [Mantis bug #278]. We have fixed a bug where erroneous state variable use
|
|
in the head of a lambda expression would cause a compiler abort instead of
|
|
generating an error message.
|
|
|
|
* [Mantis bug #318]. We no longer erroneously report an error if a
|
|
`foreign_type` pragma precedes the `:- type` declaration to which it applies.
|
|
|
|
* [Mantis bug #388]. We have fixed a bug where JAR files were being installed
|
|
with incorrect permissions.
|
|
|
|
* [Mantis bug #391]. We have fixed a bug where the conditions on `trace` goals
|
|
were being discarded when inlined across module boundaries.
|
|
|
|
* [Mantis bug #402]. The current state of a state variable can now be used in
|
|
the head of a `require_complete_switch` scope.
|
|
|
|
* [Mantis bug #415]. We have fixed a bug that caused the compiler to go into
|
|
an infinite loop when pretty printing recursive insts for use in error
|
|
messages.
|
|
|
|
* [Mantis bug #420]. We have fixed a bug where `try` goals that were inlined
|
|
across module boundaries would ignore exceptions instead of catching them.
|
|
|
|
* [Mantis bug #436]. We have fixed a bug where the compiler would silently
|
|
allow a `foreign_enum` pragma to contain a constructor not belonging to the
|
|
type that is the subject of the pragma.
|
|
|
|
* [Mantis bug #437]. We have fixed a bug that caused the compiler to abort if
|
|
an empty submodule was encountered.
|
|
|
|
### Other changes
|
|
|
|
* The C# back-end now bootstraps.
|
|
|
|
* The Java back-end now bootstraps.
|
|
|
|
* The old IL back-end has been deleted.
|
|
|
|
* The Erlang backend is deprecated and will be removed in a future release.
|
|
|
|
* Class files generated for executables in the Java grade are now automatically
|
|
packaged up into Java archives (JARs).
|
|
|
|
* We have upgraded the bundled Boehm GC to v7.6.10 and libatomic_ops to v7.6.2.
|
|
|
|
Portability improvements
|
|
------------------------
|
|
|
|
* The `asm_fast*` and `reg*` grades now work on 64-bit Intel OS X systems when
|
|
using GCC as the C compiler.
|
|
|
|
See README.MacOS for further details.
|
|
|
|
* We have improved support for FreeBSD, specifically:
|
|
|
|
- Allowing architectures other than `i*86`.
|
|
- Allowing the use of shared libraries.
|
|
- Enabling support for threads.
|
|
- Enabling parallel job support with `mmc --make`.
|
|
|
|
See README.FreeBSD for further details.
|
|
|
|
* We have added support for OpenBSD.
|
|
|
|
See README.OpenBSD for further details.
|
|
|
|
* We have added support for Linux systems using musl libc.
|
|
|
|
* We have improved support for AIX.
|
|
|
|
See README.AIX for further details.
|
|
|
|
* The NetBSD `editline` library may now be used in place of GNU `readline` to
|
|
provide line editing capabilities in the debugger.
|
|
|
|
* [Mantis bug #357]. We now use the `libdispatch` implementation of semaphores
|
|
on OS X as the POSIX one was a non-functional stub.
|
|
|
|
* [Mantis bug #463]. We now support the use of the Microsoft C# compiler
|
|
(i.e. Roslyn) in POSIX environments.
|
|
|
|
Changes to the Mercury debugger
|
|
-------------------------------
|
|
|
|
* Interactive queries are now supported on OS X.
|
|
|
|
* The `break` command can now auto-complete on the filename:linenumber pairs
|
|
of events, provided the Mercury system can access the readline library.
|
|
|
|
* Interactive queries have been improved:
|
|
|
|
- Queries can use variable bindings from the current environment.
|
|
- Exceptions thrown from queries are properly handled.
|
|
- Non-canonical output bindings are now printed in solutions.
|
|
- Underscore variables are no longer printed in solutions.
|
|
|
|
* We have added a `browse --web` command to view terms in a web browser.
|
|
|
|
Editor support
|
|
--------------
|
|
|
|
* The vim syntax highlighting files have been significantly improved
|
|
thanks to Sebastian Godelet.
|
|
|
|
Changes to the extras distribution
|
|
----------------------------------
|
|
|
|
* We have added support for Unicode and other enhancements to the `lex` and
|
|
`regex` libraries. Thanks to Sebastian Godelet.
|
|
|
|
* We have added some additional random number generator implementations for
|
|
use with the new random number generator framework.
|
|
|
|
Known issues
|
|
------------
|
|
|
|
* [Mantis bug #466]. The experimental support for dependent parallel
|
|
conjunctions in low-level C grades is known to sometimes cause aborts
|
|
in the code generator.
|
|
|
|
|
|
NEWS for Mercury 20.06.1, 3 November 2020
|
|
=========================================
|
|
|
|
This is a bug-fix release.
|
|
|
|
* [Mantis bug #519]. We have deleted an old workaround from the Tcl/Tk
|
|
binding in the extras that causes linking errors with recent versions
|
|
of Tcl/Tk.
|
|
|
|
* [Mantis bug #514]. We have fixed a bug that caused linking errors
|
|
in the deep profiling version of the Mercury runtime library when using
|
|
GCC with the `-fno-common` option.
|
|
|
|
Users of GCC 10 should note that `-fno-common` is now the default.
|
|
|
|
* [Mantis bug #513]. We have fixed a bug that caused the compiler to
|
|
generate code that incorrectly reads variable values from the stack
|
|
in disjunctions.
|
|
|
|
* [Github issue #90]. We have fixed a bug that the caused the compiler
|
|
to abort on code that used type classes in lambda expressions.
|
|
|
|
* We have fixed a bug that caused the low-level C backend to incorrectly
|
|
place the contents of `foreign_code` pragmas after the contents of
|
|
`foreign_proc` pragmas in the generated C code.
|
|
|
|
* We have fixed a bug with the debugger's `level` command where it would
|
|
report an error when invoked without any arguments instead of resetting
|
|
the current ancestor level to the level of the current event.
|
|
|
|
|
|
NEWS for Mercury 20.06, 30 June 2020
|
|
====================================
|
|
|
|
Changes that may break compatibility
|
|
------------------------------------
|
|
|
|
* We have deleted the `one_or_more` type, and the operations on it, from
|
|
the `list` module of the Mercury standard library, and moved them to
|
|
a new module named `one_or_more`. This will break compatibility for
|
|
code that used the moved functionality, but such breaks can be fixed
|
|
simply by importing `one_or_more` as well as (or in rare cases, instead of)
|
|
the `list` module.
|
|
|
|
* If module A contains a `:- import_module` or a `:- use_module` declaration
|
|
for module B but does not refer to anything defined in module B, we used
|
|
to generate a warning for the declaration only if module A had no submodules,
|
|
because it is possible that A's submodules refer to entities defined in B.
|
|
We now generate a warning for unused `:- import_module` and `:- use_module`
|
|
declaration in this case as well, which will stop the program from compiling
|
|
if `--halt-at-warn` is set. The fix is simple: replace the declaration
|
|
being warned about in the parent module with declarations in the child
|
|
modules that need it. In the fairly frequent case that not all child modules
|
|
need module B, this avoids the need to recompile those child modules
|
|
when the interface of module B changes.
|
|
|
|
* We have moved the type `domain_error` from the `math` module of the Mercury
|
|
standard library to the `exception` module. Any module qualified references
|
|
to the name of either the type or of its one function symbol should have
|
|
the module qualification either updated or deleted. The reason for the move
|
|
is that it reduces the cost of some new optimizations.
|
|
|
|
* We have added an additional constructor to the `poly_type` type from
|
|
the `string` module. Existing code that uses that type may need to be
|
|
updated.
|
|
|
|
Changes to the Mercury standard library
|
|
---------------------------------------
|
|
|
|
### New module: `kv_list`
|
|
|
|
* This module, whose name is short for key-value list, contains the same
|
|
functionality as the existing `assoc_list` module, but stores lists of
|
|
key-value pairs in a more space-efficient manner. Specifically, it uses
|
|
one three-word cell on the heap to represent each pair, while the
|
|
`assoc_list` module uses two two-word cells, which means that `kv_list`
|
|
will allocate fewer heap cells. The tradeoff is that unlike assoc_lists,
|
|
kv_lists are not standard lists, and thus cannot be manipulated
|
|
using the functions and predicates of the `list` module.
|
|
|
|
### New module: `one_or_more`
|
|
|
|
* This module defines the `one_or_more` type, which represents nonempty lists,
|
|
and provides operations on the values of this type. For every operation
|
|
in the `list` module that makes sense for nonempty lists, there is a
|
|
corresponding operation in `one_or_more`.
|
|
|
|
### New module: `one_or_more_map`
|
|
|
|
* This module implements `one_or_more_map`, a map from keys to one or more
|
|
values. Its functionality is very similar to that of the `multi_map` module
|
|
(in fact, the two modules define the exact same set of operations),
|
|
but unlike `multi_map`, it uses the type system to enforce the invariant
|
|
that every key in the map must have at least one associated value.
|
|
|
|
### New module: `thread.closeable_channel`
|
|
|
|
* This module implements closeable unbounded channels, similar to the unbounded
|
|
channels provided by the `thread.channel` module, but with the addition of a
|
|
close operation. Once a channel is closed, no more items can be added to it,
|
|
and reading from a closed channel will not block indefinitely.
|
|
|
|
### Changes to the `assoc_list` module
|
|
|
|
* The following predicates and functions have been added:
|
|
|
|
- pred `lookup/3`
|
|
- pred `update/4`
|
|
- pred `foldl/4`
|
|
- pred `foldl2/6`
|
|
- pred `foldl3/8`
|
|
- func `foldl_keys/3`
|
|
- func `foldl_values/3`
|
|
|
|
### Changes to the `char` module
|
|
|
|
* The following function and predicate have been added:
|
|
|
|
- func `hash/1`
|
|
- pred `hash/2`
|
|
|
|
### Changes to the `float` module
|
|
|
|
* The following predicate has been added:
|
|
|
|
- pred `hash/2`
|
|
|
|
### Changes to the `hash_table` module
|
|
|
|
* The following predicates have been deprecated and will be removed in a future
|
|
release:
|
|
|
|
- pred `int_hash/2`
|
|
- pred `uint_hash/2`
|
|
- pred `float_hash/2`
|
|
- pred `char_hash/2`
|
|
- pred `string_hash/2`
|
|
- pred `generic_hash/2`
|
|
|
|
* The following obsolete functions have been removed:
|
|
|
|
- func `new/3`
|
|
- func `new_default/1`
|
|
|
|
### Changes to the `int` module
|
|
|
|
* The following function and predicate have been added:
|
|
|
|
- func `hash/1`
|
|
- pred `hash/2`
|
|
|
|
### Changes to the `integer` module
|
|
|
|
* The following functions have been added:
|
|
|
|
- func `eight/0`
|
|
- func `sixteen/0`
|
|
|
|
### Changes to the `io` module
|
|
|
|
* The predicates `write_many/3` and `write_many/4` now work directly
|
|
with values of type `uint`.
|
|
|
|
* The predicates `format/4` and `format/5` now work directly with values
|
|
of type `uint`. (See the changes to the `string` module for further
|
|
details.)
|
|
|
|
### Changes to the `list` module
|
|
|
|
* The following predicate has been added:
|
|
|
|
- pred `map_corresponding3/5`
|
|
|
|
* The following type, functions and predicates have been moved to the
|
|
new `one_or_more` module. Note: this change can break backwards
|
|
compatibility.
|
|
|
|
- type `one_or_more/1`
|
|
- func `one_or_more_cons/2` (as `one_or_more.cons/2`)
|
|
- func `one_or_more_to_list/1`
|
|
- pred `list_to_one_or_more/2`
|
|
- pred `det_list_to_one_or_more/2`
|
|
|
|
### Changes to the `map` module
|
|
|
|
* The following predicates and functions have been added:
|
|
|
|
- pred `filter_map_values/3`
|
|
- pred `filter_map_values_only/3`
|
|
- pred `foldl4_values/10`
|
|
- pred `foldl5_values/12`
|
|
- func `keys_as_set/1`
|
|
- pred `keys_as_set/2`
|
|
|
|
### Changes to the `multi_map` module
|
|
|
|
* The following predicates and functions have been added:
|
|
|
|
- func `keys_as_set/1`
|
|
- pred `keys_as_set/2`
|
|
- func `reverse_add/3`
|
|
- pred `reverse_add/4`
|
|
- func `sorted_keys/1`
|
|
- pred `sorted_keys/2`
|
|
|
|
### Changes to the `string` module
|
|
|
|
* Formatting of `uint` values is now directly supported by `format/2` and
|
|
`format/3`. The `poly_type/0` type has been extended with a new
|
|
alternative, `u/1`, to allow this.
|
|
|
|
### Changes to the `stream` module
|
|
|
|
* We have added a new `reader/4` subclass, `unboxed_reader/4`. This subclass
|
|
allows readers to provide a `get` operation that avoids boxing non-error
|
|
outputs.
|
|
|
|
### Changes to the `stream.string_writer` module
|
|
|
|
* The predicate `format/5` now work directly with values of type `uint`.
|
|
(See the changes to the `string` module for further details.)
|
|
|
|
### Changes to the `thread.channel` module
|
|
|
|
* The following predicate has been deprecated and will be removed in a future
|
|
release:
|
|
|
|
- pred `untake/4`
|
|
|
|
### Changes to the `thread.mvar` module
|
|
|
|
* The documentation of the following predicates has been clarified to match the
|
|
actual implementation:
|
|
|
|
- pred `try_take/4`
|
|
- pred `try_read/4`
|
|
|
|
### Changes to the `tree234` module
|
|
|
|
* The following predicates have been added:
|
|
|
|
- pred `filter_map_values/3`
|
|
- pred `filter_map_values_only/3`
|
|
- pred `foldl4_values/10`
|
|
- pred `foldl5_values/12`
|
|
|
|
### Changes to the `uint` module
|
|
|
|
* The following function and predicate have been added:
|
|
|
|
- func `hash/1`
|
|
- pred `hash/2`
|
|
|
|
### Changes to the `version_array` module
|
|
|
|
* The following obsolete function has been removed:
|
|
|
|
- func `unsafe_new/2`
|
|
|
|
### Changes to the `version_hash_table` module
|
|
|
|
* The following predicates have been deprecated and will be removed in a future
|
|
release:
|
|
|
|
- pred `int_hash/2`
|
|
- pred `uint_hash/2`
|
|
- pred `float_hash/2`
|
|
- pred `char_hash/2`
|
|
- pred `string_hash/2`
|
|
- pred `generic_hash/2`
|
|
|
|
Changes to the Mercury compiler
|
|
-------------------------------
|
|
|
|
### Alternative script to invoke the compiler
|
|
|
|
* We have added an alternative script, `mercury`, to use when invoking the
|
|
compiler on systems where the usual name, `mmc`, clashes with other
|
|
executables.
|
|
|
|
### Changes to the treatment of unused imports
|
|
|
|
* The compiler now generates warnings for `:- import_module` and
|
|
`:- use_module` declarations in the interface of a module even if
|
|
that module has submodules. Previously, it generated such warnings
|
|
only if the module had no submodules.
|
|
|
|
### Changes to code model options
|
|
|
|
* `--trail-segments`
|
|
|
|
Grades that support trailing now always use trail segments. This means
|
|
that the `--trail-segments` option now has no effect, and it is therefore
|
|
deprecated.
|
|
|
|
* `--high-level-data`
|
|
|
|
We have deleted the `--high-level-data` option. Its effects are now
|
|
implied by the target language.
|
|
|
|
* `--tags`
|
|
|
|
We have deleted the `--tags` option. Its effects are now implied
|
|
by the target language.
|
|
|
|
### Changes to warnings
|
|
|
|
* [Github issue #85]. The compiler will now generate a warning about
|
|
a disjunct that cannot succeed even if the predicate or function in which
|
|
that disjunct occurs has other modes in which that disjunct can succeed.
|
|
|
|
The generation of such warnings can now be disabled by wrapping
|
|
the whole disjunction, or a larger goal containing it, in a
|
|
`disable_warnings` scope, like this:
|
|
|
|
disable_warnings [no_solution_disjunct] (
|
|
Goal
|
|
)
|
|
|
|
* [Mantis bug #497]. The compiler will now generate a warning for an
|
|
unrecognised warning name in a `disable_warnings` scope instead of
|
|
reporting an error.
|
|
|
|
### New warning options
|
|
|
|
* `--print-errors-warnings-when-generating-interface`
|
|
|
|
Until now, the compiler did not try to detect problems with a module
|
|
when generating its interface files. Now it does. To preserve compatibility,
|
|
by default it still ignores any problems it finds then, but if this option
|
|
is enabled, and if it does in fact find any problems, the compiler will
|
|
report them, and if they are severe enough, it will not generate the
|
|
interface file at all. In the usual use case where the compiler is asked
|
|
to generate the interface file as part of rebuilding the whole executable,
|
|
this behavior has the advantage that the rebuild, which would fail anyway,
|
|
fails sooner.
|
|
|
|
### New auxiliary output options
|
|
|
|
* `--show-definition-extents`
|
|
|
|
When this option is specified, the compiler will write out a list
|
|
of the predicates and functions defined in the module, together with
|
|
the approximate line numbers of their first and last lines,
|
|
to `module.defn_extents`. The list will be ordered on the starting
|
|
line numbers of the predicates and functions.
|
|
|
|
Changes to the Mercury implementation
|
|
-------------------------------------
|
|
|
|
* Grades that support trailing now always use trail segments; it is no longer
|
|
possible to use a fixed size trail.
|
|
|
|
One consequence of this is that the `trseg` grade component now acts
|
|
as a synonym for the `tr` component. Since `tr` is shorter, `trseg`
|
|
is deprecated in its favor.
|
|
|
|
Another consequence is that the `--trail-size` and `--trail-size-kwords`
|
|
runtime options no longer have any effect, and are deprecated.
|
|
|
|
* We have upgraded the bundled Boehm GC to v8.0.6 and libatomic_ops to v7.6.12.
|
|
|
|
* We have enabled support for unmapping of unused memory pages in Boehm GC
|
|
by default. If this should cause a problem on your platform, it can be
|
|
disabled by passing `--disable-gc-munmap` to configure.
|
|
|
|
|
|
|
|
.NET CLR back-end history
|
|
-------------------------
|
|
As mentioned above, we started working on the MLDS back-end in July 1999.
|
|
The MLDS back-end was also used as the basis of the .NET CLR and Java
|
|
back-ends. An initial version of the compiler, which was capable of
|
|
compiling programs such as "hello world" and "eliza", was committed to
|
|
the public Mercury CVS repository on 14th Oct, 2000. The compiler first
|
|
completed a successful bootstrap using the .NET CLR back-end grade on
|
|
February 21st, 2003.
|
|
|