Commit Graph

10 Commits

Author SHA1 Message Date
Thomas Conway
4af1fb0bb7 Added some [now redundant] fixes to
various:
	Added some [now redundant] fixes to
	complicated unification code.

value_number.*:
	minor bugfix in the interface.
1994-09-05 10:30:13 +00:00
Fergus Henderson
d948aecd92 Make a start at implementing code generation for complicated
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.
1994-09-01 20:31:58 +00:00
Fergus Henderson
534e5c221e Fix lots of determinism problems.
*.nl:
	Fix lots of determinism problems.
1994-07-07 20:16:08 +00:00
Fergus Henderson
c816f8406f Minor improvements to the output.
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.
1994-07-05 05:07:29 +00:00
Fergus Henderson
87e7e3bafa Tidy up the code for code_info__cons_id_to_tag.
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.
1994-07-04 12:34:51 +00:00
Fergus Henderson
a02ee50c30 Fix the definition of MERCC.
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).
1994-06-24 05:25:28 +00:00
Fergus Henderson
8bf2aacf0b Rename a whole bunch of predicates.
*.nl:
	Rename a whole bunch of predicates.
	Apart from some manual changes to list.nl, the changes
	were all generated by applying the following sed script:

/[^a-zA-Z_]goedel_expand(/s/goedel_expand(/prog_util__expand(/g
/[^a-zA-Z_]goedel_replace(/s/goedel_replace(/prog_util__replace(/g
/[^a-zA-Z_]to_upper(/s/to_upper(/char__to_upper(/g
/[^a-zA-Z_]to_lower(/s/to_lower(/char__to_lower(/g
/[^a-zA-Z_]is_upper(/s/is_upper(/char__is_upper(/g
/[^a-zA-Z_]is_lower(/s/is_lower(/char__is_lower(/g
/[^a-zA-Z_]is_alpha(/s/is_alpha(/char__is_alpha(/g
/[^a-zA-Z_]is_alnum(/s/is_alnum(/char__is_alnum(/g
/[^a-zA-Z_]is_alpha_or_underscore(/s/is_alpha_or_underscore(/char__is_alpha_or_underscore(/g
/[^a-zA-Z_]is_alnum_or_underscore(/s/is_alnum_or_underscore(/char__is_alnum_or_underscore(/g
/[^a-zA-Z_]is_digit(/s/is_digit(/char__is_digit(/g
/[^a-zA-Z_]lower_upper(/s/lower_upper(/char__lower_upper(/g
/[^a-zA-Z_]io__op(/s/io__op(/term_io__op(/g
/[^a-zA-Z_]io__current_ops(/s/io__current_ops(/term_io__current_ops(/g
/[^a-zA-Z_]io__read_term(/s/io__read_term(/term_io__read_term(/g
/[^a-zA-Z_]io__write_term(/s/io__write_term(/term_io__write_term(/g
/[^a-zA-Z_]io__write_constant(/s/io__write_constant(/term_io__write_constant(/g
/[^a-zA-Z_]io__write_variable(/s/io__write_variable(/term_io__write_variable(/g
/[^a-zA-Z_]mercury_quote_string(/s/mercury_quote_string(/term_io__quote_string(/g
/[^a-zA-Z_]mercury_quote_atom(/s/mercury_quote_atom(/term_io__quote_atom(/g
/[^a-zA-Z_]mercury_quote_char(/s/mercury_quote_char(/term_io__quote_char(/g
/[^a-zA-Z_]mercury_quote_single_char(/s/mercury_quote_single_char(/term_io__quote_single_char(/g
/[^a-zA-Z_]delay_info_/s/delay_info_/delay_info__/g
/[^a-zA-Z_]process_options(/s/process_options(/getopt__process_options(/g
/[^a-zA-Z_]lookup_option(/s/lookup_option(/globals__lookup_option(/g
/[^a-zA-Z_]append(/s/append(/list__append(/g
/[^a-zA-Z_]member(/s/member(/list__member(/g
/[^a-zA-Z_]merge(/s/merge(/list__merge(/g
/[^a-zA-Z_]member_chk(/s/member_chk(/list__member_chk(/g
/[^a-zA-Z_]length(/s/length(/list__length(/g
/[^a-zA-Z_]condense(/s/condense(/list__condense(/g
/[^a-zA-Z_]same_length(/s/same_length(/list__same_length(/g
/[^a-zA-Z_]split_list(/s/split_list(/list__split_list(/g
/[^a-zA-Z_]reverse(/s/reverse(/list__reverse(/g
/[^a-zA-Z_]delete(/s/delete(/list__delete(/g
/[^a-zA-Z_]delete_first(/s/delete_first(/list__delete_first(/g
/[^a-zA-Z_]sort(/s/sort(/list__sort(/g
/[^a-zA-Z_]nth_member_search(/s/nth_member_search(/list__nth_member_search(/g
/[^a-zA-Z_]nth_member_lookup(/s/nth_member_lookup(/list__nth_member_lookup(/g
/^goedel_expand(/s/goedel_expand(/prog_util__expand(/g
/^goedel_replace(/s/goedel_replace(/prog_util__replace(/g
/^to_upper(/s/to_upper(/char__to_upper(/g
/^to_lower(/s/to_lower(/char__to_lower(/g
/^is_upper(/s/is_upper(/char__is_upper(/g
/^is_lower(/s/is_lower(/char__is_lower(/g
/^is_alpha(/s/is_alpha(/char__is_alpha(/g
/^is_alnum(/s/is_alnum(/char__is_alnum(/g
/^is_alpha_or_underscore(/s/is_alpha_or_underscore(/char__is_alpha_or_underscore(/g
/^is_alnum_or_underscore(/s/is_alnum_or_underscore(/char__is_alnum_or_underscore(/g
/^is_digit(/s/is_digit(/char__is_digit(/g
/^lower_upper(/s/lower_upper(/char__lower_upper(/g
/^io__op(/s/io__op(/term_io__op(/g
/^io__current_ops(/s/io__current_ops(/term_io__current_ops(/g
/^io__read_term(/s/io__read_term(/term_io__read_term(/g
/^io__write_term(/s/io__write_term(/term_io__write_term(/g
/^io__write_constant(/s/io__write_constant(/term_io__write_constant(/g
/^io__write_variable(/s/io__write_variable(/term_io__write_variable(/g
/^mercury_quote_string(/s/mercury_quote_string(/term_io__quote_string(/g
/^mercury_quote_atom(/s/mercury_quote_atom(/term_io__quote_atom(/g
/^mercury_quote_char(/s/mercury_quote_char(/term_io__quote_char(/g
/^mercury_quote_single_char(/s/mercury_quote_single_char(/term_io__quote_single_char(/g
/^delay_info_/s/delay_info_/delay_info__/g
/^process_options(/s/process_options(/getopt__process_options(/g
/^lookup_option(/s/lookup_option(/globals__lookup_option(/g
/^append(/s/append(/list__append(/g
/^member(/s/member(/list__member(/g
/^merge(/s/merge(/list__merge(/g
/^member_chk(/s/member_chk(/list__member_chk(/g
/^length(/s/length(/list__length(/g
/^condense(/s/condense(/list__condense(/g
/^same_length(/s/same_length(/list__same_length(/g
/^split_list(/s/split_list(/list__split_list(/g
/^reverse(/s/reverse(/list__reverse(/g
/^delete(/s/delete(/list__delete(/g
/^delete_first(/s/delete_first(/list__delete_first(/g
/^sort(/s/sort(/list__sort(/g
/^nth_member_search(/s/nth_member_search(/list__nth_member_search(/g
/^nth_member_lookup(/s/nth_member_lookup(/list__nth_member_lookup(/g
/[^a-zA-Z_]delete_all(/s/delete_all(/list__delete_all(/g
/^delete_all(/s/delete_all(/list__delete_all(/g
1994-06-02 16:03:34 +00:00
Fergus Henderson
019ee742f8 Break modes.nl up into separate modules.
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.
1994-05-24 07:35:16 +00:00
Fergus Henderson
f591233502 Fix bug in mode declaration.
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.
1994-05-11 18:29:20 +00:00
Fergus Henderson
1687d301e5 - Add a new inst `not_reached' (intended for internal use by the
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.
1994-05-10 14:03:03 +00:00