Commit Graph

21 Commits

Author SHA1 Message Date
Zoltan Somogyi
95f8f56716 Delete unneeded $module args from calls to expect/unexpected. 2019-07-03 22:37:19 +02:00
Zoltan Somogyi
646b23fcf7 Convert (C->T;E) to (if C then T else E). 2015-11-30 10:39:53 +11:00
Julien Fischer
9f68c330f0 Change the argument order of many of the predicates in the map, bimap, and
Branches: main

Change the argument order of many of the predicates in the map, bimap, and
multi_map modules so they are more conducive to the use of state variable
notation, i.e. make the order the same as in the sv* modules.

Prepare for the deprecation of the sv{bimap,map,multi_map} modules by
removing their use throughout the system.

library/bimap.m:
library/map.m:
library/multi_map.m:
	As above.
NEWS:
	Announce the change.

	Separate out the "highlights" from the "detailed listing" for
	the post-11.01 NEWS.

	Reorganise the announcement of the Unicode support.

benchmarks/*/*.m:
browser/*.m:
compiler/*.m:
deep_profiler/*.m:
extras/*/*.m:
mdbcomp/*.m:
profiler/*.m:
tests/*/*.m:
ssdb/*.m:
samples/*/*.m
slice/*.m:
	Conform to the above change.

	Remove any dependencies on the sv{bimap,map,multi_map} modules.
2011-05-03 04:35:04 +00:00
Mark Brown
0dfb9c4874 New module for directed graphs. This is essentially the relation
Estimated hours taken: 12
Branches: main

library/digraph.m:
	New module for directed graphs.  This is essentially the relation
	module but with more consistent terminology, and with argument
	ordering that suits state variables.  Other differences with the
	relation module:

	- The digraph_key type has a phantom type parameter, which helps to
	  ensure that keys from one digraph are not used with another digraph.

	- Exports a version of digraph.reduced which also returns the mapping
	  between the original digraph keys and the new ones.

	- The implementation of compose/3 doesn't try to use the "domain" and
	  "range" of the graphs (which is meaningless in the relation module
	  anyway).

	- New, more efficient algorithm for is_dag/1.  Correctness proof is
	  documented.

	- components/2 uses a more efficient data representation, and avoids
	  some intermediate data structures.

	- reduced/{2,3} avoids some intermediate data structures.

	- tc/2 avoids some intermediate data structures.

library/library.m:
	Add the new module.

library/relation.m:
	Document that this module is deprecated in favour of digraph.

	Flag relation.init/{0,1} as obsolete (it would be better to flag
	the entire module, or the relation/1 type as obsolete, but Mercury
	does not support this).

NEWS:
	Mention that the new module supersedes relation.m and svrelation.m.

compiler/*.m:
profiler/*.m:
	Use the digraph module rather than the relation module.
2007-09-07 15:08:21 +00:00
Zoltan Somogyi
ff386022ae Fix a bunch of deviations from our coding standards.
Estimated hours taken: 1
Branches: main

profiler/*.m:
	Fix a bunch of deviations from our coding standards.

	Rename some predicates to make them better reflect the predicates'
	semantics.
2006-11-10 03:26:28 +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
a9a2825ace Replace __ with . as the module qualifier everywhere in all the modules
Estimated hours taken: 0.5
Branches: main

profiler/*.m:
deep_profiler/*.m:
compiler/*.m:
	Replace __ with . as the module qualifier everywhere in all the modules
	of the profiler and deep profiler and in some modules of the compiler.
2006-03-09 04:56:47 +00:00
Zoltan Somogyi
69d84ff1bb Import only one module per line. Misc other updates to bring these
Estimated hours taken: 1
Branches: main

profiler/*.m:
deep_profiler/*.m:
	Import only one module per line. Misc other updates to bring these
	modules closer to being up to date with our current style guidelines.
2005-03-24 01:10:34 +00:00
Julien Fischer
9126f1b06a Clean up most of the profiler and bring it into line
Estimates hours taken: 5
Branches: main

Clean up most of the profiler and bring it into line
with out current coding standards.  There are no changes
to any algorithms.

This reduce the size of the code and also (hopefully)
makes things a little easier to maintain.

XXX The profiler is currently broken on those machines
that compile with intermodule optimization, e.g jupiter.

XXX I haven't cleaned up the demangler much yet either.

profiler/call_graph.m:
profiler/generate_output.m:
profiler/globals.m:
profiler/output.m:
profiler/mercury_profile.m:
profiler/process_file.m:
profiler/output_prof_info.m:
profiler/prof_debug.m:
profiler/prof_info.m:
profiler/propagate.m:
profiler/read.m:
	Bring these modules in line with our current
  	coding standards.

	Replace existing code with code that uses
	higher-order predicates, state variables and
	functions where appropriate.

profiler/demangler.m:
	Replace `is' with `='.
2004-12-02 08:01:11 +00:00
Julien Fischer
f1f204e88c Deprecate the predicate int.to_float/2 in favour of float.float/1.
Estimated hours taken: 0.5
Branches: main

Deprecate the predicate int.to_float/2 in favour of float.float/1.
(There has been a comment describing this as obsolete for some time).

NEWS:
	Mention this change.

library/float.m:
	Add an implementation of float.float/1 rather than
	just calling int.to_float/2.

library/int.m:
	Add a pragma obsolete declaration to int.to_float/2.
	The implementation will have to stay until the predicate
	is deleted because importing the float module into this
	one results in type ambiguities.

library/term.m:
profiler/generate_output.m:
profiler/output.m:
profiler/propagate.m:
tests/hard_coded/agg.m:
tests/hard_coded/qual_strang.m:
tests/hard_coded/qual_strung.m:
	Change calls to int.to_float/2 to calls to float.float/1.
2004-07-08 06:00:50 +00:00
Simon Taylor
e18d74a90e Fix performance bugs in library/relation.m which caused
Estimated hours taken: 12
Branches: main

Fix performance bugs in library/relation.m which caused
`mmc --generate-dependencies' to choke on large programs
(e.g. the compiler).

`mmc --generate-dependencies top_level' now takes
about 8 seconds on jupiter, compared to over a minute
before.

library/relation.m:
	Use sparse_bitset for sets of relation_keys.

	Rewrite relation__compose to use the indexing
	in the relation structure, rather than just
	doing a naive nested loop join.

	Clean up and fix a bug in relation__is_dag.

	Rewrite algorithms to avoid using to_sorted_list
	on sparse_bitsets of relation keys; this is not
	a cheap operation as it is with set.sets.
	Use sparse_bitset.fold{l,r} instead where
	possible.

library/sparse_bitset.m:
	Add new functions to_set and from_set,
	which convert between sparse_bitsets
	and set.sets.

	Add predicate versions of foldl and foldr with
	the same modes as the list version.

compiler/modules.m:
	Use sparse_bitset.foldl rather than sparse_bitset.to_sorted_list
	followed by list.map.

profiler/propagate.m:
	relation__dfsrev now takes a sparse_bitset(relation_key),
	not set_bbbtree(relation_key).

library/map.m:
library/tree234.m:
	Type specialize map__det_update for term.var and int.

NEWS:
	Document new predicates and functions.

tests/hard_coded/relation_test.{m,exp}:
	Test relation__is_dag.
2003-12-22 11:21:49 +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
Thomas Conway
6d2bd413bf add a few missing import_module declarations.
Estimated hours taken: 0.25

profiler/*.m:
	add a few missing import_module declarations.
1997-07-01 04:12:01 +00:00
Fergus Henderson
9ee35e25e8 Fix some places where `__' as module qualifier broke the profiler.
Estimated hours taken: 0.25

Fix some places where `__' as module qualifier broke the profiler.

generate_output.m:
process_file.m:
prof_info.m:
propagate.m:
	s/prof__/prof_/g
	s/prof_node__/prof_node_/g
	s/pred_info__/pred_info_/g
	s/cycle_info__/cycle_info_/g
	since the part before `__' was not a module qualifier.

read.m:
	s/replace/read__replace/ (where appropriate)
	to avoid ambiguity with `list__replace'.
1997-02-25 17:18:33 +00:00
Fergus Henderson
c1f0e23cfa Fix a SICStus-Prolog incompatibility.
Estimated hours taken: 0.25

profiler/propagate.m:
	Fix a SICStus-Prolog incompatibility.
1996-11-25 08:49:50 +00:00
Andrew Bromage
804852adab Design change to relation.m to fix a MAJOR shortcoming.
Estimated hours taken: 5

Design change to relation.m to fix a MAJOR shortcoming.  Relations
now require the domain to be entered explicitly
fixes a known bug where performing a topological sort in certain
situations resulted in not all elements appearing in the sort.

compiler/call_graph.m:
compiler/process_file.m:
compiler/propagate.m:
	Minor changes to use the new relation.m.
1996-10-21 02:01:41 +00:00
Fergus Henderson
51c7531923 Comment out `:- import_module writeln'.
Estimated hours taken: 0.25

profiler/{generate_output.m,prof_debug.m,propagate.m}:
	Comment out `:- import_module writeln'.
	Move lots of `:- import_module' declarations from the interface
	to the implementation sections.
1996-04-20 20:06:38 +00:00
Peter Ross
2912f73674 Rewrite of the profiler so that it handles cycles in the call graph more
Estimated hours taken: 20

Rewrite of the profiler so that it handles cycles in the call graph more
gracefully.

profiler/propagate.m:
	Now we build a map of all the cycles as we do a dfs search on the call
	graph.  Then we use this data to fill out the prof_info structure in
	a meaningful manner.

profiler/prof_info.m:
	Divide the prof_info structure into two.  We now have seperate
	structures for cycles and single predicates.

profiler/*.m:
	Minor changes to make sure that we print out the data in the correct
	manner.
1996-04-20 09:46:24 +00:00
Fergus Henderson
a937c9ec16 Check for division by zero.
Estimated hours taken: 0.5

profiler/{generate_output.m,output.m,propagate.m}:
	Check for division by zero.
1996-03-26 14:12:55 +00:00
Peter Ross
22179ffd06 By default the profiler now only generates the flat profile.
Estimated hours taken: 1

profiler/*.m:
	By default the profiler now only generates the flat profile.  To
	generate the call graph profile as well.  One needs to turn the -c
	option on.
1996-03-19 00:06:37 +00:00
Fergus Henderson
ea2fc6a24e Fix spelling error: "propagate", not "propogate".
profiler/*:
	Fix spelling error: "propagate", not "propogate".
1995-09-11 06:43:28 +00:00