Commit Graph

22 Commits

Author SHA1 Message Date
Zoltan Somogyi
6554ef7daa Replace "is" with "=".
Estimated hours taken: 2
Branches: main

Replace "is" with "=".
Add field names where relevant.
Replace integers with counters where relevant.
2003-05-26 09:01:46 +00:00
Simon Taylor
dedcf29a30 Make the function versions of predicates appear in the
Estimated hours taken: 2.5

library/*.m
	Make the function versions of predicates appear in the
	Mercury Library Reference Manual.
2000-11-12 08:51:39 +00:00
Fergus Henderson
6a6e5495ed Ralph Becket <rwab1@cam.sri.com>'s changes to add functions for
Estimated hours taken: 6

library/pqueue.m:
library/assoc_list.m:
library/getopt.m:
library/bag.m:
library/bimap.m:
library/bintree.m:
library/bintree_set.m:
library/bt_array.m:
library/eqvclass.m:
library/graph.m:
library/group.m:
library/queue.m:
library/rbtree.m:
library/stack.m:
library/term.m:
library/varset.m:
library/tree234.m:
library/relation.m:
library/set.m:
library/set_bbbtree.m:
library/set_ordlist.m:
library/set_unordlist.m:
	Ralph Becket <rwab1@cam.sri.com>'s changes to add functions for
	the remaining output det predicates in a number of modules in the
	standard library.  Basically, for each

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

	he has added the declaration

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

	and definition

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

	The changes were made using a mostly automatic process.
1999-10-30 04:16:13 +00:00
Thomas Conway
c4f17bfda5 fix the implementation of bag intersection, which was
Estimated hours taken: 0.5

library/bag.m:
	fix the implementation of bag intersection, which was
	completely bogus.
1999-08-27 04:40:58 +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
Simon Taylor
b946f163c0 Add a new predicate bag__count_value/3 which returns how
Estimated hours taken: 0.1

library/bag.m:
	Add a new predicate bag__count_value/3 which returns how
	many of a value a bag contains.

NEWS:
	Mention bag__count_value/3.
1998-12-03 04:59:36 +00:00
Andrew Bromage
85522c4196 Add two predicates to bag.m, bag__remove_list/3 and
Estimated hours taken: 0.5

library/bag.m:
	Add two predicates to bag.m, bag__remove_list/3 and
	bag__det_remove_list/3.

	Add an extra line to each pred comment in the interface to
	make them a bit more readable.

NEWS:
	Note the new predicates.
1998-03-10 05:40:21 +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
Zoltan Somogyi
b4813457c9 A rewrite of termination analysis to make it significantly easier to modify,
Estimated hours taken: 60

A rewrite of termination analysis to make it significantly easier to modify,
and to extend its capabilities.

compiler/error_util.m:
	A new file containing code that makes it easier to generate
	nicely formatted error messages.

compiler/termination.m:
	Updates to reflect the changes to the representation of termination
	information.

	Instead of doing pass 1 on all SCCs and then pass 2 on all SCCs,
	we now do both pass 1 and 2 on an SCC before moving on to the next.

	Do not insist that either all procedures in an SCC are
	compiler-generated or all are user-written, since this need not be
	true in the presence of user-defined equality predicates.

	Clarify the structure of the code that handles builtins and compiler
	generated predicates.

	Concentrate all the code for updating module_infos in this module.
	Previously it was scattered in several places in several files.

	Put all the code for writing out termination information at the
	end of the module in a logical order.

compiler/term_traversal.m:
	A new file containing code used by both pass 1 and pass 2 to
	traverse procedure bodies.

compiler/term_pass1.m:
	Use the new traversal module.

	Clarify the fixpoint computation on the set of output supplier
	arguments.

	Remove duplicates from the list of equations given to the solver.
	This avoids a det stack overflow in lp.m when doing termination
	analysis on options.m.

	If an output argument of a predicate makes sense only in the absence
	of errors, then return it only in the absence of errors.

compiler/term_pass2.m:
	Use the new traversal module. Unlike the previous code, this allows us
	to ignore recursive calls with input arguments bigger than the head
	if those calls occur after goals that cannot succeed (since those
	calls will never be reached).

	Implement a better way of doing single argument analysis, which
	(unlike the previous version) works in the presence of mutual recursion
	and other calls between the recursive call and the start of the clause.

	Implement a more precise way of checking for recursions that don't
	cause termination problems. We now allow calls from p to q in which
	the recursive input supplier arguments can grow, provided that on
	any path on which q can call p, directly or indirectly, the recursive
	input supplier arguments shrink by a greater amount.

	If an output argument of a predicate makes sense only in the absence
	of errors, then return it only in the absence of errors.

compiler/term_util.m:
	Updates to reflect the changes to the representation of termination
	information.

	Reorder to put related code together.

	Change the interface of several predicates to better reflect the
	way they are used.

	Add some more utility predicates.

compiler/term_errors.m:
	Small changes to the set of possible errors, and major changes in
	the way the messages are printed out (we now use error_util).

compiler/options.m:
	Change --term-single-arg from being a bool to an int option,
	whose value indicates the maximum size of an SCC in which we try
	single argument analysis. (Large SCCs can cause single-arg analysis
	to require a lot of iterations.)

	Add an (int) option that controls the max number of paths
	that we are willing to analyze (analyzing too many paths can cause
	det stack overflow).

	Add an (int) option that controls the max number of causes of
	nontermination that we print out.

compiler/hlds_pred.m:
	Use two separate slots in the proc_info to hold argument size data
	and termination info, instead of the single slot used until now.
	The two kinds of information are produced and used separately.

	Make the layout of the get and set procedures for proc_infos more
	regular, to facilitate later updates.

	The procedures proc_info_{,set_}variables did the same work as
	proc_info_{,set_}varset. To eliminate potential confusion, I
	removed the first set.

compiler/*.m:
	Change proc_info_{,set_}variables to proc_info_{,set_}varset.

compiler/hlds_out.m:
compiler/make_hlds.m:
compiler/mercury_to_mercury.m:
	Change the code to handle the arg size data and the termination
	info separately.

compiler/prog_data.m:
	Change the internal representation of termination_info pragmas to
	hold the arg size data and the termination info separately.

compiler/prog_io_pragma.m:
	Change the external representation of termination_info pragmas to
	group the arg size data together with the output supplier data,
	to which it is logically connected.

compiler/module_qual.m:
compiler/modules.m:
	Change the code to accommodate the change to the internal
	representation of termination_info pragmas.

compiler/notes/compiler_design.html:
	Fix some documentation rot, and clarify some points.

	Document termination analysis.

doc/user_guide.texi:
	Document --term-single-arg and the new options.

	Remove spaces from the ends of lines.

library/bag.m:
	Add a new predicate, bag__least_upper_bound.

	Fix code that would do the wrong thing if executed by Prolog.

	Remove spaces from the ends of lines.

library/list.m:
	Add a new predicate, list__take_upto.

library/set{,_ordlist}.m:
	Add a new predicate, set{,_ordlist}__count.

tests/term/*:
	A bunch of new test cases to test the behaviour of termination
	analysis. They are the small benchmark suite from our paper.

tests/Mmakefile:
	Enable the new test case directory.
1997-12-22 10:01:33 +00:00
Christopher Rodd Speirs
cb19d3e7c1 Added a bag__to_list/2 predicate which produces a sorted
Estimated hours taken: 0.5

library/bag.m:
	Added a bag__to_list/2 predicate which produces a sorted
	list from a bag.  Each value appears in the list as many times
	as it appears in the bag.  Also fixed a mistake in a comment.
1997-10-04 06:16:50 +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
327a5131e2 Remove support for term_to_type and type_to_term implemented as special
Estimated hours taken: 5

Remove support for term_to_type and type_to_term implemented as special
preds.  Remove support for one-cell and one-or-two-cell type_infos (now
shared-one-or-two-cell type_infos). Move definitions that were in
mercury_builtin.m back to where they belong.

This code has been removed because it is no longer used, and was no
longer being maintained but was still quite complex.

compiler/globals.m:
compiler/handle_options.m:
compiler/mercury_compile.m:
compiler/options.m:
	Remove one_cell and one_or_two_cell from type_info methods.

compiler/polymorphism.m:
	Remove term_to_type and type_to_term support.
	Remove one_cell and one_or_two_cell from type_info methods.
	Fix documentation to reflect the new situation.

compiler/special_pred.m:
compiler/unify_proc.m:
	Remove term_to_type and type_to_term support.

library/list.m:
	Put the definition of `list' back into list.m

library/mercury_builtin.m:
	Take the definitions of `list', `term', `var', `var__supply',
	etc, out of this module.
	Remove type_to_term, term_to_type, det_term_to_type,
	term__init_var_supply, term__create_var, term__var_to_int
	and term__context_init.
	Remove references to USE_TYPE_TO_TERM and #ifdefs around
	SHARED_ONE_OR_TWO_CELL_TYPE_INFO.

library/std_util.m:
	Remove references ONE_OR_TWO_CELL_TYPE_INFO, and code that
	handles one-cell typeinfo comparisons.

library/term.m:
	Add type_to_term, term_to_type, det_term_to_type,
	term__init_var_supply, term__create_var, term__var_to_int
	and term__context_init back to term.m.
	Add new implementation of type_to_term/2.

library/uniq_array.m:
	Fix a typo in a comment - term_to_type/3 instead of term_to_type/2.

runtime/call.mod:
	Remove special case code for unify, compare, index for
	one-cell typeinfos.
	Remove code for type_to_term/2.

runtime/type_info.h:
	Remove references to ONE_CELL_TYPE_INFO or ONE_OR_TWO_CELL_TYPE_INFO.
	Make sure only SHARED_ONE_OR_TWO_CELL_TYPE_INFO.
	Remove references to USE_TYPE_TO_TERM.

compiler/base_type_layout.m:
compiler/bytecode_gen.m:
compiler/code_util.m:
compiler/delay_slot.m:
compiler/det_util.m:
compiler/fact_table.m:
compiler/hlds_data.m:
compiler/hlds_goal.m:
compiler/mode_debug.m:
compiler/tree.m:
library/bag.m:
library/queue.m:
	Import module `list' or `term' (or both).
1997-05-20 01:52:55 +00:00
Christopher Rodd Speirs
5c62ae3f9e Changed bag__union/3 so that, like set__union, it is normally
Estimated hours taken: 0.5

library/bag.m:
	Changed bag__union/3 so that, like set__union, it is normally
	more efficient if the first argument is larger than the second.
1997-04-20 01:39:03 +00:00
Christopher Rodd Speirs
2162200666 Added a comment stating that bag__union/3 is normally more efficient
Estimated hours taken: 0.001

library/bag.m:
	Added a comment stating that bag__union/3 is normally more efficient
	if, of the 2 input arguments, the first bag is the larger.
1997-04-19 00:50:31 +00:00
Christopher Rodd Speirs
8332111adb Made some extensive additions to bag.m to include the standard set
Estimated hours taken: 5

Made some extensive additions to bag.m to include the standard set
operations (union, intersection, subtraction).  Also added some other
useful predicates to operate on bags.

library/bag.m:
	The following changes were made which will break any programs using
	these predicates: in bag__contains/2, the order of the arguments were
	swapped to make bag__contains the same as map__contains.
	bag__remove was det, but is now semidet.  bag__delete was added to
	replace the old bag__remove.  These changes make bag conform to the
	same standard as set.m and map.m.
compiler/code_exprn.m:
	This needed to be changed as it uses bag.m, and the changes to
	bag.m stopped code_exprn.m from compiling.
1997-02-13 23:57:16 +00:00
Fergus Henderson
898febddeb Add a predicate `bag__insert_list'.
Estimated hours taken: 0.25

library/bag.m:
	Add a predicate `bag__insert_list'.
	Also use more meaningful variable names.
1996-01-22 08:42:23 +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
93a755d563 Add copyright notices.
library/*:
	Add copyright notices.
1995-03-28 16:19:34 +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
Thomas Conway
95aac9ccf4 bag.nl now compiles!
bag.nl:
	bag.nl now compiles!

code_info.nl:
	Bugfix, also prevent register-shuffling of dead varaibles.
1994-06-16 03:36:47 +00:00
Thomas Conway
22a39de53f A preliminary implementation of multisets in terms of maps from
bag.nl:
	A preliminary implementation of multisets in terms of maps from
	T to int. Not yet used anywhere, nor added to the makefile.
	Maybe we should split the makefile into library stuff and compiler
	stuff?
1994-06-15 13:26:25 +00:00