Commit Graph

38 Commits

Author SHA1 Message Date
Fergus Henderson
77b16b11d9 Implement floating point.
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.
1995-03-15 14:28:24 +00:00
Fergus Henderson
e05b1b4780 Implement string__to_int using string__base_string_to_int(10, ...)
string.nl, string.nu.nl:
	Implement string__to_int using string__base_string_to_int(10, ...)
	rather than as a primitive in Prolog / C.
1995-02-02 12:06:49 +00:00
Fergus Henderson
8d2f9bc69f Implement string__base_int_to_string.
string.nl:
	Implement string__base_int_to_string.
1995-02-01 05:38:23 +00:00
Fergus Henderson
040cea9728 Add char__is_{hex,octal,binary}_digit.
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.
1995-01-24 10:21:14 +00:00
Fergus Henderson
865beeb3ca Various minor bugfixes.
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.
1995-01-23 17:07:17 +00:00
Thomas Conway
e348822bb0 unify procs were creating problems.
llds.nl :	primitive name mangling for '='
misc:		patches so that the benchmarks compile:
		unify procs were creating problems.
1994-11-08 04:36:04 +00:00
Fergus Henderson
b92bc1b34f Add a couple of things for compiling the compiler to .o files.
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.
1994-10-08 06:14:43 +00:00
Fergus Henderson
d8c9479872 Override the MERCURY_LIB_OBJS variable when invoking ml.
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).
1994-10-02 17:00:57 +00:00
Fergus Henderson
1a27233878 Make the handling of builtins a little more general.
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. ****
1994-09-30 21:42:27 +00:00
Fergus Henderson
e882f31654 Add a default definition of main_predicate/3 in io.nu.nl,
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.
1994-08-16 15:23:13 +00:00
Fergus Henderson
900285dc1b Add a new library module for file and directory name handling.
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.
1994-07-08 17:54:44 +00:00
Fergus Henderson
e0a02e7adb Remove the unused `declared_determinsm' field in the goal_info.
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.
1994-06-27 03:34:09 +00:00
Fergus Henderson
987bef62be Add determinism declarations. Fix a few determinism problems.
*.nl:
	Add determinism declarations.  Fix a few determinism problems.
1994-06-17 00:38:40 +00:00
Fergus Henderson
d20aaf2a5b If --verbose option specified, print out the inferred
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.
1994-06-14 16:05:25 +00:00
Fergus Henderson
94d9c1abb9 Use det_pred(...), semidet_pred(...), nondet_pred(...)
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...
1994-06-14 14:23:52 +00:00
Thomas Conway
079b3f15a8 remove redundant liveness check.
call_gen.nl:
	remove redundant liveness check.
call_info.nl:
	bring delta-liveness stuff on-line.
goboal.nl string.nl:
	add detism decls.
1994-06-09 12:13:02 +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
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
Fergus Henderson
3d6bf82ec2 Add string__int_to_base_string/3, for converting an
string.nl:
	Add string__int_to_base_string/3, for converting an
	integer to a string in an arbitrary base (from 2-36).
1994-06-02 11:46:53 +00:00
Fergus Henderson
78c70adfab Fix bug in mode declaration (detected by the mode checker!)
string.nl:
	Fix bug in mode declaration (detected by the mode checker!)

det_analysis.nl:
	Don't check the mode declarations for imported predicates.
1994-05-05 00:51:00 +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
7a9633b581 Move the inst/mode related routines from hlds.nl into mode_util.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.
1994-04-20 15:16:51 +00:00
Fergus Henderson
0755335f7b In mercury_to_mercury.nl, avoid quoting strings except when
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.
1994-03-27 04:08:26 +00:00
Fergus Henderson
960b4c01e4 Various minor bug-fixes.
io.nl, io.nu.nl, options.nl, string.nl:
	Various minor bug-fixes.

Makefile:
	Use nc's `-u' option rather than mercury_compile's `-h' option.
1994-03-16 08:22:55 +00:00
Fergus Henderson
8720bb03e8 Added a new -h option which solves the NU-Prolog memory management
problem.
1994-03-15 13:35:38 +00:00
Thomas Conway
cb559dee89 Changed if-then-else to -> ;
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 -> ;
1994-03-09 01:21:35 +00:00
Fergus Henderson
c852e70715 Add command-line option handling.
(Command-line options are now parsed, and the option data is saved
in the io__state, but the options aren't yet actually used.)
1994-03-03 05:36:17 +00:00
Thomas Conway
c81fd36030 array.nl: a few bugfixes. There are still a couple of type errors
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.
1994-02-23 01:28:20 +00:00
Fergus Henderson
83446de253 Isolate the assumption that strings are just lists
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.
1994-02-15 06:56:46 +00:00
Fergus Henderson
ea70c776ed make_hlds.nl: warn about use of undiscriminated union types;
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
1994-02-13 07:35:06 +00:00
Fergus Henderson
55839f463c builtins.nl: added `when' declarations.
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.
1994-01-28 18:54:25 +00:00
Fergus Henderson
532c27523f Split io.nl into io.nl and term_io.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".
1994-01-25 13:48:40 +00:00
Fergus Henderson
9ba4a542e0 Added code to parse determinacy annotations.
Also misc. bug fixes.
1994-01-24 14:07:19 +00:00
Fergus Henderson
88b37f2c0b - Add code to silently ignore NU-Prolog `when' declarations (rather than
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.
1994-01-24 03:36:42 +00:00
Fergus Henderson
470499c14e Added some new predicates. 1994-01-19 16:11:25 +00:00
Fergus Henderson
90c2b4f368 Added `author' comment to all source files.
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.
1993-12-28 11:35:16 +00:00
Fergus Henderson
eae0ea1f6e Add Tom's recent changes. 1993-11-23 23:53:49 +00:00
Fergus Henderson
f06bac3997 Added the compiler sources to the CVS repository. 1993-11-22 07:21:21 +00:00