This is a bug-fix release.
[Github issue #147]. We have fixed a const correctness issue in the C runtime that was causing warnings to be emitted with recent versions of GCC and the GNU C library.
[Mantis bug #566]. We have fixed an issue that was causing GNU Make 4.4.0 and above to emit warnings about undefined variables.
We have improved the compatibility of the configure
script with older versions of bash.
We have fixed a bug in the C# implementation of
random.system_rng.generate_uint8/4 that caused it to throw
an exception after successfully generating a random value.
We have added the missing lower-bound checks on the time
components of the predicate calendar.init_date/8.
We have fixed two bugs in
calendar.duration_from_string/2 that caused it to accept
invalid duration strings. The first was that the string “P” was
incorrectly being accepted as the zero duration; the second was that
duration strings containing a fractional second component with no whole
number part (e.g. “PT.5S”) were incorrectly being accepted.
We have fixed a bug in calendar.duration/2 that
caused it to compute an incorrect duration, or abort, for some pairs of
dates whose difference required borrowing days across months of
differing length.
calendar.date_from_string/2 and
calendar.duration_from_string/2 now check for integer
overflow in their components.
We have fixed bugs in the C# and Java implementations of
math.unchecked_log2/1 that caused target language
compilation errors when compiling with
--intermodule-optimisation.
We have fixed a bug where using C# contextual keywords as the names of Mercury entities (e.g. module names) could cause invalid C# to be generated.
We have fixed a bug where a Mercury type containing a data constructor whose name begins with a digit could cause invalid C# code to be generated.
All remaining Java security manager dependencies have been replaced, since the security manager is deprecated.
We have fixed an issue that caused the Microsoft linker to emit
warning LNK4001: “no object files specified; libraries
used”.
We have fixed an incorrect overflow check in
string.to_int/2, string.to_uint,
string.base_string_to_int/3 and
string.base_string_to_uint/3.
We have fixed a bug where string.to_uint/2 and
string.base_string_to_uint/3 returned zero instead of
failing when called with an empty input string.
Many documentation fixes and improvements.
This is a bug-fix release.
[Mantis bug #565]. We have reverted a change that broke
mmake in Mercury versions 22.01.6 and 22.01.7.
We have fixed a problem that was causing the generation of the debugger documentation to fail on Cygwin.
We have increased the C stack size for the compiler on 64-bit Cygwin systems, due to stack overflows occuring with the default size.
We have fixed a bug in the debugger, which, in some rare circumstances, could cause it to print terms to the wrong stream.
This is a bug-fix release.
[Github issue #123]. We have fixed a problem that was causing compilation with GCC 13 to fail.
We have renamed a macro used in the compiler to avoid a clash with the system headers in the MSYS2 UCRT64 environment.
We have fixed a problem that was causing the generation of the debugger documentation to fail on Windows.
We have fixed a problem where MSVC could not compile the C code generated for some tabled Mercury predicates. This was caused by the C code inadvertently making use of some GNU C extensions that MSVC does not support.
This is a bug-fix release.
We have fixed the implementations of transitive closure and
reflexive transitive closure in the digraph
module.
We have a fixed a bug in string.format and related
predicates where int8, int16 and
int32 values were being incorrectly promoted to
int and sign extended when one of the unsigned conversion
specifiers was applied.
[Github issue #116]. We have fixed a problem building programs
with --intermodule-optimization where the compiler was
searching for library files that were not installed unless the library
was also built with --intermodule-optimization
enabled.
[Github issue #117]. We have fixed a bug where the compiler would silently fail when compiling a program that consists of a single source file and some of the required libraries are not available in the selected grade.
The documentation of the following predicates in the
term_io module has been fixed:
quote_char/3quote_atom/3write_escaped_char/3write_escaped_string/3Their documentation said that they write to stdout, when
in fact they write to the current text output stream. By default, this
is stdout, but calls to io.set_output_stream
may change this.
This is a bug-fix release.
We have fixed a bug that was causing invalid fact table file names to be written to dependency files.
We have fixed a bug with the MLDS backend that was causing crashes with certain switches on strings.
We have fixed a bug that was causing some transitive intermodule optimization interfaces to be silently ignored.
We have fixed a bug where termination analysis could cause a compiler abort when invoked on some rarely-occurring predicate structures.
This is a bug-fix release.
We have fixed and clarified the behaviour of the following
string module predicates when called on a string containing
ill-formed code unit sequences:
all_match/2index_next_repl/5unsafe_index_next_repl/5prev_index_repl/5unsafe_prev_index_repl/5We have fixed a bug in the getopt and
getopt_io modules where negating a
maybe_string option would set its option table entry to an
incorrect value.
We have fixed an issue where flags specific to GCC were being passed to MSVC when building Mercury using MSVC.
This is a bug-fix release.
asm_fast grades with GCC versions 11 and 12 on x86_64
systems.This is a bug-fix release.
[Mantis bug #558]. We have fixed a bug that was causing some of the manual pages to sometimes build incorrectly.
[Mantis bug #560]. We have disabled the use of the
asm_fast* grades on AArch64 when using GCC 9+ due to
incompatibilities with position-independent code.
We have fixed a bug that was causing assertion failures or segmentation violations in the Mercury runtime on AArch64 systems with versions of GCC before 10.
[Github issue #102]. We have disabled the use of the GCC option
-Warray-bounds for GCC version 12 and onwards. This is due
to GCC emitting spurious warnings when that option is enabled. (The use
of that option was already disabled for GCC versions 9-11.)
This is a bug-fix release.
We have removed is as a synonym for
unification.
We have reserved =</2 as a type name.
A term with a top-level functor coerce/1 is now
treated as a type conversion expression. To call a function named
coerce/1, you can module qualify the name at the call site,
or wrap parentheses around the name,
e.g. (coerce)(Arg).
We have renamed the lexer and parser
modules of the Mercury standard library to
mercury_term_lexer and mercury_term_parser
respectively.
We have made slight changes to the names and/or the functionality
of several predicates in the getopt and
getopt_io modules.
We have removed the legacy support for the Alpha architecture.
We have dropped support for macOS 10.8 and earlier.
We have removed the Erlang backend as it was unmaintained.
random.system_rngarray
moduleThe following obsolete predicates and functions have been removed:
bsearch/3 (replacement:
binary_search/3)bsearch/4 (replacement:
binary_search/4)least_index/1 (replacement:
min/1)greatest_index/1 (replacement:
max/1)The following predicate has been added:
generate_foldl2/7array2d moduleThe following predicates and functions have been added:
lookup/3 (synonym for
Array ^ elem(R, C))lookup/4 (synonym for
Array ^ elem(R, C))unsafe_lookup/3 (synonym for
Array ^ unsafe_elem(R, C))unsafe_lookup/4 (synonym for
Array ^ unsafe_elem(R, C))The lists/1 function now returns an empty list for a
0x0 array.
assoc_list moduleThe following predicates and functions have been added:
common_subset/2maybe_from_corresponding_lists/3bag
moduleThe following obsolete predicates and functions have been removed:
to_set_without_duplicates/1 (replacement: func
to_set/1)to_set_without_duplicates/2 (replacement: func
to_set/1)bitmap
moduleThe following predicates and functions have been added:
get_bit/2get_bits/2get_byte/2set_bit/4set_bits/4set_byte/4unsafe_get_bit/2unsafe_get_bits/2unsafe_get_byte/2unsafe_set_bit/4unsafe_set_bits/4unsafe_set_byte/4char
moduleThe following predicates have been added:
unsafe_base_digit_to_int/3to_utf8_uint8/2to_utf16_uint16/2The following obsolete predicates and functions have been removed:
det_int_to_digit/1 (replacement:
det_int_to_decimal_digit/1)det_int_to_digit/2 (replacement:
det_int_to_decimal_digit/2)digit_to_int/2 (replacement:
decimal_digit_to_int/2)int_to_digit/2 (replacement:
int_to_decimal_digit/2)cord
moduleThe following predicates have been added:
foldl2/6foldl3/8dir
moduleThe following predicate has been added:
general_foldl2/8getopt
moduleThe following new predicates have been added:
record_arguments/8expand_file_specials/8The following variants of the existing process_options predicate have been added:
process_options_io/6process_options_io/7process_options_track_io/9process_options_userdata/8process_options_userdata_io/10The ones whose names have an _io suffix do the same jobs
as the corresponding predicates without the _io suffix,
with the exception that they also have a pair of I/O state arguments
that allow them to implement file_special options. This
functionality used to be available only from the getopt_io
module.
The following predicates have had their argument types changed:
process_options/6process_options/7process_options_track/7All these predicates used to return error indications in the form of
a simple string. They now return error indications using the existing
structured type option_error, which can be converted into a
string on demand.
The following predicates have been deleted:
process_options_se/6process_options_se/7process_options_track_se/7Their functionality is now available from the predicates with the
same name minus the _se suffix.
getopt_io modulegetopt module, but it is
scheduled to be deleted after the next release.int
moduleThe following functions have been added:
uint_to_lc_hex_string/2 (synonym for
uint_to_hex_string/2)uint64_to_lc_hex_string/2 (synonym for
uint64_to_hex_string/2)The following obsolete predicates and functions have been removed:
is/2 (replacement: =,
i.e. unification)legacy_left_shift/2 (replacement:
<<)legacy_right_shift/2 (replacement:
>>)int32
moduleThe following functions have been added:
cast_to_int8cast_from_int8cast_to_int16cast_from_int16cast_to_int64cast_from_int64integer moduleThe following obsolete functions have been removed:
from_base_string/2 (replacement: pred
from_base_string/3)from_string/2 (replacement: pred
from_string/2)int/2 (replacement:
det_to_int/1)io
moduleThe following predicates have been added to this module:
get_environment_var_map/3read_binary_int8_unboxed/5read_binary_uint8_unboxed/5read_named_file_as_string/4read_named_file_as_lines/4write_line_cc/4The following obsolete predicates have been removed:
make_temp/3 (replacement:
make_temp_file/3)make_temp/5 (replacement:
make_temp_file/5)The following predicates have been marked as obsolete:
see/4 (replacement:
prolog.see/4)see_binary/4 (replacement:
prolog.see_binary/4)seen/2 (replacement:
prolog.seen/2)seen_binary/2 (replacement:
prolog.seen_binary/2)tell/4 (replacement:
prolog.tell/4)tell_binary/4 (replacement:
prolog.tell_binary/4)told/2 (replacement:
prolog.told/2)told_binary/2 (replacement:
prolog.told_binary/2)The following predicate has been renamed:
report_stats/2 to
report_standard_stats/2.lexer
modulemercury_term_lexer, to
make name clashes between it and user-written modules less likely.list
moduleThe following predicates have been added:
delete_nth/3foldl7/16foldl8/18foldl4_corresponding/11The following obsolete predicate has been removed:
takewhile/4 (replacement:
take_while/4)map
moduleThe following predicates have been added to this module:
foldl6/14foldl6_values/14foldr6/14maybe
moduleThe following predicates have been added to this module:
foldl3_maybe/8foldl4_maybe/10foldl5_maybe/12map_foldl4_maybe/11map_foldl5_maybe/13parser
modulemercury_term_parser, to
make name clashes between it and user-written modules less likely.prolog
moduleThe following predicate has been added to this module:
is/2 (moved here from the int
module)see/4 (moved here from the io
module)see_binary/4 (moved here from the io
module)seen/2 (moved here from the io
module)seen_binary/2 (moved here from the io
module)tell/4 (moved here from the io
module)tell_binary/4 (moved here from the io
module)told/2 (moved here from the io
module)told_binary/2 (moved here from the io
module)random
moduleThe following obsolete predicate has been removed:
test/4 (replacement: none)std_util moduleThe following obsolete predicates and functions have been removed:
maybe_func/2 (replacement: func
maybe.func_to_maybe/1)maybe_pred/3 (replacement: func
maybe.pred_to_maybe/1)string
moduleThe following functions have been added:
add_suffix/2split_into_lines/1to_uint/2det_to_uint/1base_string_to_uint/3det_base_string_to_uint/2uint_to_hex_string/1uint_to_uc_hex_string/1uint_to_octal_string/1uint64_to_hex_string/1uint64_to_uc_hex_string/1uint64_to_octal_string/1The following function symbols have been added to the type
poly_type:
i8(int8)i16(int16)i32(int32)i64(int64)u8(uint8)u16(uint16)u32(uint32)u64(uint64)This allows predicates such as string.format and
io.format to operate on values of not just the word sized
integer types int and uint, but on sized
versions of them as well.
term
moduleThe following obsolete predicates and functions have been removed:
func var_id/1 (replacement:
var_to_int/1)
func relabel_variable/3 (replacement:
rename_var_in_term/4)
pred relabel_variable/4 (replacement:
rename_var_in_term/4)
func relabel_variables/3 (replacement:
rename_var_in_terms/4)
pred relabel_variables/4 (replacement:
rename_var_in_terms/4)
func rename/3 (replacement:
rename_var_in_term/4)
pred rename/4 (replacement:
rename_var_in_term/4)
func rename_list/3 (replacement:
rename_var_in_terms/4)
pred rename_list/4 (replacement:
rename_var_in_terms/4)
func apply_renaming/3 (replacement:
apply_renaming_in_term/3)
pred apply_renaming/3 (replacement:
apply_renaming_in_term/3)
func apply_renaming_to_list/3 (replacement:
apply_renaming_in_terms/3)
pred apply_renaming_to_list/3 (replacement:
apply_renaming_in_terms/3)
func apply_variable_renaming/2 (replacement:
apply_renaming_in_term/3)
pred apply_variable_renaming/3 (replacement:
apply_renaming_in_term/3)
func apply_variable_renaming_to_list/2 (replacement:
apply_renaming_in_terms/3)
pred apply_variable_renaming_to_list/3 (replacement:
apply_renaming_in_terms/3)
func apply_variable_renaming_to_var/2 (replacement:
apply_renaming_in_var/3)
pred apply_variable_renaming_to_var/3 (replacement:
apply_renaming_in_var/3)
func apply_variable_renaming_to_vars/2 (replacement:
apply_renaming_in_vars/3)
pred apply_variable_renaming_to_vars/3 (replacement:
apply_renaming_in_vars/3)
func substitute/3 (replacement:
substitute_var_in_term/4)
pred substitute/4 (replacement:
substitute_var_in_term/4)
func substitute_list/3 (replacement:
substitute_var_in_terms/4)
pred substitute_list/4 (replacement:
substitute_var_in_terms/4)
func substitute_corresponding/3 (replacement:
substitute_corresponding_in_term/4)
pred substitute_corresponding/4 (replacement:
substitute_corresponding_in_term/4)
func substitute_corresponding_list/3 (replacement:
substitute_corresponding_in_terms/4)
pred substitute_corresponding_list/4 (replacement:
substitute_corresponding_in_terms/4)
func apply_substitution/2 (replacement:
apply_substitution_in_term/3)
pred apply_substitution/3 (replacement:
apply_substitution_in_term/3)
func apply_substitution_to_list/2 (replacement:
apply_substitution_in_terms/3)
pred apply_substitution_to_list/3 (replacement:
apply_substitution_in_terms/3)
func apply_rec_substitution/2 (replacement:
apply_rec_substitution_in_term/3)
pred apply_rec_substitution/3 (replacement:
apply_rec_substitution_in_term/3)
func apply_rec_substitution_to_list/2 (replacement:
apply_rec_substitution_in_terms/3)
pred apply_rec_substitution_to_list/3 (replacement:
apply_rec_substitution_in_terms/3)
thread
moduleThe following predicate and functions have been added:
init_thread_options/0set_min_stack_size/3spawn_native/5thread.mvar moduleThe following obsolete function has been removed:
init/1 (replacement:
impure_init/1)thread.semaphore moduleThe following obsolete function has been removed:
init/1 (replacement:
impure_init/1)time
moduleThe following obsolete functions have been removed:
ctime/1 (replacement: localtime/4 and
asctime/1)localtime/1 (replacement:
localtime/4)mktime/1 (replacement: mktime/4)tree234 moduleThe following predicates have been added to this module:
foldl6/14foldl6_values/14foldr6/14uint16
moduleThe following functions have been added:
from_uint/2det_from_uint/1cast_from_uint/1rotate_left/2rotate_right/2unchecked_rotate_left/2unchecked_rotate_right/2set_bit/2unchecked_set_bit/2clear_bit/2unchecked_clear_bit/2flip_bit/2unchecked_flip_bit/2bit_is_set/2unchecked_bit_is_set/2bit_is_clear/2unchecked_bit_is_clear/2cast_from_uint8/1cast_to_uint8/1uint32
moduleThe following functions have been added:
from_uint/2det_from_uint/1rotate_left/2rotate_right/2unchecked_rotate_left/2unchecked_rotate_right/2set_bit/2unchecked_set_bit/2clear_bit/2unchecked_clear_bit/2flip_bit/2unchecked_flip_bit/2bit_is_set/2unchecked_bit_is_set/2bit_is_clear/2unchecked_bit_is_clear/2cast_from_uint8/1cast_to_uint8/1cast_from_uint16/1cast_to_uint16/1uint64
moduleThe following functions have been added:
cast_from_uint/1rotate_left/2rotate_right/2unchecked_rotate_left/2unchecked_rotate_right/2set_bit/2unchecked_set_bit/2clear_bit/2unchecked_clear_bit/2flip_bit/2unchecked_flip_bit/2bit_is_set/2unchecked_bit_is_set/2bit_is_clear/2unchecked_bit_is_clear/2cast_from_uint8/1cast_to_uint8/1uint8
moduleThe following functions have been added:
from_uint/2det_from_uint/1cast_from_uint/1rotate_left/2rotate_right/2unchecked_rotate_left/2unchecked_rotate_right/2set_bit/2unchecked_set_bit/2clear_bit/2unchecked_clear_bit/2flip_bit/2unchecked_flip_bit/2bit_is_set/2unchecked_bit_is_set/2bit_is_clear/2unchecked_bit_is_clear/2varset
moduleThe following obsolete predicates have been removed:
merge_subst/4 (replacement:
merge_renaming/4)merge_subst_without_names/4 (replacement:
merge_renaming_without_names/4)The following functions and predicates have been added:
unname_var/2unname_var/3undo_default_names/2The type system now supports subtypes, which work in tandem with
type conversion expressions (“coerce”). For example, the following
defines a subtype real_color of a discriminated union type
color:
:- type color
---> rgb(float, float, float)
; cmyk(float, float, float, float)
; named(string).
:- type real_color =< color
---> rgb(float, float, float)
; cmyk(float, float, float, float).
A term of type real_color can be converted to a term of
type color with coerce(Term). A term of type
color can be converted to a term of type
real_color if it has an appropriate inst. Subtypes share a
common data representation with their base types, so the type
conversions do not cost anything at runtime.
Field names no longer need to be unique within a module.
The compiler can implement tabling only when generating C code.
When compiling a predicate that has a pragma memo specified
for it in a non-C grade, it necessarily ignores the pragma, but normally
it prints a warning about this fact. The compiler now supports a new
attribute, disable_warning_if_ignored, that suppresses such
warnings for a pragma memo if included in the pragma’s
attribute list, like this:
:- pragma memo(predname/arity, [disable_warning_if_ignored])]).A pragma foreign_proc declaration can now include an
attribute may_not_export_body that prevents its body
(i.e. the foreign code) from being duplicated outside of the target file
for that module by intermodule optimization. This is useful when the
foreign code refers to types, functions, etc. that should be kept local
to the target file of that module. Unlike the
may_not_duplicate attribute,
may_not_export_body does not prevent inlining of the
foreign procedure into other procedures in the same module.
Many pragmas contain a name/arity pair for specifying the predicate or function they apply to; an example is
:- pragma inline(init/1).
If the module in which this pragma occurs contains both a function
init/1 and a predicate init/1, then this
pragma is ambiguous. Traditionally, the Mercury compiler applied such
ambiguous pragma to both the function and the predicate. The programmers
who wished the pragma to apply to only one of them had to rename the
other.
Now, pragmas that take a name/arity pair can specify whether they are
intended to apply to a function or to a predicate by putting a
func() or pred() wrapper around the name/arity
pair, like this:
:- pragma inline(func(init/1)). % applies ONLY to func init/1.
:- pragma inline(pred(init/1)). % applies ONLY to pred init/1.
This new syntax applies to all of the following kinds of pragmas:
check_termination
consider_used
does_not_terminate
fact_table
inline
loop_check
memo
minimal_model
mode_check_clauses
no_determinism_warning
no_inline
obsolete
promise_equivalent_clauses
promise_pure
promise_semipure
require_tail_recursion
terminates
type_specIf a command line first enables an optimization (say
opt1), and then sets the optimization level to
N with -O<N>, then the compiler will now
keep opt1 enabled even if opt1 is not normally
enabled at optimization level N.
Due to a bug fix, the --warn-unused-imports option
is now stricter in warning about modules that are imported in the
interface section but are not used in the interface section.
We have fixed parsing of reverse implication goals (A <= B).
By default, the compiler now checks some aspects of a module
semantics when generating the .int and .int2 interface files for that
module. (For example, it generates error messages for references to
undefined types, insts and modes.) This new behavior can be switched off
for now with the new option --no-halt-at-invalid-interface.
This new option replaces the old
--no-print-errors-warnings-when-generating-interface
option, but once any problems caused by the new approach have been
ironed out, we intend to delete the
--halt-at-invalid-interface option as well.
In an earlier release, we extended the syntax of
:- inst declarations to allow programmers to specify which
type constructor’s values the inst is meant for. At that time, these
functioned only as documentation, but the compiler now reports error
messages for situations in which an inst that was declared to be
intended for values of one type constructor is applied to values of
another type constructor.
The new option --output-stdlib-grades outputs the
grades in which the Mercury standard library is available with this
compiler.
By default, the compiler now warns if the module being compiled
has a name that shadows that of Mercury standard library module. The
warning can be disabled using the new option
--no-warn-stdlib-shadowing.
The new options --output-java-class-dir and
--output-java-class-directory are now supported as synonyms
for --output-class-dir.
The new option --halt-at-warn-make-interface causes
the compiler to treat all warnings as if they were errors when
generating interface files.
The new option --halt-at-warn-make-opt causes the
compiler to treat all warnings as if they were errors when generating
optimization files.
The new option --warn-potentially-ambiguous-pragma
causes the compiler to generate a warning for all pragmas that include a
name/arity pair, but lack a func() or pred()
wrapper around it to indicate whether they are intended to apply to a
function or to a predicate.
We have ported Mercury to Linux AArch64 (ARM64) systems.
The tools/configure_mingw_cross script has been
replaced by tools/configure_cross. It now supports
aarch64-linux-gnu and aarch64-linux-musl as targets (i.e. Linux on
aarch64 with GNU or musl C libraries).
The list command may now call an external command to
print source listings; the command is set using list_cmd.
For example, the command could produce syntax highlighted source
listings.
We have removed support for browsing terms as XML
(browse --xml) as it was unmaintained and did not work any
more. The browse --web command provides an alternative
method for interactively exploring a term.
For news about earlier versions, see the HISTORY file.