Commit Graph

36 Commits

Author SHA1 Message Date
Zoltan Somogyi
f0ffbbc13c Convert (C->T;E) to (if C then T else E). 2015-12-01 05:35:29 +11:00
Julien Fischer
bed96b93ff Avoid module qualification in library interfaces where possible.
NOTE: this change does not affect the io module -- I've left that for a
separate change.

library/*.m:
	As per the recent change to the coding standard, avoid module
	qualification in library interfaces where possible.

	Reformat declarations and descriptive comments to better utilise
	any space freed up by the above.
2014-10-10 15:08:24 +11:00
Paul Bone
d17c9f13a6 Refine Micheal's pqueue changes
library/pqueue.m:
    Refine Micheal's changes where necessary to conform to our style.

NEWS:
    Updated news file.
2013-11-28 12:57:38 +11:00
Michael T. Richter
b203f7e496 Beefed up the pqueue implementation.
library/pqueue.m:
    Added predicates is_empty/1, peek/3, peek_key/2, peek_value/2,
    det_peek/3, merge/3.  Added functions det_peek_key/1, det_peek_value/1.

    Also reformatted code to fit within 76 columns.
2013-11-28 12:40:27 +11:00
Julien Fischer
3a74d3fd88 Change the argument order of some predicates in the stack and pqueue modules in
Branches: main

Change the argument order of some predicates in the stack and pqueue modules in
order to make them more conducive to the use of state variable notation.

library/pqueue.m:
library/stack.m:
	Change the argument ordering as above.

	Rename some variables in stack.m.

library/svpqueue.m:
library/svstack.m:
	Make the predicates exported by these modules as obsolete.

NEWS:
	Announce the above changes.

compiler/code_info.m:
compiler/delay_info.m:
compiler/ml_gen_info.m:
compiler/mode_constraint_robdd.m:
compiler/mode_ordering.m:
	Conform to the above changes.
2012-01-24 05:23:07 +00:00
Julien Fischer
92121e1ea4 Add the modules svstack and svpqueue to the standard library.
Branches: main

Add the modules svstack and svpqueue to the standard library.

library/svpqueue.m:
library/svstack.m:
	Add state variable friendly interfaces to stacks and pqueues.

library/pqueue.m:
	Add a det version of remove/4.

	Group function definitions with the clauses for the corresponding
	predicates.

library/library.m:
	Include the new modules.

NEWS:
	Announce the above changes.
2011-05-18 11:23:05 +00:00
Paul Bone
67053330aa Wrap text correctly in a copyright notice.
Estimated hours taken: 0.1
Branches: main

Wrap text correctly in a copyright notice.

library/pqueue.m:
	As above.
2009-01-30 03:57:05 +00:00
Paul Bone
0bbb6d07fa Support implicit parallelism in the compiler.
Estimated hours taken: 20
Branches: main

Support implicit parallelism in the compiler.

The compiler now uses the deep profiler feedback information to build a
parallel version of a program.

Changes have also been made to the feedback format for candidate parallel
conjunctions and the analysis that recommends opportunities for parallelism to
the compiler.

compiler/implicit_parallelism.m:
	Mark Tannier's implementation as deprecated (it also crashes the
	compiler).
	Introduce new implicit parallelism transformation.
	apply_implicit_parallelism_transformation now returns maybe_error rather
	than maybe so that errors can be described.

compiler/goal_util.m:
	Add a predicate to transform a goal referenced by a goal path within a
	larger goal structure and rebuild that structure.

compiler/mercury_compile.m:
	Conform to changes in implicit_parallelism.m

deep_profiler/mdprof_feedback.m:
	Return a cord of warnings from many predicates, these warnings are used to
	describe cases where parallelism might be profitable but it is not (yet)
	possible to transform the code into parallel code.
	Fix a bug whereby the wrong deep profiling statistic was used to calculate
	the cost of a call.
	Do not attempt to parallelise calls with other goals between them.

mdbcomp/feedback.m:
	Remove the intermediate goals information from the candidate parallel
	conjunctions feedback data.

mdbcomp/program_representation.m:
	Provide a in-order alternative to the goal_path type so that operations on
	the start of the goal path occur in constant time and goal_path itself
	remains usable as a key in arrays because it doesn't use the cord type
	internally.

library/cord.m:
	Added a di/uo mode to cord.foldl_pred.

library/list.m:
	Added list.find_index_of_match/4 to return the index of the first item in
	a list that satisfies the predicate given in the first argument.

library/pqueue.m:
	Added pqueue.length/1

NEWS:
	Announce standard library changes.
2009-01-30 03:51:45 +00:00
Zoltan Somogyi
132b4c8540 Fix formatting.
Estimated hours taken: 0.1
Branches: main

library/list.m:
library/pqueue.m:
library/rbtree.m:
	Fix formatting.
2007-09-10 04:44:06 +00:00
Julien Fischer
adc59c362b Stop the copyright check getting stroppy on neptune.
Estimated hours taken: 0
Branches: main

library/pqueue.m:
	Stop the copyright check getting stroppy on neptune.
2007-09-04 07:40:24 +00:00
Julien Fischer
50b2eee329 Document the condition under which pqueue.remove/4 can fail.
Estimated hours taken: 0
Branches: main

library/pqueue.m:
	Document the condition under which pqueue.remove/4 can fail.
2007-09-04 07:39:25 +00:00
Julien Fischer
9958d3883c Fix some formatting.
Estimated hours taken: 0
Branches: main

Fix some formatting.

compiler/distance_granularity.m:
compiler/exception_analysis.m:
compiler/implicit_parallelism.m:
compiler/inst_graph.m:
compiler/interval.m:
compiler/layout_out.m:
compiler/lp_rational.m:
compiler/make.program_target.m:
compiler/modules.m:
compiler/prog_data.m:
compiler/purity.m:
compiler/recompilation.check.m:
compiler/term_constr_data.m:
compiler/term_util.m:
compiler/xml_documentation.m:
deep_profiler/mdprof_cgi.m:
library/pqueue.m:
profiler/output.m:
	Fix the positioning of commas.

	s/[_|_]/[_ | _]/ in a spot.
2007-05-23 10:09:24 +00:00
Julien Fischer
98894f79cc Add the equivalences text_input_stream == input_stream and
Estimated hours taken: 0.2
Branches: main, release

library/io.m:
	Add the equivalences text_input_stream == input_stream and
	text_output_stream == output_stream.  The text_ versions are less
	ambiguous then the existing ones.

	s/IO/I\/O/ (previously we used a mixture of both).

	Reformat some documentation.

library/pqueue.m:
	Fix a spot where the conversion to 4-space indentation had gone awry.

library/dir.m:
	Reposition a section heading.

library/string.m:
browser/declarative_tree.m:
compiler/java_util.m:
compiler/mercury_compile.m:
compiler/typecheck.m:
	Fix some typos.
2006-07-28 04:54:04 +00:00
Julien Fischer
e0f5ac47db Make it easier for vi to jump past the initial comments
Estimated hours taken: 0.1
Branches: main

library/*.m:
	Make it easier for vi to jump past the initial comments
	at the head of a module.
2006-04-19 05:18:00 +00:00
Julien Fischer
459847a064 Move the univ, maybe, pair and unit types from std_util into their own
Estimated hours taken: 18
Branches: main

Move the univ, maybe, pair and unit types from std_util into their own
modules.  std_util still contains the general purpose higher-order programming
constructs.

library/std_util.m:
	Move univ, maybe, pair and unit (plus any other related types
	and procedures) into their own modules.

library/maybe.m:
	New module.  This contains the maybe and maybe_error types and
	the associated procedures.

library/pair.m:
	New module.  This contains the pair type and associated procedures.

library/unit.m:
	New module. This contains the types unit/0 and unit/1.

library/univ.m:
	New module. This contains the univ type and associated procedures.

library/library.m:
	Add the new modules.

library/private_builtin.m:
	Update the declaration of the type_ctor_info struct for univ.

runtime/mercury.h:
	Update the declaration for the type_ctor_info struct for univ.

runtime/mercury_mcpp.h:
runtime/mercury_hlc_types.h:
	Update the definition of MR_Univ.

runtime/mercury_init.h:
	Fix a comment: ML_type_name is now exported from type_desc.m.

compiler/mlds_to_il.m:
	Update the the name of the module that defines univs (which are
	handled specially by the il code generator.)

library/*.m:
compiler/*.m:
browser/*.m:
mdbcomp/*.m:
profiler/*.m:
deep_profiler/*.m:
	Conform to the above changes.  Import the new modules where they
	are needed; don't import std_util where it isn't needed.

	Fix formatting in lots of modules.  Delete duplicate module
	imports.

tests/*:
	Update the test suite to confrom to the above changes.
2006-03-29 08:09:58 +00:00
Zoltan Somogyi
b293bd999d Replace __ with . as the module qualifier everywhere.
Estimated hours taken: 1
Branches: main

library/*.m:
	Replace __ with . as the module qualifier everywhere.

tests/hard_coded/test_injection.exp:
	Replace __ with . as the module qualifier in expected exceptions.
2006-03-07 22:23:58 +00:00
Zoltan Somogyi
57b8f436eb Convert to four-space indentation most of the library modules that
Estimated hours taken: 4
Branches: main

library/*.m:
	Convert to four-space indentation most of the library modules that
	weren't already indented that way. Use predmode syntax where possible.
	In some modules, shorten long lines by deleting module name prefixes.
	Fix departures from our coding standards.

	In some modules, simplify code, mostly using field names and/or state
	variables.

	There are no changes in algorithms, except for neg_list in integer.m.
2005-10-17 11:35:22 +00:00
Zoltan Somogyi
88c7539230 Import only one module per line, as we already do in the compiler
Estimated hours taken: 0.3
Branches: main

library/*.m:
	Import only one module per line, as we already do in the compiler
	directory.
2005-06-16 04:08:07 +00:00
Julien Fischer
be08ab4736 Add some synonyms for various functions in the string module
Estimated hours taken: 1
Branches: main, release

Add some synonyms for various functions in the string module
and make some more general cleanups to parts of the standard library.

library/array.m:
	s/applys/applies/

library/list.m:
	Position descriptive comments according to our coding
	standard.

	Fix a cut and paste error.  list.foldl6 has six accumulators
	not five.

library/parser.m:
library/pqueue.m:
library/set_bbbtree.m:
library/set_ctree234.m:
	Fix minor formatting problems and spelling mistakes.

library/string.m:
	Add functions string.from_int/1, string.from_char/1
	and string.from_float/1 as synonyms for string.int_to_string/1
	etc.

library/version_types.m:
	s/incurrs/incurs/
2005-02-28 03:39:38 +00:00
Julien Fischer
b13a50c7f6 Make the positioning of descriptive comments conform
Estimated hours taken: 3.5
Branches: main

Make the positioning of descriptive comments conform
to the coding standard for the following library modules.

Convert preds to predmode syntax where possible.

Make the ordering of related predicates and functions
conform to the coding standard, where the descriptive
comment makes it possible to do that.

Other minor changes are listed below.

library/bimap.m:
	Fix capitalisation of a few comments.

library/dir.m:
	s/throw an exception/throws an exception/.

library/exception.m:
	Fix the comment about the exception_result/1 type.
	There is only one type and an inst following the comment.

library/map.m:
	Remove the unique modes for map.set/4, map.delete/3 and
	map.delete_list/3.

library/rbtree.m:
	Remove the unique modes for rbtree.set/4, rbtree.delete/3,
	rbtree.remove/4, rbtree.remove_smallest/4 and rbtree.remove_largest/4.

library/tree234.m:
	Remove left over unique modes for preds.

library/set.m:
	XXX the ordering of procedures in this module is a bit strange.
library/set_bbbtree.m:
library/set_unordlist.m:
	Remove various unique modes for set operations like
	delete/3.  (Some of these were commented out anyway).

library/term_to_xml.m:
	Fix a spot where line width exceeded 79 characters.

library/array.m:
library/assoc_list.m:
library/random.m:
library/multi_map.m:
library/pqueue.m:
library/queue.m:
library/bool.m:
library/char.m:
library/construct.m:
library/counter.m:
library/deconstruct.m:
library/eqvclass.m:
library/gc.m:
library/io.m:
library/sparse_bitset.m:
library/stack.m:
library/std_util.m:
library/store.m:
library/string.m:
library/term.m:
library/term_io.m:
library/type_desc.m:
library/varset.m:
	As above.
2005-01-24 23:16:40 +00:00
Julien Fischer
1c30fd5580 Add pqueue.from_assoc_list/1 as a synonym for
Estimated hours taken: 0.1
Branches: main

library/pqueue.m:
	Add pqueue.from_assoc_list/1 as a synonym for
	pqueue.assoc_list_to_pqueue/1.

NEWS:
	Mention the above addition.
2005-01-18 08:09:03 +00:00
Zoltan Somogyi
6909674f14 Bring these modules up to date with our current style guidelines.
Estimated hours taken: 8
Branches: main

library/*.m:
	Bring these modules up to date with our current style guidelines.
	Use predmode declarations where appropriate. Use state variable syntax
	where appropriate. Reorder arguments where this makes it possible to
	to use state variable syntax. Standardize format of predicate
	description comments. Standardize indentation.
2004-03-15 23:49:36 +00:00
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
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
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
624bbd1fc6 Fix some typos in the comments.
pqueue.m:
	Fix some typos in the comments.
1995-07-31 03:51:30 +00:00
Fergus Henderson
93a755d563 Add copyright notices.
library/*:
	Add copyright notices.
1995-03-28 16:19:34 +00:00
Fergus Henderson
81175cbf10 Fix naming conventions (delete/remove).
bintree_set.nl:
	Fix naming conventions (delete/remove).
	(XXX should fix set.nl too!)

graph.nl, pqueue.nl, random.nl, bintree_set.nl:
	Add missing determinism annotations.

io.nl, io.nu.nl:
	Add io__call_system.

mercury_compile.nl:
	Call a script `mercury_update_interface' to update the
	interface files without stuffing up the timestamps.
	Output a `<Module>.date' timestamp file.

	Also, eliminate the circular interface dependency warning,
	since it was giving false hits on circular implementation
	dependencies.

GNUMakefile, Makefile.common, Makefile.mercury:
	Fix a bug or two.
	Update the interface files intelligently.
1994-06-21 17:22:46 +00:00
Thomas Conway
be3f5523df Added more comments
pqueue.nl:
	Added more comments
1994-04-26 02:08:09 +00:00
Thomas Conway
b22460e175 A priority queue ADT.
pqueue.nl:
	A priority queue ADT.
	Needs more comments, and probably relies too much on destructive
	update for efficiency.
1994-04-25 23:55:41 +00:00