Commit Graph

70 Commits

Author SHA1 Message Date
Fergus Henderson
65782f9925 Add functions for the single output det predicates in a number
Estimated hours taken: 5

[This change was by Ralph Becket.
I'm just the person who reviewed it and committed it.  -fjh.]

Add functions for the single output det predicates in a number
of modules in the standard library.  Basically, for each

	:- pred f(in, ..., in, out) is det.

I have added the declaration

	:- func f(in, ..., in) = out.

and definition

	f(X1, ..., Xn) = Y :-
		f(X1, ..., Xn, Y).

library/char.m:
library/dir.m:
library/map.m:
library/string.m:
library/list.m:
library/set.m:
	Make the changes described above.

library/array.m:
	As above, except array input modes are all array_ui or
	array_di as appropriate and array output modes are array_uo.

library/int.m:
	Added forward versions of +/2, */2 and -/2 as plus/2, times/2
	and minus/2 respectively, to make it easier to pass these
	as arguments to higher-order predicates.
	Also added func constants for max_int, min_int and bits_per_int.

library/integer.m:
	Replaced local functions for list head, tail and length with
	calls to equivalent functions now defined in list.m.

library/io.m:
	Added func for error_message/2.

library/list.m:
	Add functions det_head/1 and det_tail/1 which abort on null lists.

library/set.m:
	Add functions map/2, filter_map/2 and fold/3.

library/std_util.m:
	Added utility function to construct a pair object from its
	arguments and general purpose higher order functions for
	partial functions and for function composition, exponentiation
	and exchanging the arguments of a binary function.
1999-07-07 15:19:42 +00:00
Fergus Henderson
14728289fa Remove support for NU-Prolog and SICStus Prolog.
Estimated hours taken: 5

Remove support for NU-Prolog and SICStus Prolog.

The reasons for this are:
(a) We now have a proper working debugger, so we don't need to use
    NU-Prolog or SICStus Prolog for debugging.
(b) The Prolog support was only ever a hack, not a proper solution;
    Mercury language features like functions or mode reordering
    were never supported.
(c) It was a maintenance problem.

compiler/make_hlds.m:
	Warn that NU-Prolog `when' declarations are deprecated.

compiler/prog_io.m:
	Update a comment to say that NU-Prolog `when' declarations
	are now deprecated.

library/*.m:
	Delete `when' declarations.

configure.in:
bindist/bindist.configure.in:
	Delete the autoconf tests for NU-Prolog and SICStus Prolog.
	Delete the stuff for generating the NU-Prolog and SICStus Prolog
	scripts.

tools/bootcheck:
	Delete the options for testing using SICStus Prolog.

library/Mmakefile:
	Delete the rules for building NU-Prolog and SICStus Prolog stuff.

library/library.nu.nl.in:
	library/swi_*.m:
	library/*.nu.nl:
library/array.nu.nl:
library/assoc_list.nu.nl:
library/char.nu.nl:
library/float.nu.nl:
library/int.nu.nl:
library/io.nu.nl:
library/library.nu.nl.in:
library/map.nu.nl:
library/mercury_builtin.nu.nl:
library/nc_builtin.nl:
library/require.nu.nl:
library/sp_builtin.nl:
library/sp_lib.nl:
library/std_util.nu.nl:
library/store.nu.nl:
library/string.nu.nl:
library/swi_builtin.m:
library/swi_lib.m:
library/term_io.nu.nl:
	Delete these files.

scripts/mnc.in:
scripts/mnp.in:
scripts/mnl.in:
scripts/msc.in:
scripts/msl.in:
scripts/msp.in:
	Delete these files.

doc/user_guide.texi:
	Delete the documentation about the Prolog support.

NEWS:
w3/news/newsdb.inc:
        Mention that we've removed the Prolog support.
1999-03-15 08:48:36 +00:00
Zoltan Somogyi
1d107c82ad Add predicates to perform lower-bound and upper-bound searching, in which
Estimated hours taken: 3

Add predicates to perform lower-bound and upper-bound searching, in which
if a search for a key fails, we return the next lower (or higher) key and
its associated value.

library/bintree.m:
library/rbtree.m:
library/tree234.m:
library/map.m:
	Add lower-bound and upper-bound search and lookup predicates.

	Add plain lookup predicates where missing, or move them next
	to their corresponding search preds.

	Make the handling of lookup errors more uniform.

library/require.m:
	Move map__lookup_error here as report_lookup_error, for use
	by bintree, rbtree and tree234, as well as map.
1999-03-07 23:41:05 +00:00
Fergus Henderson
792a5582d3 Fix a cut-and-paste error in the comment for map__det_union where
Estimated hours taken: 1

library/map.m:
	Fix a cut-and-paste error in the comment for map__det_union where
	it was referring to map__insert instead map__union.
	Delete the error message argument from map__det_union
	and map__det_insert, for consistency with other det_* predicates,
	and to make them easier to use.
1998-10-28 05:33:32 +00:00
Zoltan Somogyi
a95c389e8d Add some predicates that may be generally useful.
Estimated hours taken: 2

library/map.m:
	Add some predicates that may be generally useful. Some of them
	are needed in a near-future change to the compiler.

NEWS:
	Mention the new predicates.
1998-10-20 02:02:29 +00:00
Simon Taylor
d1c145c139 Use map__lookup_error for the other map predicates
Estimated hours taken: 0.1

library/map.m:
	Use map__lookup_error for the other map predicates
	which abort on missing or duplicate keys.

library/map.nu.nl:
	Fix the message for map__det_insert_error.
1998-08-26 05:45:28 +00:00
Fergus Henderson
e814eb439c Split the error handling code from map__lookup into a seperate
Estimated hours taken: 0.25

library/map.m:
	Split the error handling code from map__lookup into a seperate
	predicate map__lookup_error.  The reason for this is two-fold:
	(1) this makes it for the compiler to inline map__lookup
	    without inlining all the error handling code
	(2) it can be handy to be able to set a breakpoint on
	    map__lookup_error.
1998-07-13 19:53:39 +00:00
Simon Taylor
3ed41940df Include the functor of the key in the error message
Estimated hours taken: 0.3

library/map.m
	Include the functor of the key in the error message
	when map__lookup fails.
1998-07-09 07:10:23 +00:00
Thomas Conway
a233f22598 mention the changes to map and tree234.
Estimated hours taken: 0.5

NEWS:
	mention the changes to map and tree234.

library/map.m:
	added map__foldl/4 and map__map_values/3 which forward to the
	corresponding predicates in tree234.

library/tree234.m:
	implement tree234__foldl and tree234__map_values.
1998-03-31 23:16:29 +00:00
Fergus Henderson
7cb525fde3 Undo Zoltan's bogus update of all the copyright dates.
Estimated hours taken: 0.5

library/*.m:
compiler/*.m:
	Undo Zoltan's bogus update of all the copyright dates.
	The dates in the copyright header should reflect the years
	in which the file was modified (and no, changes to the
	copyright header itself don't count as modifications).
1998-01-23 12:33:43 +00:00
Zoltan Somogyi
9ae7acc593 Update all the copyright dates for 1998.
Estimated hours taken: 0.5

library/*.m:
	Update all the copyright dates for 1998.
1998-01-13 10:01:32 +00:00
Fergus Henderson
04b720630b Update the copyright messages so that (a) they contain the correct years
and (b) they say "Copyright (C) ... _The_ University of Melbourne".
1997-07-27 15:09:59 +00:00
Tyson Dowd
cbcb23d17b Enable --warn-interface-imports by default.
Estimated hours taken: 3

Enable --warn-interface-imports by default. This was turned off while
list and term were defined in mercury_builtin.m, since it caused many
warnings.

Fix all the unused interface imports that have been added since then.

compiler/options.m:
	Enable --warn-interface-imports by default.

compiler/module_qual.m:
	Fix formatting inconsistencies with module names in warning
	messages. (".m" was not appended to module names if there was
	only one module).

compiler/*.m:
library/*.m:
tests/invalid/type_loop.m:
tests/warnings/*.m:
	Remove usused interface imports, or move them into
	implementation (mostly bool, list and std_util).
1997-05-21 02:16:53 +00:00
David Jeffery
381f5e328c Improved the error messages for map__lookup failure by writing out the types
Estimated hours taken: 4

Improved the error messages for map__lookup failure by writing out the types
of the values and keys.

Also, since the Prologs cannot handle the type_of functions, a `normal'
version of map__lookup has been added to map.nu.nl

To accomodate this, this change implements a mechanism to override
definitions of predicates for particular Prologs. This mechanism makes
explicit which .no or .ql files contain preds overriding others, and so
makes things a bit more robust.

library/map.m:
	Implement the better error messages.
library/map.nu.nl:
	The Prolog version of map__lookup.
library/Mmakefile:
	Set new environment variables, MERCURY_NU_OVERRIDING_LIB_OBJS or
	MERCURY_SP_OVERRIDING_LIB_OBJS to be the files which are to be
	linked, but contain definitions which override others.
scripts/mnl.in:
	Link everything in MERCURY_NU_OVERRIDING_LIB_OBJS last.
scripts/msl.in:
	Link everything in MERCURY_SP_OVERRIDING_LIB_OBJS last.
1997-05-17 03:27:18 +00:00
Fergus Henderson
f5f3d4c395 Move a couple of `import_module' declarations from the
Estimated hours taken: 0.25

library/map.m:
	Move a couple of `import_module' declarations from the
	interface to the implementation, because they were not
	needed in the interface.
1997-05-01 10:00:15 +00:00
Zoltan Somogyi
c79b87c394 Add list__sublist.
Estimated hours taken: 0.3

list:
	Add list__sublist.

map:
	Remove spaces from the ends of lines.
1996-05-13 07:53:38 +00:00
Simon Taylor
0ceed741d1 Bug fixes for higher_order.m and unused_args.m
Estimated hours taken: 8

Bug fixes for higher_order.m and unused_args.m

NEWS
	Removed the message about bugs in unused_args.m and higher_order.m

compiler/options.m
	Re-enabled higher_order and unused_args.

compiler/unused_args.m
	Fixed so that this now handles partially instantiated
	deconstructions correctly.

compiler/higher_order.m
	Two bug fixes:
	Specialization of types for specialized versions of predicates.
	Fixed handling of curried arguments.

compiler/inlining.m, compiler/type_util.m:
	Moved inlining:apply_substitution_to_type_map and
	inlining:apply_rec_substitution_to_type_map to type_util.m
	for use in the higher_order.m bug fix.

library/varset.m
	Added predicate varset__new_vars which returns a list of new
	variables.

library/term.m
	Added predicates term__apply_variable_renaming(_to_list)
	to apply a variable renaming (map(var, var)) to a term
	or list of terms.

library/map.m
	Added map__det_insert_from_corresponding_lists to insert
	multiple key-value pairs into a map.

tests/valid/{Mmake, higher_order2.m, higher_order3.m, unused_args_test2.m}
	Tests for the bug fixes.
1996-04-24 05:21:50 +00:00
Simon Taylor
9a1be31729 Added predicate map__delete_list/3, which applies map__delete/3
Estimated hours taken: 0.1

library/map.m
	Added predicate map__delete_list/3, which applies map__delete/3
		to a list of keys.
1996-02-16 05:42:33 +00:00
Zoltan Somogyi
3d06567878 Add some new predicates for the excess assignment pass.
varset:
	Add some new predicates for the excess assignment pass.

std_util, assoc_list:
	Move predicates for associative lists to a new module.

*.m:
	Import assoc_list.
1995-10-27 09:40:19 +00:00
Fergus Henderson
fa5226ee67 Improve the documentation.
library/*.m:
	Improve the documentation.
	Add a "Stability: low/medium/high" comment to all modules,
	which describes the stability of the interface to that module.

ops.m:
	Add `:' as an infix operator.

require.m:
	Implement require/1, since higher-order predicates now work.

term.m:
	Use the type `comparison_result' from mercury_builtin.m,
	rather than defining an identical type `comparison'.
1995-10-05 11:31:52 +00:00
Fergus Henderson
b0351fbeb4 Add copy/2.
library/mercury_builtin.m:
	Add copy/2.

library/io.m:
	Change io__get/set_globals to use unique modes.
	Add a few calls to copy/2 to make things work.

library/*.m:
	Add unique modes to a few predicates.
	Remove unique modes in a couple of cases where they didn't work.
1995-08-02 07:20:49 +00:00
Fergus Henderson
77a0272d8d Fix all the obsolete comments referring to `foo.nl' instead of
library/*.m:
	Fix all the obsolete comments referring to `foo.nl' instead of
	`foo.m'.
1995-07-17 12:51:25 +00:00
Tyson Dowd
649eae20d2 Added map__remove_smallest/4.
map.m:
	Added map__remove_smallest/4.
1995-07-06 05:26:25 +00:00
Thomas Conway
407298c19a add a __member predicate for nondeterministically getting the
map.m & tree234.m:
	add a __member predicate for nondeterministically getting the
	members of a map or tree.
random.m:
	replace the random number generator with the original proper one.
1995-06-22 23:57:28 +00:00
Fergus Henderson
93a755d563 Add copyright notices.
library/*:
	Add copyright notices.
1995-03-28 16:19:34 +00:00
Thomas Conway
29c82c4e55 Add tree234
library.m:
	Add tree234

map.m:
	Implement maps as 234-trees rather than binary trees since
	it gives a performance boost of about 20%
1995-03-22 11:41:51 +00:00
Thomas Conway
4f52b1796a add map__select/3 which creates a submap with a given set
map.nl:
	add map__select/3 which creates a submap with a given set
	of keys.

bag.nl:
	add a couple of bits and pieces.
1995-02-22 10:46:27 +00:00
Fergus Henderson
6885687a30 Add predicates map__det_insert, map__det_update, and map__det_remove.
map.nl:
	Add predicates map__det_insert, map__det_update, and map__det_remove.
	These are like their semidet equivalents except that they will
	call error/1 rather than failing.
	Use of map__set when map__det_insert or map__det_update would do
	is henceforth frowned apon!
1995-01-16 14:36:42 +00:00
Fergus Henderson
8d0d42c69b Remove some old temporary hacks (to work-around the
group.nl, bintree_set.nl, map.nl:
	Remove some old temporary hacks (to work-around the
	lack of implied modes) which aren't needed now.
1995-01-01 01:18:36 +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
140bd7b3ba Add map__count.
map.nl:
	Add map__count.
	Improve the documentation a little.
1994-09-29 05:55:10 +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
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
30f5e18b2f Remove map__search_insert; it's not needed and it's not
bintree.nl, map.nl, varset.nl:
	Remove map__search_insert; it's not needed and it's not
	really useful.

bintree.nl:
	Fix determinism problem in bintree__from_list_2.

options.nl, det_analysis.nl, make_hlds.nl:
	Add options to suppress determinism warnings.

det_analysis.nl, hlds.nl, modes.nl:
	Allow the delta-instmap to be `unreachable'.

hlds_out.nl:
	Output the delta-instmap.
	Output conjunctions differently in verbose mode.

llds.nl:
	Fix determinism problem.
	Change GOTO(LABEL(...)) into GOTO_LABEL(...) which can be
	more efficient.

map.nl:
	Add map__overlay/3.

typecheck.nl, modes.nl, mode_errors.nl, options.nl, hlds_out.nl.
	Split the old `debug' option into debug-types and debug-modes.
	Change the default for the `modecheck' option to `yes'.
	Add a new verbose-dump-hlds option, and use that instead
	of the very-verbose option in hlds_out.nl.

mode_util.nl:
	Export mode_get_insts/4.
	Add instmap_lookup_var (moved from modes.nl).
	Add apply_instmap_delta.

modes.nl, term.nl, prog_util.nl:
	Add determinism annotations.

term.nl, prog_io.nl:
	Fix bugs in when declarations.

std_util.nl, prog_io.nl:
	Add a maybe(T) type to std_util.nl.
	Rename the maybe(T) type in prog_io.nl as maybe1(T).
1994-06-16 16:05:59 +00:00
Thomas Conway
b0d87c4f1c various changes. Added switch_gen.nl renamed the other codegen
Makefile:
	various changes. Added switch_gen.nl renamed the other codegen
	files to fit the naming conventions.
array.nl:
	added some determinism declarations.
bimap.nl:
	fixed some of the determinism problems.
doit.nl:
	minor changes.
hlds.nl:
	added liveness to the procinfo structure.
	added access predicates and type definition for liveness_info.
hlds_out.nl, modes.nl:
	patched the explicit usage of proc/11. for the above change.
int.nl:
	fixed it so that it compiles under mc!
map.nl, set.nl, term.nl:
	fixed determinism warnings.
toplevel.nl:
	import code_info.
various:
	file renaming to fit naming conventions.
1994-06-09 07:31:45 +00:00
Fergus Henderson
de130be437 Add some when declarations, so that bimap works.
map.nl:
	Add some when declarations, so that bimap works.
1994-06-07 13:14:55 +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
Thomas Conway
1026fda3e5 fix bintree__remove/4 so that it fails rather than aborts.
bintree.nl:
	fix bintree__remove/4 so that it fails rather than aborts.
	(probably want both variants actually...)

char.nl:
	added char__escape/2 for escaping characters.
	Possibly redundant, but if such code exists, then where is it?

io.nl
	added io__write_strings to print each of a list of strings and
	io__write_escaped_char to escape a character and print it.

map.nl:
	added map__merge. Could be better implemented probably. We need
	to address issues like determinism.
1994-05-30 00:45:58 +00:00
Fergus Henderson
6946f093d1 Fix performance bug due to use of NU-Prolog's `some'.
map.nl:
	Fix performance bug due to use of NU-Prolog's `some'.
	(Improved the speed of checking for undefined types by a factor
	of 20 - now takes 1s for codegen.nl instead of 20s.)
1994-05-25 16:27:00 +00:00
Thomas Conway
5649518cc0 added bintree__remove/4 which removes a key and returns the
bintree.nl:
	added bintree__remove/4 which removes a key and returns the
	element (equivalent to map__lookup+map__delete)

map.nl:
	added map__remove/4.
1994-05-25 01:45:45 +00:00
Fergus Henderson
45f9df3bee Simplify the code for map__inverse_search and assoc_list_member
map.nl:
	Simplify the code for map__inverse_search and assoc_list_member
	in order to get it past the mode checker.
1994-05-16 08:14:33 +00:00
Fergus Henderson
d409b8be91 A temporary hack to get it past the mode checker.
map.nl:
	A temporary hack to get it past the mode checker.
1994-05-16 07:57:02 +00:00
Fergus Henderson
1db58aea79 Comment out the difficult modes for same_list.
list.nl:
	Comment out the difficult modes for same_list.
	(A temporary hack until the mode system is improved.)

make_hlds.nl:
	Fix scoping errors.

prog_io.nl:
	Fix scoping error introduced by the DCG expansion of if-then-else.

map.nl:
	Add map__is_empty/1.

mercury_to_mercury.nl:
	Fix error in mode declaration.

modes.nl:
	Fix bug where the waiting_goals_table in the delay_info structure
	was not being correctly updated when we exited a conjunction
	which contained a mode error.

queue.nl:
	Use `[A|B]' instead of `A.B'.
	Add a when declaration.

typecheck.nl:
	Fix mode error.

Makefile:
	Add a rule to create *.ugly using mercury_compile's
	`--convert-to-Mercury' option.

set.nl:
	Add set__singleton_set/2.
1994-05-15 16:06:41 +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
3b1487eef7 Change mode_is_input and mode_is_output so that abstract
hlds.nl:
	Change mode_is_input and mode_is_output so that abstract
	insts are assumed to be bound.

	Add predicate `inst_is_ground'.
	Add predicate `moduleinfo_set_num_errors'.

	Also change instmap_delta back into a map again (probably a mistake! -
	but I'll fix it later).

map.nl:
	Add predicate `map__from_sorted_assoc_list'.

mercury_to_mercury.nl:
	Export `mercury_output_inst' and `mercury_output_mode_list'.

modes.nl:
	Lots of changes.  It should be almost useable now.

options.nl:
	Add a new --modecheck option to invoke the mode checker.
	This is disabled by default since the modechecker doesn't
	quite work yet.

parser.nl:
	Remove obsolete comment.

prog_io.nl:
	Ensure that the bound insts in a bound(...) list are in sorted
	order.

set.nl:
	Add predicate `set__sorted_list_to_set'.

toplevel.nl:
	Changed to match the new interface to `modecheck'.
	Also don't generate code if there were any errors detected by
	make_hlds.

typecheck.nl:
	Fix a couple of minor typos in the error messages.
1994-04-11 15:40:29 +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
f3816c9d33 Added bintree__values/2, bintree__from_sorted_list/2, and
bintree.nl:
	Added bintree__values/2, bintree__from_sorted_list/2, and
	bintree__balance/2.

io.nl:
	Add missing `:- import_module std_util' declaration.

list.nl:
	Add sort/2.

map.nl:
	Add map__values/2.

set.nl:
	Add set__to_sorted_list/2.
	Improve the code for set__from_list/2.

typecheck.nl:
	Fix the bug with type var set synchronization and overloaded
	functors.  As a result, also had to change the checking for
	unresolved type errors.
	Also fix some problems with some of the error messages.
1994-03-28 03:41:37 +00:00
Fergus Henderson
ba1a19a4de Add an XXX comment.
llds.nl:
	Add an XXX comment.

--------------------

options.nl, prog_io.nl:
	Add a -I option.

--------------------

bintree.nl:
	Add predicates to work out the depth and number of items
	in a bintree.
map.nl:
	Make the fact that maps are bintrees externally visible,
	so that toplevel.nl can print out some stats about some maps.
toplevel.nl:
	Print out some stats about the pred, type, and cons maps.
1994-03-21 10:38:31 +00:00
Fergus Henderson
3e18209794 add predicate map__lookup (a new version of map__search).
map.nl:
	add predicate map__lookup (a new version of map__search).
1994-03-06 14:05:48 +00:00