Estimated hours taken: 1.5
Undo dylan's changes in the names of some library entities,
by applying the following sed script
s/term_atom/term__atom/g
s/term_string/term__string/g
s/term_integer/term__integer/g
s/term_float/term__float/g
s/term_context/term__context/g
s/term_functor/term__functor/g
s/term_variable/term__variable/g
s/_term__/_term_/g
s/std_util__bool_/bool__/g
to all the `.m' and `.pp' files in the compiler and library directories.
The reason for undoing these changes was to minimize incompatibilities
with 0.4 (and besides, the changes were not a really good idea in the first
place).
I also moved `bool' to a separate module.
The main reason for that change is to ensure that the `__' prefix is
only used when it genuinely represents a module qualifier.
(That's what dylan's changes were trying to acheive, but `term__'
does genuinely represent a module qualifier.)
compiler/*.m:
Apply sed script above;
where appropriate, add `bool' to the list of imported modules.
Estimated hours taken: _2___
Change names with badly placed double underscores (ie where the part of
a name before a double underscore is not the same as the module name.)
Reflect changes in the library interface.
compiler/*:
Use the newer, more correct form of the term and bool names.
Predicates "bool__" are now "std_util__bool" and labels of
the term ADT are now "term_" instead of "term__".
compiler/vn*.m:
change all names "vn__*" to a correct module prefix. All the
names remain qualified.
compiler/hlds.m:
s/\<is_builtin__/hlds__is_builtin_/g
s/\<dependency_info__/hlds__dependency_info_/g
compiler/unify_proc.m:
s/\<unify_proc_info__/unify_proc__info_/g
compiler/transform.m:
s/\<reschedule__conj/transform__reschedule_conj/g
-------------------------------------------------------
Implement unique modes. We do not handle local aliasing yet, so this
is still not very useful, except for io__state. Destructive update is
not yet implemented. Also note that this really only implements
"mostly unique" variables that may be non-unique on backtracking - we
don't check that you don't backtrack over I/O, for example.
prog_io.m, mode_util.m, modes.m, inst_match.m:
Major changes to Handle unique modes.
mercury_to_mercury.m, polymorphism.m, prog_out.m, undef_modes.m:
Use `ground(Uniqueness)' rather than just `ground'.
compiler/*.m:
Fix compile errors now that unique modes are enforced: add a
few calls to copy/2, and comment out lots of unique mode
declarations that caused problems.
typecheck.m, mode_info.m:
Hack around the use of unique modes, which doesn't work
because we don't allow local aliasing yet: make the insts
`uniq_type_info' and `uniq_mode_info' not unique at all,
and add a call to copy/2 when extracting the io_state from
type_info or mode_info.
-------------------------------------------------------
Plus a couple of unrelated changes:
hlds.m:
Change the modes for the special predicates from `ground -> ground'
to `in', so that any error messages that show those modes
come out looking nicer.
Add a new shared_inst_table for shared versions of user-defined
insts.
mercury_to_goedel.m:
Use string__is_alnum_or_underscore.
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!!!)
*.nl:
Replace all occurrences of `not(Vars, Goal)' with just
plain `not(Goal)'.
type_util.nl, switch_gen.nl:
Higher-order pred types are not user-defined types.
Add a `predtype' type category for them.
call_gen.nl:
Change call_closure/2 to call_closure/3 (with liveinfo).
Plus a little bit of random hacking.
Makefile*:
Add some more stuff for compiling to .o
Makefile*, mercury_compile*, code_gen*:
Add some stuff for handling `.pp' files.
`.pp' files are Mercury source code containing
NU-Prolog hacks inside
#if NU_PROLOG
...
#endif
These hacks are preprocessed out (using sed, not cpp)
except when compiling with `mnc'.
term_io.nl, term_io.nu.nl, interpreter.nl, prog_out.nl:
Make sure all the predicates in term_io.nl are
prefixed with `term_io__', not `io__'.
term_io.nl, require.nl:
Add some `external' declarations.
call_gen.nl, unify_gen.nl:
A temporary hack - generate incorrect code for complicated/polymorphic
unifications, rather than aborting.
random.nl:
Make the code more efficient.
hlds.nl, term.nl:
Allocate pred_ids and variable numbers randomly rather than
sequentially, so that the binary trees remain reasonably balanced.
code_info.nl, unify_gen.nl, hlds_out.nl:
Generate informative comments for tag tests: say the name of
the variable being tested, and which constructor we are testing for.
llds.nl:
Cast field() expressions to (int) when used as rvals, so
that comparisons work as expected.
make_hlds.nl:
Improve error reporting.
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.
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.
toplevel.nl, mercury_to_goedel.nl, hlds.nl:
move unqualify_name/2 to hlds.nl.
typecheck.nl: Fix design problem with typevarsets; fix bug where I had
forgotten to rename apart the types for constructors.
prog_io.nl, prog_out.nl: improve error messages.
various: inlined calls to require/2 to improve efficiency.
various: added an extra arg to io__progname to specify the default
in case the program name isn't available.
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.
prog_out.nl: remove various bits of crud and clean it up a little.
hlds.nl: add some stuff needed by typecheck.nl
typecheck.nl: did a bit more work on this.
renamed module.nl as toplevel.nl and also rewrote it using stuff
from mercury_to_goedel.nl.
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.
where the error occurred.
Note that line numbers are still not stored in the hlds yet, so
we need to do some more work so that the typechecker, etc. can also
report line numbers.
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.