code_util.nl, float.nl, llds.nl, mercury_builtin.nl, opt_debug.nl,
parser.nl, polymorphism.nl, sp_lib.nl, string.nl, string.nu.nl,
type_util.nl, typecheck.nl, unify_gen.nl:
Implement floating point.
Makefile.common:
Remove `-include test.dep' line. Use Mmake.
int.nl:
Update a few of the comments.
io.nu.nl:
For Sicstus Prolog, if main/2 is not defined then enter the
debugger.
char.nl:
Add char__is_{hex,octal,binary}_digit.
string.nl:
Add declaration and stub implementation for
string__base_string_to_int.
io.nl, io.nu.nl:
Implement io__putback_char (not very efficiently).
mercury_builtin.nl:
Add a declaration for cut.
mercury_compile.pp:
Suppress singleton variable warning.
prog_io.nl:
In DCG expansion, when appending unifications to disjunctions
propagate them into each disjunct, so that we don't stuff up
switch detection.
Makefile.common:
Various minor bugfixes.
Makefile.mercury:
Add rules for creating assembler (.s) files.
term.nl, *.nl:
Replace term__context_init/1 with term__context_init/0.
The first argument was always zero anyway.
io.nl:
Change the interface to io__read_char and io__read_line so that
they return a better error indicator.
Add a new predicate io__putback_char.
polymorphism.nl:
Don't abort if a predicate doesn't have any modes.
options.nl:
Let's try turning polymorphism on again. It seems to work this time.
string.nl, string.nu.nl:
Add string__to_float.
Move implementation of string__to_int from string.nl to string.nu.nl.
Makefile.common, Makefile.mercury:
Add a couple of things for compiling the compiler to .o files.
prog_io.nl:
Fix bug in DCG expansion of ( { ... } -> { ... } ; ... ).
prog_io.nl, hlds.nl, make_hlds.nl,
nc_builtin.nl, np_builtin.nl, swi_builtin.nl:
Implement a new `:- external(Pred/Arity)' declaration,
for predicates which are defined elsewhere, e.g. in some
other language.
int.nl, io.nl, std_util.nl, string.nl:
Use the new `external' declaration.
llds.nl:
Ouput the module name as mercury__xxx_module rather than
just xxx_module. (This avoids a name clash between code/io.mod
and compiler/io.mod).
typecheck.nl:
Avoid using implied modes.
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).
call_gen.nl:
Make the handling of builtins a little more general.
code_info.nl, unify_gen.nl:
Use code_info__get_next_label_number rather than
the lower-level routines code_info__get_label_count
and set_label_count.
code_util.nl:
Rame atom_to_operator as code_util__atom_to_binop
and add code_util__atom_to_unop.
prog_io.nl, code_util.nl, llds.nl, int.nl, opt_debug.
Add bitwise operators.
Add array_index binary operator.
Add hash_string unary operator.
Add int__log2 predicate.
Cast operands to (int) in llds.nl, so that we
get integer comparisons and integer operations.
string.nl:
Add string__hash predicate.
interpreter.nl:
Use disjunction in semidet preds.
options.nl:
Add --smart-indexing option (enabled by default).
switch_gen.nl:
**** Generate a hash table lookup for string switches. ****
io.nu.nl, mercury_compile.nl:
Add a default definition of main_predicate/3 in io.nu.nl,
which just calls the NU-Prolog command loop.
Change the way mercury_compile.nl generates the .dep files
so that io.nu.nl will get linked in before the users files,
so that their main_predicate (if any) will override the
one in io.nu.nl.
Makefile.common:
Add an entry to copy the linked NU-Prolog library, which
now starts up with the NU-Prolog command loop, to the
installation directory for use by the `mnp' script.
code_gen.nl, llds.nl, string.nl:
Add some code to put a description of the stack slot usage
as a comment at the start of each procedure prolog.
library.nl, mode_util.nl:
Add some comments.
dir.nl:
Add a new library module for file and directory name handling.
string.nl, list.nl:
Add a bunch of new preds.
code_info.nl:
list__nth_member_lookup has been renamed list__index1_det.
io.nu.nl:
Change io__progname so that it uses the new dir__basename.
prog_io.nl:
Fix the type error left in my last change to prog_io.nl.
Change a few XXX comments, since the things they comment
about are wishlist items, not XXX-level problems.
ite_gen.nl, code_info.nl:
Fix determinism problem.
hlds.nl, hlds_out.nl, det_analysis.nl:
Remove the unused `declared_determinsm' field in the goal_info.
Rename the `inferred_determinism' field as just `determism'.
Add a new field `local_determinism'. In det_analysis.nl,
Plug the contents of the new `local_determinsm' field in the goal_info
into the computation of the determinism for each goal.
det_analysis.nl, fix_errs.sed:
For the cases which we currently don't handle correctly,
generate incorrect code in preference to generating spurious
error messages (we still have to handle these cases sometime,
but this means that we can deal with them one at a time).
arg_info.nl, builtins.nl, code_gen.nl, delay_info.nl, det_analysis.nl,
getopt.nl, globals.nl, make_hlds.nl, modes.nl, mode_util.nl, stack.nl,
string.nl, string.nu.nl, term.nl, undef_modes.nl, varset.nl:
Fix determinism errors uncovered by the changes in the determinism
analysis.
hlds_out.nl:
If --verbose option specified, print out the inferred
determinism for each goal.
Makefile:
Change the rule for making *.hlds_dump to use --verbose.
list.nl:
Add list__remove_suffix (an alternative implementation of
list__append(out, in, in) which is semidet).
string.nl:
Add string__remove_suffix (an alternative implementation of
string__append(out, in, in) which is semidet).
toplevel.nl, mercury_to_mercury:
Call string__remove_suffix instead of string__append.
modes.nl:
Fix bug detected by the determinism analysis.
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...
prog_io.nl, hlds.nl:
Add `arity' as an alias for `int'.
map.nl:
Improve the code for map__merge.
Add map__optimize.
Work-around a bug in the determinism analysis.
make_hlds.nl:
Use map__optimize rather than bintree__balance.
codegen.nl, std_util.nl:
Add a call to `semidet_succeed' in codegen.nl, and
implement that pred in std_util.nl, in an
attempt to suppress a determinism warning.
(The attempt failed, due to an as-yet unknown bug in
the determinism analysis.)
hlds.nl, modes.nl, mode_util.nl, mercury_to_mercury.nl, undef_modes.nl.
Replace the inst table with four tables, one for
user-defined insts, and three for compiler-generated
insts. Modify all the routines dealing with insts to
handle this. Change `inst_merge' in modes.nl to return
a compiler-generated recursive inst if necessary.
term_io.nl:
Fix bugs caused by recent changes to io__xxx_op preds.
Makefile, apply_sed_script, fix_errs.sed:
A quick hack to avoid the spurious determinism errors.
term_io.nl, char.nl, string.nl:
Add a few additional utility preds to string.nl.
Add some more preds to handle quoting to term_io.nl.
Remove the stuff which handled quoting in char.nl.
hlds.nl, mode_util.nl, modes.nl, codegen.nl:
Move the inst/mode related routines from hlds.nl into mode_util.nl.
codegen.nl:
Fix a bug or two.
llds.nl:
Output string constants as `string_const(String, Len)'.
require.nu.nl:
Change the format of the error message slightly.
string.nl:
Add string__length.
char.nl string.nl mercury_to_mercury.nl term_io.nl:
In mercury_to_mercury.nl, avoid quoting strings except when
necessary. Also fix the bug where some operators were not
being put in parentheses when they should be.
typecheck.nl:
Fix a couple of minor things in the error messages.
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 -> ;
that I'm not sure how to fix.
hlds.nl: a couple of minor alterations.
llds.nl: a few changes so that llds expressions can be used in
codegen.nl - a significant fix that gets rid of quite
a bit of weirdness in codegen.
string.nl: added a declaration (but no implementation) for
string__to_int - for use in converting cons_ids for
integer constants to type int.
string.nl, string.nu.nl, Makefile, doit.nl:
Isolate the assumption that strings are just lists
of integers into a new file string.nu.nl, so that
string.nl will type-check properly.
int.nl: bug fix.
hlds.nl: add predicate `predinfo_context'.
hlds_out.nl: lots of misc. changes to get it past the type-checker.
typecheck.nl: improve the error messages a little.
varset.nl: bug fix.
don't warn about :- interface and :- implementation declarations;
write warnings to stderr not stdout.
hlds_out.nl: write out if-then-else's (etc.) correctly.
typecheck.nl: write messages to stderr instead of stdout.
Lots of files: Fix lots of type errors and modularity violations.
Makefile: add new targets `check' and *.err
bintree.nl: modified tree structure slighyl to improve efficiency.
io.nl, io.nu.nl: added predicate io__stream_name and code to keep track
of the name of each stream.
term.nl: store filenames as part of term__context.
prog_out.nl: print out the filename part of a term__context
term_io.nl: initialize the filename when reading in a term
list.nl: add member_chk/2.
various places: replace `integer' with `int'.
did a bit more work on the type-checker. It now runs without crashing,
although the results are still buggy.
toplevel.nl: added code to read in a module and all the modules
that it depends upon.
added code to handle abstract type definitions.
Moved most of the non-logical NU-Prolog code from io.nl and term_io.nl into
io.nu.nl and term_io.nu.nl respectively. Rewrote the rest in logical Mercury.
Modified io__write_term to escape string constants if necessary.
Added char.nl and moved some of the predicates in string.nl into char.nl.
Rewrote some of the predicates in these files to avoid NU-Prolog dependencies.
Added a few new predicates.
Modified mercury_to_goedel.nl to correctly output variable names without
any danger of name clashes. Also modified it to correctly escape string
constants. Also modified it to correctly output functor names even
for nasty functors.
Did a little more work on the typechecker.
Moved the non-logical NU-Prolog code in require.nl into require.nu.nl.
Fix bug in prog_io.nl where combined type-and-mode declarations were
getting reversed.
Modified io.nu.nl and require.nu.nl so that calls to error/1 will
actually cause the program to abort.
In prog_io.nl: allow "\+" as a synonym for "not".
reject them as syntax errors).
- Change predicates in term.nl to use `term__' prefix instead of `term_'.
- Change predicates in string.nl to use `string__' prefix instead of `string_'.
- Change the types in prog_io.nl so that they store determinism
annotations for mode and predicate declarations (the code still needs
to be fixed to parse these new annotations.)
- Add some new predicates to term.nl.
- Did some more work on mercury_to_goedel.nl.
- Various bug fixes.
Lots of bug fixes for make_hlds.nl.
A couple of bug fixes for hlds.nl.
Did some optimization of memory usage: added io__gc_call to io.nl
and used it in prog_io.nl and module.nl. Rewrote the main loop
of prog_io to take maximum advantage of manual garbage collection.
Started working on typecheck.nl.