Commit Graph

16 Commits

Author SHA1 Message Date
Thomas Conway
0f6a3d59d1 added entries for the new files.
Makefile:
	added entries for the new files.

codegen.nl:
	This is really a new file (well almost). Contains the top level
	of the code generator.
doit.nl:
	Added the new files (and mode_error which was missing).

hlds.nl:
	Changed the type declaration for unifications to use arg_mode
	instead of mode.

hlds_out.nl:
	Small change for the above alteration.

llds.nl:
	Minor changes.

mode_util.nl:
	Change the modes to arg_modes for unifications.

modes.nl:
	ditto.

std_util.nl:
	more assoc_list predicates...

term.nl:
	Fixed a small but nasty by in term__vars_list (and don't forget
	Fergus that you owe me a chocolate biscuit).
1994-06-06 08:57:53 +00:00
Fergus Henderson
346f5b88fd Add arity' as an alias for int'.
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.
1994-06-02 12:56:00 +00:00
Thomas Conway
b12de99abf add set__a_member
set.nl:
	add set__a_member

std_util.nl:
	Add assoc_list__reverse_members
1994-05-23 10:44:28 +00:00
Fergus Henderson
dc1e47af29 Update the todo list.
typecheck.nl:
	Update the todo list.

std_util.nl:
	Add a type pair(T) == pair(T,T).
1994-05-08 15:38:59 +00:00
Fergus Henderson
0ad664520e Rename various things for consistency:
s/term_functor/term__functor/g
	s/term_atom/term__atom/g
	s/term_string/term__string/g
	s/term_int/term__int/g
	s/term_float/term__float/g
	s/term_variable/term__variable/g

	/:- mode.*[^a-zA-Z_]input,/s/input,/in,/g
	/[^a-zA-Z_]input,.*)/s/input,/in,/g
	/:- mode.*[^a-zA-Z_]output,/s/output,/out,/g
	/[^a-zA-Z_]output,.*)/s/output,/out,/g

	/:- mode.*[^a-zA-Z_]input)/s/input)/in)/g
	/:- mode.*[^a-zA-Z_]output)/s/output)/out)/g

	/[a-z]info/s/info/_info/g
	/__info/s/__info/_info/g
1994-05-03 12:28:54 +00:00
Fergus Henderson
62a70e436b Use assoc_list/2 rather than list(pair(...)).
bintree.nl, map.nl, std_util.nl:
	Use assoc_list/2 rather than list(pair(...)).

hlds.nl, det_analysis.nl:
	Make instmap delta an association list rather than a map;
	fix the determinism analysis to use that.

Makefile, doit.nl:
	Add det_analysis.nl and builtins.nl.

builins.nl:
	Fix bug.

codegen.nl:
	Make unimplemented cases abort rather than just fail.

modes.nl, typecheck.nl:
	Fix bugs introduced by the performance fixes.
	(I wonder if the performance problem will come back now? ;-)

options.nl, toplevel.nl:
	Add a new pred `maybe_flush_output' and use it in toplevel.nl.
1994-03-30 11:53:25 +00:00
Fergus Henderson
8047b837c7 Add a `unit' type.
std_util.nl:
	Add a `unit' type.
1994-03-22 03:49:24 +00:00
Fergus Henderson
92d1371b4c New file: converts the prog_io data structure back into Mercury source
mercury_to_mercury.nl:
	New file: converts the prog_io data structure back into Mercury source
	code.

term_io.nl:
	Export mercury_quote_string for use by mercury_to_mercury.nl.

Makefile, doit.nl:
	Add mercury_to_mercury.

options.nl, toplevel.nl:
	Add a new option to save the interface of a module to a `.int' file,
	using mercury_to_mercury.

Makefile:
	Modify the rule for the `clean' target so that it removes `.int' files.

mercury_builtin.nl:
	Fix the module name.

std_util.nl:
	Suppress warnings from nit.
1994-03-14 14:53:58 +00:00
Fergus Henderson
30f46e92b0 New file. At the moment it just checks for undefined modes and
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.
1994-03-04 12:39:43 +00:00
Fergus Henderson
c7da2813cd Added the universal type `univ'. 1994-03-02 02:48:54 +00:00
Fergus Henderson
f302152b3a fix bug in error message code
typecheck.nl:
	fix bug in error message code

Makefile:
	remove pathname from NC definition

make_hlds.nl:
	initialize the unify_context field.

std_util.nl, std_util.nu.nl:
	move the implementation of solutions/2 from std_util to std_util.nu
	(where it should have been in the first place).
1994-02-23 14:09:57 +00:00
Fergus Henderson
e7d5e01767 added handling of higher-order predicates and the builtin types
typecheck.nl:
	added handling of higher-order predicates and the builtin types
	pred, pred(T), pred(T1, T2), etc.

hlds.nl:
	added new field pred_name_index to the moduleinfo data structure
	(needed for higher-order pred handling in typecheck.nl).

make_hlds.nl:
	update the pred_name_index

make_hlds.nl:
	detect and report as an error any attempts to define multiple
	constructors for a single type with the same name and arity.

Makefile:
	minor fixes.

hlds_out.nl:
	fix type errors introduce when pred_mode_id was renamed as proc_id.

mercury_to_goedel.nl:
	fix problems causes by modifications to prog_io.nl.

various places:
	change to use the new builtin higher-order pred types.
1994-02-23 13:35:54 +00:00
Fergus Henderson
02c2a93c4c typecheck.nl: A couple of minor fixes; fix bug with constants of builtin types.
Optimize for the common case of non-polymorphic types & predicates.

term.nl: Rename term__apply_substitution as term__apply_rec_substitution
	and add a new term__apply_substitution for when you want
	non-recursive application.  Fix logic bug in
	term__substitute_corresponding.

varset.nl: Fix logic bug in varset__merge.

io.nu.nl: Fix typo in error message.

term_io.nu.nl: Fix bug in the code used to work-around the NU-Prolog
	getToken bug for empty strings.

prog_io.nl: Fix bug: the string "\+" should have been "\\+".
	Also fixed LOTS of type errors (discovered by the typechecker,
	hurray it now works!).

int.nl, list.nl, std_util.nl: Added pred & mode declarations for some
	NU-Prolog predicates that we are using.
1994-02-10 15:02:25 +00:00
Fergus Henderson
1e4edbe9fc Bug fixes.
Also rearranged the interface declarations in a couple of modules.
1994-02-02 11:24:56 +00:00
Fergus Henderson
cc6a44c2bb term_io.nl: add io__write_variable.
Added a couple of new preds to std_util.nl and added std_util.nu.nl.

Fixed some bugs in the typechecker, and improved error reporting
a bit.

Did a bit of work on memory management.
1994-02-02 10:26:45 +00:00
Fergus Henderson
955c1512de mercury_to_goedel.nl: hack it to work for llds.nl.
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.
1994-01-26 15:20:07 +00:00