lots of files:
Make a start at implementing code generation for complicated
unifications. In the HLDS, change complicated_unify/4 to
complicated_unify/2 since we didn't need the extra two args
after all.
peephole.nl:
A couple of minor efficiency improvements.
queue.nl:
Add queue__queue_to_list/2.
hlds_out.nl:
Minor improvements to the output.
code_info.nl, type_util.nl:
Change make_type_id to fail rather than call error/1
if the type is not valid.
undef_types.nl:
Report invalid types.
mode_util.nl:
Add a new pred `type_constructors'.
modes.nl:
Detect determinism of deconstruction unifications properly,
using the type information.
code_info.nl:
Tidy up the code for code_info__cons_id_to_tag.
prog_io.nl, mode_util.nl, mercury_to_mercury.nl:
Add new inst `free(Type)' and new inst_names `typed_ground(Type)'
and `typed_inst(Type, Inst)' so that we can propagate type
information through the mode system.
Do some of the work necessary to propagate type info to modes.
type_util.nl:
Add an extra output argument to type_to_type_id so that it can
return the type's arguments; also fix a determinism error in
type_to_type_id.
hlds.nl:
Add a comment.
list.nl:
Fix the determinism annotation for same_length.
map.nl:
Add map__apply_to_list.
mode_info.nl:
Add mode_info__get_types_of_vars.
Makefile.mercury:
Fix the definition of MERCC.
hlds.nl:
For each discriminated union type, store the tags for the
constructors for that type, and store whether
or not the type is an enumeration type.
make_hlds.nl, make_tags.nl:
Added a new file `make_tags.nl' which is caled from make_hlds.nl
to computes the above info.
type_util.nl:
In type_is_enumeration, use the flag stored in the HLDS rather
than recomputing it on demand.
undef_types.nl:
Minor change to match the changes in hlds.nl.
mercury_compile.nl:
Ensure that foo.err depends on foo.nl.
Dump the hlds before liveness analysis as well as after
compilation (this is probably just a temporary hack).
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.
interpreter.nl:
Fix bug in mode declaration.
hlds.nl, mercury_to_mercury.nl:
Fix mode error in mercury_to_mercury.nl.
modes.nl:
Fix bug in handling of `erroneous' preds.
Fix a bunch of other errors including some mode errors.
prog_io.nl:
Fix type error introduced by last change.
Fix mode error in DCG expansion code.
type_util.nl:
Work around scoping problem with \=.
typecheck.nl:
Fix mode error.
prog_io.nl:
- Add a new inst `not_reached' (intended for internal use by the
compiler, but for the moment at least we also allow it in user
code).
- Parse abstract inst definitions, with the syntax
:- inst foo is private.
type_util.nl, typecheck.nl, codegen.nl, Makefile, doit.nl:
- Add a new module `type_util'.
- Move make_type_id from typecheck.nl to type_util.nl.
- Rename vartype_to_type as classify_type, move it from
codegen.nl to type_util.nl, and modify the interface slightly.
- Move the type_is_enumeration stub from codegen.nl to type_util.nl,
and implement it.
- Implement type_is_atomic.
modes.nl:
- Distinguish between simple_unify's and complicated unifies by
calling type_is_atomic.
- Check that the final insts of the head vars match that specified
by the mode declaration.
- Handle (some cases of) unreachable code, using the `not_reached'
inst. More work needed on this.
- Improve the error message in the case where there is a single
delayed goal in a conjunction. (Instead of printing out the
generic "mode error in conjunction" message, we now print out
the error message for the delayed goal in question.)
- Fix bug where it didn't realize that bound('.'(ground, ground))
was the same as ground (due to missing clauses for inst_is_compat_3).
Most of these changes have not yet been tested.