Commit Graph

9 Commits

Author SHA1 Message Date
Zoltan Somogyi
3364b69e34 Simplify a test. 2023-05-02 02:22:46 +10:00
Zoltan Somogyi
d23c4f74a3 Update the style of more tests. 2020-10-06 19:20:18 +11:00
Zoltan Somogyi
33eb3028f5 Clean up the tests in half the test directories.
tests/accumulator/*.m:
tests/analysis_*/*.m:
tests/benchmarks*/*.m:
tests/debugger*/*.{m,exp,inp}:
tests/declarative_debugger*/*.{m,exp,inp}:
tests/dppd*/*.m:
tests/exceptions*/*.m:
tests/general*/*.m:
tests/grade_subdirs*/*.m:
tests/hard_coded*/*.m:
    Make these tests use four-space indentation, and ensure that
    each module is imported on its own line. (I intend to use the latter
    to figure out which subdirectories' tests can be executed in parallel.)

    These changes usually move code to different lines. For the debugger tests,
    specify the new line numbers in .inp files and expect them in .exp files.
2015-02-14 20:14:03 +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
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
2ebbaa1a16 Add two modules that implement sets using balanced trees.
Estimated hours taken: 12
Branches: main

Add two modules that implement sets using balanced trees. At the moment,
one of those modules is used in llds_out, and this speeds up the compiler
by about one percent when using the LLDS backend. (When generating code
using an MLDS backend, the speed is not affected.)

I have tried out replacing set_ordlist with set_ctree234 as the default
implementation of sets, but this slowed down the compiler by about 9%
in the usual case, which is too much, although it did improve its performance
slightly on some inputs with large predicates, which are a kind of worst-case
situation for sets implemented as lists. Accordingly, I won't commit any
changes to set.m. However, to make such changes easier in the future, I have
removed the dependence of some test cases on the fact that sets are currently
implemented as sorted lists.

library/set_tree234.m:
	Add this module, which implements sets as 2-3-4 trees. The
	implementation is patterned after tree234.m, but stored only
	single elements in nodes instead of key-value pairs. It has
	better worst-case behavior than our current standard implementation
	of sets, set_ordlist (in particular it has logarithmic search time),
	but worse constant factors.

library/set_ctree234.m:
	Add this module, which implements sets as 2-3-4 trees augmented with
	set cardinality. This has the same virtues as set_tree234.m, but also
	allows it to be linear in the smaller input for operations such as
	union that must be linear in the size of one input set or the other.

library/library.m:
NEWS:
	Mention the new modules.

compiler/llds_out.m:
	Use set_tree234.m instead of a map with dummy values.

compiler/mercury_compile.m:
	Delete an unnecessary import.

tests/hard_coded/relation_test.{m,exp}:
	Change this test case to convert sets to ordered lists before printing
	them out, to make the test independent of the representation of sets.

tests/hard_coded/string_alignment_bug.m:
	Change this test case to use set_ordlist instead of plain sets.
2005-01-21 03:32:20 +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
Zoltan Somogyi
050ab68975 Fix spelling error in comment.
Estimated hours taken: 0.1

tests/hard_coded/string_alignment_bug.m:
	Fix spelling error in comment.
2001-01-15 00:39:50 +00:00
Fergus Henderson
f6a879896d Fix a bug where copy/2 was returning bogus data when copying string literals.
Estimated hours taken: 2

Fix a bug where copy/2 was returning bogus data when copying string literals.

runtime/mercury_deep_copy_body.h:
	Change the code so that it doesn't assume that string literals
	must be aligned, since currently they aren't.

tests/hard_coded/Mmakefile:
tests/hard_coded/string_alignment_bug.m:
tests/hard_coded/string_alignment_bug.exp:
	Add a regression test.
1999-03-24 04:22:18 +00:00