compiler/*:
Add copyright messages.
Change all occurences of *.nl in comments to *.m.
compiler/mercury_compile.pp:
Change the output to the .dep files to use *.m rather than *.nl.
(NOTE: this means that `mmake' will not work any more if you
call your files *.nl!!!)
code_util.nl:
Fix bug in make_proc_label: for unification predicates,
look at the _last_ argument to determine the type for
name mangling, not the first, since we introduce extra
higher-order arguments at the start.
make_hlds.nl, hlds.nl:
Ensure that the proc_info head_vars has the right length even for
imported predicates. This fixes a problem with --polymorphism.
make_hlds, unify_proc.nl, prog_util.nl:
Output unification procedures for equivalence types.
polymorphism.nl:
Ensure that this works even for unification procedures for
equivalence types, which are a bit wierd since they are not
quite type correct.
typecheck.nl:
Don't attempt to typecheck unification predicates, since
they are already type-correct when we construct them.
In particular don't typecheck unification procedures for
equivalence types, since it would report a spurious error.
mercury_to_mercury.nl:
Remove a superfluous duplicate clause.
term.nl:
In term__create_var, use bit reversals rather than random numbers
to ensure that the binary trees remain balanced.
call_gen.nl:
For polymorphic unifications, generate a call to fatal_error().
code_gen.nl, hlds.nl, make_hlds.nl, modes.nl, unify_proc.nl:
Move the unify_request data structure from code_info to the HLDS,
and move the unify_request handling from code_gen.nl to modes.nl.
This is because we now generate HLDS code rather than LLDS code
for complicated unifications.
code_util.nl, hlds_out.nl:
Do some special name mangling for =/2.
float.nl, typecheck.nl, undef_types.nl, term.nl, hlds.nl:
Until we implement `float' properly, define it as an abstract type
in float.nl.
hlds.nl, make_hlds.nl:
Rename `local_pred, imported_pred, exported_pred' to just
`local, imported, exported' since they also apply to types, etc.,
not just to preds.
mercury_compile.pp, mercury_to_goedel.nl, prog_util.nl:
Replace to goedel__ prefixes in prog_util.nl with prog_util__.
std_util.nl:
Change the code for semidet_succeed to avoid determinism warning.
Makefile.mercury:
Override the MERCURY_LIB_OBJS variable when invoking ml.
This avoids some bootstrapping problems.
Also, add mercury_compile.nu.
Makefile.common:
Bump NU-Prolog's -u option up to 2000 (8M), to avoid some memory
problems.
array.nl, bintree.nl, char.nl, dir.nl, globals.nl, list.nl, map.nl, modes.nl,
prog_util.nl, stack.nl, std_util.nl, string.nl, term.nl:
Avoid the use of implied modes.
code_info.nl, bimap.nl, make_hlds.nl, mercury_compile.nl,
mercury_to_mercury.nl, unify_proc.nl:
Fix determinism errors which had previously not been discovered
because of either implied modes or running out of memory.
(Note that I had to change the interface to bimap__lookup, since
it's not possible to make it bidirectional.)
code_util.nl, llds.nl, opt_debug.nl, value_number.nl:
Rename `operator' as `binary_op'.
hlds.nl, code_info.nl, unify_gen.nl, llds.nl, opt_debug.nl, switch_gen.nl:
*** Handle simple cases of higher-order pred terms. ***
(We don't yet handle taking the address of an overloaded
predicate or a predicate with multiple modes.
We don't handle closures. call/1 and call/N are not yet implemented.
This has not yet been tested.)
make_hlds.nl:
Modify the mode priority ordering so that semidet modes get
selected before det ones.
llds.nl:
Don't include the priority part of the mode number in the mangled
label name. *** Note: this will break some things! ***
mercury_compile.nl:
Move the NU-Prolog hacks into mercury_compile.nu.nl.
switch_gen.nl:
Fix a simple logic bug in handling the grab/slap of the code_info.
prog_io.nl, builtins.nl, int.nl:
Fix bugs and omissions with handling of the new arithmetic operators.
prog_io.nl:
As a quick hack, strip off calls to io__gc_call
(this avoids spurious error messages which are due to
the fact that we don't get mode analysis right in those cases).
bintree.nl, map.nl, varset.nl:
Remove map__search_insert; it's not needed and it's not
really useful.
bintree.nl:
Fix determinism problem in bintree__from_list_2.
options.nl, det_analysis.nl, make_hlds.nl:
Add options to suppress determinism warnings.
det_analysis.nl, hlds.nl, modes.nl:
Allow the delta-instmap to be `unreachable'.
hlds_out.nl:
Output the delta-instmap.
Output conjunctions differently in verbose mode.
llds.nl:
Fix determinism problem.
Change GOTO(LABEL(...)) into GOTO_LABEL(...) which can be
more efficient.
map.nl:
Add map__overlay/3.
typecheck.nl, modes.nl, mode_errors.nl, options.nl, hlds_out.nl.
Split the old `debug' option into debug-types and debug-modes.
Change the default for the `modecheck' option to `yes'.
Add a new verbose-dump-hlds option, and use that instead
of the very-verbose option in hlds_out.nl.
mode_util.nl:
Export mode_get_insts/4.
Add instmap_lookup_var (moved from modes.nl).
Add apply_instmap_delta.
modes.nl, term.nl, prog_util.nl:
Add determinism annotations.
term.nl, prog_io.nl:
Fix bugs in when declarations.
std_util.nl, prog_io.nl:
Add a maybe(T) type to std_util.nl.
Rename the maybe(T) type in prog_io.nl as maybe1(T).
mercury_builtin.nl:
Use det_pred(...), semidet_pred(...), nondet_pred(...)
rather than call_pred(...) for the higher-order predicate modes.
prog_io.nl, io.nl, varset.nl, etc.
Add determinism annotations.
hlds.nl, make_hlds.nl, LOTS of other files:
Reorganize the way the predicate table works.
Make hlds.nl a bit more modular.
Change call/4 to call/5.
Remove all/2 from the hlds.
Changed pred_id to an integer.
Added pred_call_id which is similar to the old pred_id.
Makefile:
Add a rule for creating *.hlds_dump.
array.nl:
Fix determinism error.
det_analysis.nl:
Fix a bug in printing determinism warnings.
fix_errors.sed:
Modify this so it allows all the `inferred nondet' determinism
errors but none of the `inferred semidet' ones.
llds.nl:
Rename llds__pred_mode_id as llds__proc_id.
mode_errors.nl:
Finally got around to implementing Zoltan's suggestions
about the error messages from the mode analysis.
If an error occurs in a conjunction, only one error message
is printed out - the first error which doesn't relate to
a head unification.
modes.nl:
Handle X = f(X) properly. NB: determinism analysis and code
generation still get it wrong!
undef_modes, undef_insts:
I've broken the error message code, since it's not easy
to print pred_ids. I just changed it so that it didn't
print the pred_ids out. Should fix this properly at some stage...
modes.nl, mode_errors.nl, delay_info.nl, mode_info.nl, undef_modes.nl:
Break modes.nl up into separate modules.
toplevel.nl (plus LOTS of other files):
Change the way module imports are handled. Fix the resulting missing
import problems found in most of the modules.
mode_util.nl:
Add predicate inst_is_bound_to_functors/3.
switch_detection.nl:
New file. Still very incomplete.
meta.nl:
Remove. This file was old junk.
make_hlds.nl:
Fix bugs in the implicit quantification.
Makefile, doit.nl:
Add stack.nl.
det_analysis.nl:
Fix minor bug in the error message.
interpreter.nl:
Print out the answers to the query.
mercury_to_mercury:
Added mercury_output_hlds_goal.
Also export mercury_output_vars.
modes.nl:
Handle reordering of conjunctions.
Handle variable locking in all cases.
(Complete, but probably needs some bug fixes.)
prog_util.nl:
Fix another goddamned bug in the type-checker - I thought
we'd killed the last of those! This one was a problem
in the expansion of equivalence types - failed for map(map(...)).
prog_io.nl:
An error message was omitting the file name & line number.
Also ensure that all error messages start with "error:".
codegen.nl, interpreter.nl, bintree.nl, list.nl:
Fix stuff detected by nit.
make_hlds.nl:
Transform to `semi-homogeneous' form (still need to expand
unifications).
prog_util.nl:
Fix bug.
mercury_builtin.nl:
Add call/1.
hlds.nl:
Add a count of the number of errors and warnings to the module_info
data structure.
toplevel.nl:
Continue processing after syntax errors.
varset.nl:
Added predicate varset__vars.
term.nl:
Added predicate term__vars_list.
typecheck.nl:
Implement two previously unimplemented parts of the typechecker:
detect attempts to instantiate type variables which occur in
the predicate's type declaration, and detect any failure to
bind all other type variables. (That was the last two;
apart from
prog_util.nl:
Fix problem where the expansion of equivalence types was
introducing fresh variables into the type varset, which caused
problems in relation to the above changes to typecheck.nl.
hlds_out.nl:
Fix typo in type declaration (found by above fixes to typechecker).
options.nl:
Fix bug in type definition introduced by last change.
make_hlds.nl:
Add a missing pred & mode declaration.
modes.nl:
Don't display the verbose messages unless the very-verbose
flag was specified.
prog_util.nl:
Changed if-then-else to -> ;
string.nl:
Changed if-then-else to -> ;
term.nl:
Changed if-then-else to -> ; and added an XXX in term__context_init
varset.nl:
Changed if-then-else to -> ;
modes.nl:
New file. At the moment it just checks for undefined modes and
undefined insts.
Makefile, doit.nl:
Add new files modes.nl and prog_util.nl.
term.nl:
Add term__var_to_int.
toplevel.nl:
Call the mode checker.
prog_io.nl, make_hlds.nl, hlds.nl:
Allow for the possibility of abstract `inst' definitions,
just like abstract type definitions. Currently they
are allowed for in the data structure, but they aren't
parsed correctly, and the utilities in hlds.nl don't handle
them that well.
hlds.nl:
Move `unqualify_name' to prog_util.nl.
make_hlds.nl:
Move `split_types_and_modes' to prog_util.nl.
mercury_to_goedel.nl, toplevel.nl:
Move the equivalence type expansion code to prog_util.nl.
builtin.nl, toplevel.nl:
Add a new module `builtin.nl' which gets automatically imported
into every module. In it, define the standard modes input,
output, etc., and various other stuff.
std_util.nl:
Move the defintion for \= to builtin.nl.
Remove the definition of ~=.
prog_io.nl:
Export parse_goal/2, since it's used by mercury_to_goedel.
mercury_to_goedel.nl:
Fix various type errors.
list.nl, int.nl, io.nl, codegen.nl, det_analysis.nl, llds.nl, hlds_out.nl:
Fix various syntax errors, typos and errors in type and mode
declarations discovered by mercury_compile.