set of flags that it passes to the linker in order to link against a
selected set of Mercury libraries (the standard libraries plus any others
specified via the --ml option) in the current grade.
This removes the need for using the ml script with standalone interfaces.
(Which is useful on those systems that don't have a proper shell and can't
use that script!)
compiler/compiler_target_code.m:
Add a predicate that prints out the above information.
Refactor code in order to to avoid duplication between the new
functionality and the existing code for invoking the linker.
compiler/mercury_compile.m:
compiler/options.m:
Add the new option.
doc/user_guide.texi:
Add an entry for the new option.
samples/c_interface/standalone_c/Makefile:
Query the compiler directly about what flags to pass to the linker
rather than using the ml script.
Query the compiler about what flags to pass to the C compiler as
well. (This was implemented a while ago, but this example was
never updated.)
Extend this example to optionally work with shared libraries.
samples/muz/Mmakefile:
Don't hardcode grade and linker settings that will break on
some systems. (The defaults chosen by the compiler will be fine
in this case.)
Estimated hours taken: 10
Branches: main
Remove support for automatic initialisation of solver types from the language.
This is being done because:
* the current implementation of automatic initialisation means we cannot
support polymorphic solver types, e.g. you cannot have the type foo(bar)
where:
:- solver type foo(T).
:- solver type bar.
* the current initialisation strategy is fairly ad-hoc anyway; in particular
it has a tendency to unnecessarily change the determinism of procedures.
* mode error messages are often quite poor because of the interaction between
automatic initialisation and impure code.
* automatic initialisation is not used in practice. All of the
G12 solver libraries that use solver types recommend explicitly
initialising solver variables.
This change removes support for automatic solver initialisation from the
language. The code for supporting it remains in the implementation, but
it is now dependent upon the developer-only `--solver-type-auto-init'
option.
As a transitional measure the compiler will still accept
`initialisation is ...' attributes in solver type definitions even when
`--no-solver-type-auto-init' is enabled. After this change has bootstrapped,
and the relevant updates have been made to the G12 solver libraries, this
will be changed so that `initialisation is ...' attributes are considered
a syntax error unless `--solver-type-auto-init' is enabled.
doc/reference_manual.texi:
Document that solver type definitions no longer allow initialisation
predicates to be supplied. (The section documenting initialisation
predicates has been commented out rather than deleted since the
implementation of automatic initialisation still exists.)
Remove the section documenting the restrictions on polymorphic
solver types. These restrictions no longer apply in the absence
of automatic initialisation.
compiler/options.m:
Add a new developer-only option, `--solver-type-auto-init', that
controls whether automatic initialisation of solver variables is
allowed (for those solver types that have initialisation predicates
specified.)
compiler/prog_data.m:
Add a type that represents whether a solver type allows automatic
initialisation or not.
Extend the solver_type_details structure to allow initialisation
predicates to be optional.
compiler/prog_io.m:
Allow initialisation predicates to be optional in solver type
definitions.
compiler/modes.m:
compiler/modecheck_call.m:
compiler/modecheck_unify.m:
Only insert calls to solver type initialisation predicates if
the solver type has an initialisation predicate and the
developer-only option `--solver-type-auto-init' is enabled.
compiler/unify_proc.m:
Handle the situation where a solver type does not have an
initialise predicate.
compiler/add_special_pred.m:
Only add initialisation special predicates for those solver
types whose definition provides an initialisation predicate.
compiler/mode_info.m:
Add a utility predicate that tests whether the support for
automatic solver type initialisation is enabled.
compiler/type_util.m:
Add a predicate that tests whether a type is a solver type
that supports automatic initialisation.
Add an XXX comment about such types and abstract equivalence
types.
compiler/mercury_to_mercury.m:
Conform to the above changes.
compiler/special_pred.m:
Fix some typos.
samples/solver_types/eqneq.m:
Delete the `initialisation is ...' from the definition of the solver
type eqneq/1.
tests/hard_coded/Mercury.options:
Enable `--solver-type-auto-init' for the solver_construction_init_test
test.
tests/hard_coded/solver_build_call.m:
tests/invalid/any_pass_as_ground.m:
Don't use automatic solver variable initialisation in these
test cases.
tests/invalid/partial_implied_mode.err_exp:
Conform to the above changes in the mode analyser.
tests/valid/Mercury.options:
Compile some tests cases with `--solver-type-auto-init' enabled.
samples/tests/c_interface/cplusplus_calls_mercury/Mmakefile:
Re-add this file from a recent workspace. The version in the repository
had been truncated.
Estimated hours taken: 0.2
Branches: main
Make it easier to build the stand-alone interface example in different grades.
samples/c_interface/standalone_c/Makefile:
Add a variable to set the option for setting the grade to build
the example in.
Estimated hours taken: 0.5
Branches: main
Fix some bitrot in one of the samples.
samples/calculator2.m:
Conform to changes in the ops and term standard library modules.
Estimated hours taken: 8
Branches: main
Add an example of how to use a stand-alone interface to the samples.
samples/c_interface/standalone_c/Makefile:
samples/c_interface/standalone_c/c_main.c:
samples/c_interface/standalone_c/c_main.exp:
samples/c_interface/standalone_c/mercury_lib.m:
New files. An annotated example of how to use a stand-alone interface.
samples/c_interface/README:
Mention the new example.
Estimated hours taken: 0.5
Branches: main
Merge late changes from the 0.13 branch onto the main branch.
BUGS:
Merge in additions from the 0.12(!) branch.
HISTORY:
Fix typos and be more consistent about the formatting of dates.
NEWS:
Move the news about checking inst declarations for consistency
with visible type constructors to the post-0.13 news where it belongs.
Merge changes to the 0.13 branch.
README.Solaris:
Merge changes from the 0.13 branch.
compiler/notes/todo.html:
Merge changes from the 0.13 branch.
doc/user_guide.texi:
Merge changes from 0.13 branch related to trace counts
documentation.
extras/curses/sample/smalltest.m:
extras/gator/genotype.m:
extras/references/tests/ref_test.m:
samples/rot13/rot13_ralph.m:
tests/mmc_make/complex_test.m:
tests/mmc_make/lib/complex.m:
Merge minor fixes from the 0.13 branch.
Estimated hours taken: 1
Branches: main, release
Prepare for the 0.13 release and fix/update documentation.
NEWS:
HISTORY:
Update the NEWS and HISTORY files for the 0.13 release.
RELEASE_NOTES:
s/0.12/0.13/
Add Linux/x86_64 to the list of architectures supported by this
release.
Remove Solaris 8/x86 from the same list.
.README.in:
extras/README:
Remove references to the clp(r) binding. We no longer support it.
bindist/bindist.README:
Update the year in the copyright message.
Fix the gc version; 0.13 uses 6.5.
BUGS:
README.DotNet:
README.Java:
README.gcc-backend:
doc/faq.texi:
doc/make_manpage:
doc/mercury.html.in:
doc/mercury.info.in:
s/.cs.mu.oz.au/.csse.unimelb.edu.au/
library/array.m:
library/builtin.m:
library/eqvclass.m:
library/graph.m:
samples/README:
Fix typos.
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
Branches: main
samples/c_interface/simpler_c_calls_mercury/mercury_lib.m:
samples/c_interface/simpler_cplusplus_calls_mercury/mercury_lib.m:
Update these files to conform to the current version of the
standard library.
Estimated hours taken: 4
Branches: main
Move the all-solutions predicates from the library module std_util into their
own module, solutions.
Move semidet_fail, semidet_succeed, cc_multi_equal and dynamic cast from
std_util.m into builtin.m.
Add some more utility functions for performing determinism or purity casts.
(The later are primarily intended for use by solver implementors.)
library/std_util.m:
Move the all-solutions predicates into their own module, solutions.m.
For now there are (obsolete) forwarding predicates from this module to
the new one. The forwarding predicates will be included in the
upcoming 0.13 release and then removed in later versions.
Move semidet_succeed, semidet_fail, cc_multi_equal and dynamic_cast
to builtin.m
library/solutions.m:
New file. This is the new home for the all-solutions predicates.
This is pretty much cut and pasted from std_util (with module
qualifiers updated accordingly). I've rearranged the code in a more
top-down fashion as per our current coding standard.
library/builtin.m:
Move semidet_fail/0, semidet_succeed/0, cc_multi_equal/2 and
dynamic_cast/2 to this module.
Add semidet_true/0 and semidet_false/0 as synonyms for semidet_fail/0
and semidet_succeed/0.
Add impure_true/0 and semipure_true/0. These are useful for performing
purity casts, e.g. in solver implementations.
library/library.m:
Add the new module.
NEWS:
Announce the changes.
library/*.m:
Update to conform to the above.
compiler/const_prop.m:
Update evaluate_semidet_call/5 with the new module name for
dynamic_cast.
compiler/*.m:
Module qualify calls to solutions to either disambiguate them from the
versions in std_util (where they weren't module qualified) or change
the module qualifier where they were (to avoid warnings about calls to
the now deprecated versions).
tests/debugger/declarative/solutions.*:
Rename this module as the name conflicts with the new library module.
tests/debugger/declarative/solns.*:
Renamed version of above (with updated expected output).
tests/debugger/declarative/Mmakefile:
Handle the renamed version of the solutions test.
tests/debugger/all_solutions.m:
tests/debugger/declarative/args.m:
tests/debugger/declarative/library_forwarding.m:
tests/hard_coded/constant_prop_2.m:
tests/invalid/multisoln_func.m:
tests/invalid/one_member.m:
tests/invalid/promise_equivalent_claueses.m:
tests/valid/simplify_bug2.m:
tests/valid/solv.m:
Update to conform to the above changes.
sample/solutions/*.m:
Update to conform to the above changes.
Estimatd hours taken: 0.5
Branches: main
samples/*.m:
Use '.' as the module qualifier instead of '__'.
Use the new foreign language interface.
Fix minor formatting issues.
Use state variables for passing the I/O state.
Estimated hours taken: 1.0
Branches: main and 0.12
Bring some samples up to date with current coding standards.
samples/calculator.m
samples/calculator2.m
samples/cat.m
samples/e.m
samples/eliza.m
samples/expand_terms.m
samples/hello.m
samples/interpreter.m
samples/sort.m
samples/ultra_sub.m
Bring up to date with current coding standards.
Estimated hours taken: 0.5
Branches: main
samples/solutions/n_solutions.m:
New file, showing how to compute the first N solutions of a
nondeterministic predicate.
Estimated hours taken: 0.1
Branches: main
Get the simpler "C++ calls Mercury" sample working again.
samples/c_interface/simpler_cplusplus_calls_mercury/main.cc:
s/mercury_lib.h/mercury_lib.mh/
samples/c_interface/simpler_cplusplus_calls_mercury/Mmakefile:
Link in -lstdc++, since recent versions of GNU C++ require this.
Delete most of the mentions of mercury_lib.h, since they
are now handled automatically by Mmake.
s/mercury_lib.h/mercury_lib.mh/
Estimated hours taken: 0.1
Branches: main
Get the simpler "C calls Mercury" sample working again.
samples/c_interface/simpler_c_calls_mercury/main.c:
samples/c_interface/simpler_c_calls_mercury/Mmakefile:
s/mercury_lib.h/mercury_lib.mh/
samples/c_interface/simpler_c_calls_mercury/Mmakefile:
Delete most of the mentions of mercury_lib.h, since they
are now handled automatically by Mmake.
Estimated hours taken: 0.1
Branches: main
Get the "C calls Mercury" sample working again.
samples/c_interface/c_calls_mercury/c_main.c:
samples/c_interface/c_calls_mercury/Mmakefile:
s/mercury_lib.h/mercury_lib.mh/
samples/c_interface/c_calls_mercury/Mmakefile:
Delete most of the mentions of mercury_lib.h, since they
are now handled automatically by Mmake.
Estimated hours taken: 0.5
Branches: main
Get the "C++ calls Mercury" sample working again.
samples/c_interface/cplusplus_calls_mercury/cpp_main.cc:
s/mercury_lib.h/mercury_lib.mh/
samples/c_interface/cplusplus_calls_mercury/Mmakefile:
Link in -lstdc++, since recent versions of GNU C++ require this.
Delete most of the mentions of mercury_lib.h, since they
are now handled automatically by Mmake.
s/mercury_lib.h/mercury_lib.mh/
Estimated hours taken: 0.25
Branches: main
Fix a bug where the Mercury calls C++ sample was not linking with the
C++ library. This worked, because the sample didn't actually make use
of the C++ library, but failed as soon as users tried to extend the
sample to use with their real C++ programs.
samples/c_interface/mercury_calls_cplusplus/cpp_main.cc:
Use the C++ standard library's stream I/O, rather than printf().
samples/c_interface/mercury_calls_cplusplus/Mmakefile:
Make sure that we link with the C++ standard library.
Also, comment out the old hack that worked around a g++ 2.7 bug
which is fixed in g++ 2.95.
Estimated hours taken: 0.25
Branches: main
Fix a bug where the Mercury calls C++ sample was actually using C, not C++.
samples/c_interface/mercury_calls_cplusplus/cpp_main.c:
samples/c_interface/mercury_calls_cplusplus/cpp_main.cc:
Rename cpp_main.c as cpp_main.cc, so that it gets compiled as C++
code rather than as C code. Add a dummy class declaration to its
source, to check that it is really C++ code.
Estimated hours taken: 6
Branches: main
Fix a performance bug where dead_pred_elim was taking a significant
amount of time to delete entries from the predicate_table. With this
change dead_pred_elim goes from 12 minutes to 55 seconds CPU time in
the IL grade when compiling accumulator.m with
--intermodule-optimization turned on.
compiler/hlds_module.m:
Implement a new predicate, predicate_table_restrict, which
restricts the predicate_table to include only a subset of the
predicates.
Rather than deleting all the non-needed entries, this
predicate builds the predicate_table from scratch again, hence
this predicate is only useful when the number of predicates to
keep is significantly less than the number of predicates to
delete.
Change predicate_table_do_insert so that it records in the
pred_info whether or not a predicate can only be accessed by
its fully qualified name, this is needed so that the
predicate_table can be rebuilt correctly.
compiler/dead_proc_elim.m:
Use predicate_table_restrict to restrict the set of pred_ids
in the predicate_table rather than module_info_remove_predicate
as the amount of predicates to keep is in general
significantly smaller than the number of predicates to keep.
compiler/hlds_pred.m:
Add a new pred_marker which indicates whether or not a
predicate can only be accessed by its fully qualified name.
compiler/hlds_out.m:
compiler/intermod.m:
Handle the new pred_marker.
Estimated hours taken: 3
Branches: main
Various fixes for the .NET back-end.
compiler/Mmakefile:
For IL grades, use editbin to set the stack size to 100M,
since the default (1M) is too small.
Also, don't try to build mlds_to_gcc in IL grades -- gcc.m won't
compile, because the IL grades don't support the C interface.
library/Mmakefile:
Add some missing dependencies.
profiler/Mmakefile:
deep_profiler/Mmakefile:
Conditionalize some dependencies that were bogus for IL grades.
library/.cvsignore:
compiler/.cvsignore:
profiler/.cvsignore:
deep_profiler/.cvsignore:
analysis/.cvsignore:
browser/.cvsignore:
samples/.cvsignore:
Various minor updates to ignore files produced when building in
IL grades.
Estimated hours taken: 0.25
Branches: main
Simplify the simpler_c_calls_mercury and
simpler_cplusplus_calls_mercury samples to
avoid explicit construction of the `ml' command line.
samples/c_interface/simpler_c_calls_mercury/c_main.c:
Renamed as main.c.
samples/c_interface/simpler_cplusplus_calls_mercury/cpp_main.cc:
Renamed as main.cc.
samples/c_interface/simpler_c_calls_mercury/c_main.m:
samples/c_interface/simpler_cplusplus_calls_mercury/cpp_main.m:
Empty main modules, used to set the name executable
produced by mmake.
samples/c_interface/simpler_cplusplus_calls_mercury/Mmakefile:
samples/c_interface/simpler_c_calls_mercury/Mmakefile:
Handle file renamings.
Remove explicit rules to build executables.
Remove unnecessary header file dependencies.