Discussion of these changes can be found on the Mercury developers
mailing list archives from June 2018.
COPYING.LIB:
Add a special linking exception to the LGPL.
*:
Update references to COPYING.LIB.
Clean up some minor errors that have accumulated in copyright
messages.
extras/trailed_update/samples/vqueens.m:
Use higher-order any insts to avoid the mode error in this module.
extras/trailed_update/var.m:
Add extras modes to the freeze predicates that take closures with inst
any. (XXX This module could do with a re-write since Mercury now
implements many of the features that had to be hacked around when
it was written.)
Branches: main
Fix bitrot in extras/trailed_update.
extras/trailed_updated/var.m:
Don't specify an initialisation predicated for the solver type var/1.
extras/trailed_updated/samples/interpreter.m:
Conform with the change that added an extra argument to the variable/2
constructor of the standard library type term/1.
extras/trailed_update/tests/var_test.m:
Use up-to-date syntax for modes.
extras/trailed_update/Mmakefile:
extras/trailed_update/samples/Mmakefile:
extras/trailed_update/tests/var_test.m:
Use trail segments since that's what you get in an installation by
default.
extras/trailed_update/*.m:
Update syntax and formatting to conform more closely to our
current coding standards.
Add require_feature_set pragmas for trailing.
Estimated hours taken: 1
Branches: main
Remove support for the reserve tag (.rt) grades.
These were only ever needed to support the implementation of Herbrand
variables in (older versions of) HAL.
NOTE: this change removes the .rt grade, the undocumented
reserve_tag pragma is unchanged.
runtime/mercury_grade.h:
Do not handle the .rt component. Rather than renumbering the
grade parts here I have documented that grade part 8 (formerly .rt)
is unused.
runtime/mercury_tags.h:
runtime/mercury_type_info.h:
runtime/mercury_conf_param.h:
Conform to the above change.
compiler/compile_target_code.m:
compiler/handle_options.m:
compiler/options.m:
compiler/make_tags.m:
compiler/prog_type.m:
Remove the `--reserve-tag' option and modify any code
that relied upon it. Such code is largely unchanged
since it is still required for the implementation of the
reserve_tag pragma.
doc/user_guide.texi:
Delete documentation for `--reserve-tag'.
scripts/canonical_grade.sh-subr:
scripts/init_grade_otpions.sh-subr:
scripts/mgnuc.in:
scripts/parse_grade_options.sh-subr:
Remove support for the `.rt' grade component.
NEWS:
Announce that .rt grades are no longer supported.
extras/trailed_update/var.m:
extras/trailed_update/samples/Mmakefile:
extras/trailed_update/tests/Mmakefile:
Update some documentation.
tests/debugger/Mmakefile:
tests/tabling/Mmakefile:
Delete special handling for .rt grades.
Estimated hours taken: 1
Branches: main
Use `pragma foreign_export' in preference to `pragma export' throughout
the Mercury distribution.
Convert more of the extras distribution to four-space indentation and
other minor cleanups.
browser/*.m:
library/*.m:
samples/*:
extras/*:
As above.
Estimated hours taken: 0.1
Branches: main, release
Fix compilation of extras/trailed_update.
extras/trailed_update/var.m:
Add missing promise_pure scopes.
extras/trailed_update/samples/interpreter.m:
Conform to recent changes in the standard library.
Estimated hours taken: 0.5
Branches: main
Fix compilation problems in the extras distribution caused by recent
changes.
extras/stream/stream.m:
Provide a definition for the type stream/1.
extras/*/*.m:
Conform to the recent changes to the standard library.
Estimated hours taken: 2.5
Branches: main, release
extras/trailed_update/tr_array.m:
extras/trailed_update/tr_store.m:
extras/trailed_update/var.m:
extras/trailed_update/unsafe.m:
extras/trailed_update/samples/vqueens.m:
Use more recent syntax and make these modules
conform more closely to our coding standard.
Use the new foreign language interface.
Replace deprecated mode and inst syntax.
extras/trailed_update/samples/interpreter.m:
extras/trailed_update/samples/interpreter.exp:
s/mutvar/generic_mutvar/
Estimated hours taken: 0.25
Branches: main, version-0_12-branch
extras/trailed_update/tr_store.m:
Change mutvar and ref to generic_mutvar and generic_ref
throughout.
extras/trailed_update/var.m:
Change the definition of var/1 to use the new solver types
interface.
Estimated hours taken: 120
Branches: main
Allow types to be declared as "solver" types using the syntax
`:- solver type ...'.
For a non-solver type t (i.e. any type declared without using the
`solver' keyword), the inst `any' should be considered to be equivalent
to a bound inst i where i contains all the functors of the type t and
each argument has inst `any'. For solver types, `any' retains its
previous meaning.
This is required to allow us to represent HAL's `old' inst using `any'.
In HAL, `old' is like `any' if the type is an instance of a particular
type class (`solver/1'). However, for types that are not instances of
`solver/1', `old' needs to be treated as though it is `bound'.
library/ops.m:
Add `solver' as a unary prefix operator.
compiler/prog_data.m:
Add a field to the type `type_defn' to record whether or not the
type is a solver type.
compiler/hlds_data.m:
Add an equivalent field to the type `hlds_type_body'.
compiler/prog_io.m:
compiler/make_hlds.m:
compiler/modules.m:
compiler/mercury_to_mercury.m:
compiler/hlds_out.m:
Handle the new ":- solver type ..." syntax.
compiler/det_report.m:
compiler/equiv_type.m:
compiler/foreign.m:
compiler/hlds_code_util.m:
compiler/hlds_out.m:
compiler/intermod.m:
compiler/magic_util.m:
compiler/ml_code_gen.m:
compiler/ml_type_gen.m:
compiler/ml_unify_gen.m:
compiler/mlds.m:
compiler/module_qual.m:
compiler/post_typecheck.m:
compiler/pragma_c_gen.m:
compiler/recompilation.check.m:
compiler/recompilation.usage.m:
compiler/recompilation.version.m:
compiler/special_pred.m:
compiler/stack_opt.m:
compiler/switch_util.m:
compiler/table_gen.m:
compiler/term_util.m:
compiler/type_ctor_info.m:
compiler/unify_gen.m:
compiler/unify_proc.m:
Handle the changes to `type_defn' and `hlds_type_body'.
compiler/type_util.m:
Add predicates `type_util__is_solver_type' and
`type_body_is_solver_type'.
compiler/inst_match.m:
compiler/inst_util.m:
In inst_matches_{initial,final,binding} and
abstractly_unify_inst_functor, when we are comparing `any' insts, check
whether or not the type is a solver type and treat it appropriately.
compiler/instmap.m:
compiler/modecheck_unify.m:
Pass type information to abstractly_unify_inst_functor.
compiler/mode_util.m:
Add a predicate `constructors_to_bound_any_insts' which is the same as
`constructors_to_bound_insts' except that it makes the arguments of the
bound inst `any' instead of `ground'.
tests/invalid/any_mode.m:
tests/invalid/any_mode.err_exp:
tests/hard_coded/any_free_unify.m:
Modify these test cases to use a "solver" type instead of `int'.
tests/valid/any_matches_bound.m:
tests/valid/Mmakefile:
tests/invalid/Mmakefile:
tests/invalid/any_should_not_match_bound.m:
tests/invalid/any_should_not_match_bound.err_exp:
Add new test cases.
extras/trailed_update/var.m:
clpr/cfloat.m:
Modify to use the new `:- solver type' syntax.
Branches: main
Estimated hours taken: 4
Fix some problems with the trailed_update tests.
extras/trailed_update/var.m:
Document that this module doesn't work in `.rt' grades (and why).
extras/trailed_update/samples/Mmakefile:
Disable the vqueens test in `.rt' grades.
Also, enable the interpreter test, since the reason for disabling
it is no longer valid now that the value numbering pass has been
deleted. But disable it for `.rt' grades, since it turns out
to fail for those.
Also, use $(DIFF_OPTS) rather than hard-coding "-c".
extras/trailed_update/samples/interpreter.exp:
Update to reflect the current output,
which has different variable numbers than the original output.
(The output also changed slightly when interpreter.m was changed
to use store__new rather than store__init.)
Estimated hours taken: 0.1
Branches: main
Fix a portability problem that broke the trailed_update tests with lcc.
extras/trailed_update/var.m:
Use "\\n" rather than "\n" for newlines in string literals
that occur inside pragma c_code.
Estimated hours taken: 4
Branches: main
Add MR_ prefixes to the remaining non-prefixed symbols.
This change will require all workspaces to be updated
The compiler will start generating references to MR_TRUE,
MR_bool, etc., which are not defined in the old runtime
header files.
runtime/mercury_std.h:
Add MR_ prefixes to bool, TRUE, FALSE, max, min,
streq, strdiff, strtest, strntest, strneq, strndiff,
strntest, NO_RETURN.
Delete a commented out definition of `reg'.
runtime/mercury_tags.h:
Add an MR_ prefix to TAGBITS.
configure.in:
runtime/mercury_goto.h:
runtime/machdeps/i386_regs.h/mercury_goto.h:
Add an MR_ prefix to PIC.
runtime/mercury_conf_param.h:
Allow non-prefixed PIC and HIGHTAGS to be defined on
the command line.
runtime/mercury_bootstrap.h:
Add backwards compatibility definitions.
RESERVED_MACRO_NAMES:
Remove the renamed macros.
compiler/export.m:
compiler/ml_code_gen.m:
Use MR_bool rather than MR_Bool (MR_Bool is
meant to be for references to the Mercury type
bool__bool).
runtime/mercury_types.h:
Add a comment the MR_Bool is for references to
bool__bool.
*/*.c:
*/*.h:
*/*.m:
Add MR_ prefixes.
Estimated hours taken: 16
Implement trailing for the MLDS back-end.
library/private_builtin.m:
Define impure Mercury procedures corresponding to the
trailing operations in runtime/mercury_trail.h.
compiler/add_trail_ops.m:
A new HLDS->HLDS pass.
This implements trailing by inserting calls to the
trailing primitives declared in library/private_builtin.m.
compiler/notes/compiler_design.html:
Document the new pass.
compiler/mercury_compile.m:
Change the code for mercury_compile__mlds_backend so that
if trailing is enabled, it invokes the new add_trail_ops pass.
runtime/mercury_wrapper.c:
For high-level C grades, call MR_init_memory() (which sets up
the redzone signal handlers, etc.) and if trailing is enabled,
initialize the trail.
library/benchmarking.m:
Change the code in report_stats for printing out the size of
the trail so that it gets the trail zone from MR_trail_zone
rather than via the MercuryEngine, so that it works in
high-level C grades (which don't have any MercuryEngine).
extras/trailed_update/tr_array.m:
extras/trailed_update/var.m:
Add missing `#includes' to make these files work with the
MLDS back-end.
Estimated hours taken: 0.5
extras/trailed_update/var.m:
Declare the impure predicates debug_pred/3 and debug_pred2/4
as pure, rather than impure. This is necessary because we use
these predicates as arguments to the higher-order predicate
freeze/3, and currently Mercury doesn't support impure
closures.
Estimated hours taken: 18
Make the retry command work in trailing grades (e.g. for HAL).
compiler/trace.m:
In trailing grades, reserve two stack slots to hold (a) the trail
pointer on entry, and (b) a new ticket obtained on entry. Arrange to
put the numbers of these stack slots in the proc layout.
compiler/stack_layout.m:
Put the number of the first of these stack slots in the proc layout.
compiler/code_info.m:
Arrange the default: there are no such slots if debugging is not
enabled.
compiler/code_gen.m:
Insert code to discard the allocated ticket, in the success epilog
of model_det procedures, the success and failure epilogs of model_semi
procedures, and the failure epilogs of model_non procedures.
(Model_det procedures don't have failure epilogs, and discarding
the ticket in the success epilog of a model_non procedure would be
premature.)
compiler/llds.m:
Add two new alternatives to the type describing stack slots:
a stack slot may contain a trail pointer or a ticket.
Add a new reason for resetting the trail: a retry in the debugger.
compiler/llds_out.m:
Minor changes to conform to llds.m, and to make diagnostic output
less misleading.
library/builtin.m:
Add the type_ctor_info for the new "types" describing stored trail
pointers and tickets.
Bring up to date the type_ctor_infos of other "types" used only
for describing stack slots.
library/std_util.m:
Add the missing code to handle the type_ctor_infos of trail pointers,
tickets and other "types" used only for describing stack slots.
runtime/mercury_type_info.h:
Add a new type_ctor representation value for stored trail pointers,
tickets, and for other "types" used only for describing stack slots.
runtime/mercury_deep_copy_body.h:
runtime/mercury_tabling.c:
Add the missing code to handle the type_ctor_infos of trail pointers,
tickets and other "types" used only for describing stack slots.
runtime/mercury_stack_layout.h:
Add a field to proc layouts to hold either the number of the first
of the two stack slots holding trail info, or -1.
runtime/mercury_trail.h:
Add the new reason why the trail may be reset.
trace/mercury_trace.c:
In trailing grades, reset the trail, with the reason being given
as retry, when the debugger's retry command is executed.
extras/references/scoped_update.m:
extras/trailed_update/var.m:
clpr/cfloat.m:
extras/trailed_update/tests/func_trail_test.m:
extras/trailed_update/tests/func_trail_test_2.m:
Handle MR_retry as a reason for unwinding the trail.
Estimated hours taken: 0.5
profiler/call_graph.m:
profiler/read.m:
extras/trailed_update/var.m:
Fix some "missing interface import" bugs detected by the
latest version of the compiler.
Estimated hours taken: 1
extras/trailed_update/var.m:
Avoid mode errors in debug_freeze/{3,4} which were caused by the use
of a variable of inst `any' as the curried argument in a higher-order
term. The fix was to replace `unsafe_perform_io(dump_var(Var))'
with `unsafe_dump_var(Var)' where unsafe_dump_var/1 is a new impure
version of dump_var/3.
(The mode errors were detected as a result of Andrew Bromage's
recent change to fix mode checking for lambda expressions.
In this particular case, as it happens, there is no genuine error,
becaused dump_var/1 does not instantiate its argument.
However, there's no way for the mode checker to know that,
so it is correct to report an error.)
Estimated hours taken: 2
extras/trailed_update/var.m:
Add new predicate var__is_ground/2.
Also fix a bug: it was not handling unifications between
already-aliased variables correctly.
extras/trailed_update/samples/tests.m:
extras/trailed_update/samples/tests.exp:
extras/trailed_update/samples/tests.out:
Add some more test cases.
Estimated hours taken: 1
extras/trailed_update/var.m:
Fix a bug (I had changed a function name in but forgotten
to change the caller).
extras/trailed_update/Mmakefile:
Add `-Werror' to MGNUCFLAGS, to prevent reoccurrence of bugs
like the one above.
Fix the rule for `mmake depend' so that it makes the
dependencies in the `samples' subdirectory too.
tools/test_mercury:
Test the trailed_update library.
Estimated hours taken: 4
Dectect floundering in solutions/2 and nondet if-then-else.
library/std_util.m:
Change the code for builtin_aggregate to (a) check for
floundering and (b) reset the trail properly.
compiler/code_gen.m:
Change the code for if-then-elses with nondet conditions
so that it checks for floundering.
runtime/mercury_trail.h:
compiler/llds.m:
compiler/llds_out.m:
Add new alternative `MR_solve' to MR_untrail_reason.
This is used to for checking for floundering in the
above-mentioned two cases.
extras/clpr/cfloat.m:
extras/trailed_update/var.m:
Handle the MR_solve case.
doc/reference_manual.texi:
Document MR_solve.
NEWS:
Delete the mention of the limitation that we didn't
dectect floundering in solutions/2 and nondet if-then-else.
Estimated hours taken: 3
extras/trailed_update/var.m:
Fix a bug in the code for detecting floundering.
Improve the error message for floundering slightly
(print out how many floundered goals there are).
extras/trailed_update/Mmakefile:
Add an `mmake check' target.
extras/trailed_update/samples/tests.exp:
Update the expected test output to reflect the new
floundering error message.
Estimated hours taken: 6
Various bug fixes and enhancements to var.m and other stuff in
extras/trailed_update.
extras/trailed_update/var.m:
Add code to detect floundering.
Change the code for debug_freeze/3 to avoid a floundering warning.
Add new predicates debug_freeze/4 (to go with debug_freeze/3)
and dump_var/3.
Fix a bug in freeze/3 (higher-order terms are monomorphic, so
there is no need to explicitly pass type-infos when calling them).
Fix a bug in wakeup_delayed_goals/2 (we need to set the binding
to ground _before_ waking up the goals).
extras/trailed_update/Mmakefile:
Add `ML = ml --mercury-libs shared', so that it will work on Linux.
extras/trailed_update/samples/Mmakefile:
Make it work with shared libraries on Linux.
extras/trailed_update/samples/tests.m:
extras/trailed_update/samples/tests.exp:
Some test cases for var.m.
extras/trailed_update/tr_store.m:
Add a prototype for ML_compare_typeinfo().
extras/trailed_update/unsafe.m:
Change the C code for unsafe_perform_io to match the new
interface for exported Mercury procedures that do I/O --
there is no longer any need to pass dummy io__state arguments
in the C code.
Estimated hours taken: 0.5
extras/trailed_update/var.m:
Fix a bug: some of the code relied on there always being at least one
level of indirection (i.e. assumed that the top-level functor of a
variable representation was always alias/1), but the code to
initialize a variable with a ground value did not satisfy this
invariant.
Also change the top-level functor from var_rep/1 to '$VAR'/1,
for cosmetic reasons.
Estimated hours taken: 0.25
extras/trailed_update/var.m:
Delete some old code that is no longer necessary;
the code in question has now migrated to the Mercury
runtime directory.
Estimated hours taken: 16
extras/trailed_update/var.m:
New module, containing support for Prolog-style variables
and coroutining with freeze/2 and freeze/3.
extras/trailed_update/unsafe.m:
New module, containing unsafe_perform_io.
extras/trailed_update/trailed_update.m:
Add reference to var.m.