Commit Graph

202 Commits

Author SHA1 Message Date
David Jeffery
29baab7783 Fix a bug reported by petdr on October 30th last year.
Estimated hours taken: 12

Fix a bug reported by petdr on October 30th last year.

compiler/polymorphism.m:
        When looking up the variable which contains a typeclass info for
        a particular constraint to be passed to a call, handle the case where
        there is *no* variable for such a constraint. This occurs in the case
        where the producer of the variable occurs later on in the goal (but
        will get re-ordered by the mode checker). The solution is to just
        create a variable for the typeclass info, and whenever creating
        a `head' variable to hold a constraint being produced by a call,
        check first whether there is already a variable allocated for that
        constraint.

doc/reference_manual.texi:
        Delete mention of this bug from the "Known Bugs"  in the existential
        types section.

tests/hard_coded/typeclasses/Mmakefile:
tests/hard_coded/typeclasses/reordered_existential_constraint.exp:
tests/hard_coded/typeclasses/reordered_existential_constraint.m:
        A test case for this. (Not the same as petdr's original test case,
        but much simpler and exhibits the same bug).
2001-02-12 05:14:58 +00:00
Fergus Henderson
87349dbdde Fix some formatting errors
Estimated hours taken: 0.25

doc/reference_manual.texi:
doc/user_guide.texi:
	Fix some formatting errors
	(s/@item/@itemx/ in appropriate places).
2001-01-11 09:34:22 +00:00
Simon Taylor
550e253206 Allow field access functions to take extra arguments.
Estimated hours taken: 5

Allow field access functions to take extra arguments.
Change the field update function names from `'field:='/2' to `'field :='/2'.

compiler/make_hlds.m:
        Handle field names with arguments.

compiler/hlds_pred.m:
        Add " :=" as the suffix for a field update function,
        rather than ":=".

compiler/typecheck.m:
        Update instances of `field:='/2 in comments.

compiler/det_util.m:
compiler/simplify.m:
        `det_info_vartypes' was defined using the `field:=' syntax.
        Change it into a normal predicate for bootstrapping.

library/array.m:
library/bt_array.m:
library/map.m:
        Add field access functions `elem/2' and `'elem :='/3'.
        For maps, the `elem' function calls `map__search',
        so add field access functions `det_elem' and `det_elem :='
        to call `map__lookup' and `map__det_update'.

NEWS:
doc/reference_manual.tex:
        Document the changes.

        Improve readability by changing occurrences
        of `X^field' to `X ^ field'.

tests/hard_coded/typeclasses/record_syntax.{m,exp}:
        Test field names with arguments.

tests/invalid/record_syntax_errors.err_exp:
	Update the expected output.
2000-12-13 00:00:55 +00:00
Mark Brown
35cb0d2267 Update remaining occurrences of the old mode syntax.
Estimated hours taken: 0.1

doc/reference_manual.texi:
	Update remaining occurrences of the old mode syntax.
2000-11-17 05:52:47 +00:00
Simon Taylor
47f1ab1b04 Commit Fergus' suggested improvements for my last change.
Estimated hours taken: 0.1

doc/reference_manual.texi:
	Commit Fergus' suggested improvements for my last change.
2000-11-07 11:09:47 +00:00
Simon Taylor
9aeb9ca557 Add a reference to the "DCG-goals" section from the
Estimated hours taken: 0.1

doc/reference_manual.texi:
	Add a reference to the "DCG-goals" section from the
	"Record syntax" section, to make it easier to
	find the DCG record syntax goals.
2000-11-07 00:47:45 +00:00
David Jeffery
ccb7abc9ba Change the table of builtin operators section so that it uses `@example'
Estimated hours taken: 1

doc/reference_manual.texi:
        Change the table of builtin operators section so that it uses `@example'
        for the table layout, rather than `@multitable', which texi2html does
        not handle properly. This fixes a bug reported by Ralph Becket.
2000-11-01 02:06:25 +00:00
Peter Ross
f90a1f16cc Fix some syntax and semantic errors in an example of instance
Estimated hours taken: 0.25

reference_manual.texi:
    Fix some syntax and semantic errors in an example of instance
    declarations.
2000-10-30 15:50:40 +00:00
Fergus Henderson
12788ee29c Disable the `factt_non' test case in hl* grade,
Estimated hours taken: 0.25

tests/hard_coded/Mmakefile:
	Disable the `factt_non' test case in hl* grade,
	since we don't pass it.

doc/reference_manual.texi:
	Document that nondet fact tables are not supported by the
	`--high-level-code' back-end.
2000-10-24 01:10:08 +00:00
Simon Taylor
2c1efdf543 Fix a bug reported by Ralph Becket which caused a compiler abort
Estimated hours taken: 1

Fix a bug reported by Ralph Becket which caused a compiler abort
if the user declared the modes but not the types for a field
access function.

compiler/typecheck.m:
	In the clause introduced when the user declares the modes
	of a field access function, make sure the var-functor
	unification can only be interpreted as a field access,
	not a recursive function call.

	Add field labels to the typecheck_info type.

tests/invalid/record_syntax_errors.m:
tests/invalid/record_syntax_errors.err_exp:
	Add a test case.

doc/reference_manual.texi:
	Clarify the documentation.
2000-10-10 06:23:32 +00:00
Simon Taylor
3cf329a739 Fix bugs in explicit type qualification.
Estimated hours taken: 4

Fix bugs in explicit type qualification.

compiler/make_hlds.m:
	Make the code to handle type qualification expressions match
	the documentation. Variables occurring in type qualifications
	but not in the predicate's argument types are local to the
	clause in which they occur.

	Don't export clauses_info_init -- it's not used anywhere else.

	Add field labels to the qual_info type.

compiler/hlds_pred.m:
compiler/*.m:
	Add a field to the clauses_info to contain the mapping from
	type variable names to type variables for the head types.
	This needs to be maintained because type variables added
	while processing type qualifications in a clause should
	not be added to the map used for other clauses.

compiler/typecheck.m:
	Apply substitutions to the explicit vartypes at the end
	of each pass of typechecking to keep them in sync with
	the type variables in the argument types.

compiler/type_util.m:
	Add a predicate type_util__apply_variable_renaming_to_type_map
	for use by typecheck.m.

doc/reference_manual.texi:
	Add some more comments about the handling of explicit type
	qualifications to the documentation about valid type assignments.

	Change references to existential type _qualifiers_ to consistently
	refer to existential type _quantifiers_.

tests/hard_coded/type_qual.{m,exp}:
	Add some more tests.

tests/hard_coded/Mmakefile:
	Pass `--infer-all' to mmc when compiling type_qual.m.
2000-09-25 04:23:19 +00:00
Fergus Henderson
8d811e2b09 Enable the support for explicit type qualification,
Estimated hours taken: 1.5

Enable the support for explicit type qualification,
using `with_type` as the operator.

compiler/make_hlds.m:
compiler/hlds_out.m:
	Use `with_type` as the type qualification operator.

tests/hard_coded/type_qual.m:
tests/hard_coded/type_qual.inp:
tests/hard_coded/type_qual.exp:
	Test the new feature.

doc/reference_manual.texi:
	Document the new feature.
	Also make a few improvements to the documentation of
	data-terms, record syntax, and variable scoping.

NEWS:
	Mention the new feature.
2000-09-21 09:44:05 +00:00
Fergus Henderson
da9dc64c8f Allow typeclass instance declarations to contain more than one clause
Estimated hours taken: 5

Allow typeclass instance declarations to contain more than one clause
for each method.

Also improve some error messages.

compiler/check_typeclass.m:
	Allow typeclass instance declarations to contain more than one
	clause for each method, by combining the different clauses
	for each method into a single definition.

	Rewrite the code to check for bogus method names in instance
	declarations.  This rewrite was necessitated by the change
	mentioned above, but also improved the quality of the error
	message (it now prints the name of the bogus method)
	and fixed some bugs that sometimes resulted in spurious
	flow-on error messages.

	Fix some problems where we were not passing the correct arity
	for functions (e.g. to make_introduced_pred_name).

tests/invalid/Mmakefile:
tests/invalid/typeclass_bogus_method.m:
tests/invalid/typeclass_bogus_method.err_exp:
	Add a new regression test.

tests/invalid/tc_err*.err_exp:
tests/invalid/typeclass_test_*.err_exp:
	Update the expected output for these test cases,
	to reflect the improved error messages.

doc/reference_manual.texi:
	Update the documentation to reflect this change.

NEWS:
	Mention that we now allow clauses in instance declarations.
2000-09-20 11:59:46 +00:00
Fergus Henderson
db94d0e0ab Apply Ralph Beckett's suggested fix for some wording problems
Estimated hours taken: 0.25

doc/reference_manual.texi:
	Apply Ralph Beckett's suggested fix for some wording problems
	with the restrictions on typeclass instances.
2000-09-20 11:45:37 +00:00
David Jeffery
6cfb9823f3 Add the list of valid operators to the reference manual.
Estimated hours taken: 2

Add the list of valid operators to the reference manual.

doc/reference_manual.texi:
        Add a table of valid operators.
library/ops.m:
        Add a note indicating that reference_manual.texi needs to be kept
        in sync with the operator table.
2000-09-19 04:46:50 +00:00
Simon Taylor
46a8da81cb Implement builtin tuple types, similar to those in Haskell.
Estimated hours taken: 30

Implement builtin tuple types, similar to those in Haskell.

Tuples are constructed and deconstructed using
the syntax X = {Arg1, Arg2, ...}.
Tuples have type `{Arg1, Arg2, ...}'.

Unary tuples (X = {Arg}) do work, unlike in Haskell. The rationale
for this is that it is useful to be able to construct unary tuples
to be passed to a polymorphic predicate which uses std_util__deconstruct
to deal with a tuple of any arity. Since this is probably the only
use for unary tuples, it's not really worth the effort of treating
them as no_tag types, so we don't.

The type-infos for tuples have the same structure as for higher-order
types. There is a single type_ctor_info for tuples, and the arity
is placed before the argument type_infos.

library/parser.m:
	Change the way '{}/N' terms are parsed, so that the parsed
	representation is consistent with the way other functors
	are represented (previously the arguments were left as
	unparsed ','/2 terms). This avoids special case code
	in prog_io__parse_qualified_term, term__term_to_type
	and term__type_to_term.

compiler/prog_io_dcg.m:
compiler/prog_io_util.m:
	Handle the new structure of '{}/N' terms when parsing DCG escapes
	by converting the argument list back into a single ','/2 term.

compiler/module_qual.m:
	Treat tuples as a builtin type.

compiler/typecheck.m:
	Typecheck tuple constructors.

compiler/mode_util.m:
	Propagate types into tuple bound insts.

compiler/type_util.m:
	Add type_is_tuple/2 and type_id_is_tuple/1 to identify tuple types.
	Add tuples to the list of types which are not atomic types.

	Handle tuple types in `type_constructors' and
	`get_cons_id_arg_types' and `switch_type_num_functors'.

compiler/tabling.m:
	Handle tabling of tuples.

compiler/term_util.m:
	Handle tuples in the code to compute functor norms.

compiler/magic_util.m:
compiler/rl.m:
compiler/rl_key.m:
	Handle tuple types in the Aditi back end.

compiler/mercury_to_mercury.m:
library/io.m:
library/term_io.m:
	Handle output of '{}/N' terms.

compiler/higher_order.m:
compiler/simplify.m:
	Don't specialize complicated unifications of tuple
	types into calls to a specific unification procedure --
	even if the procedure were implemented, it probably
	wouldn't be that much more efficient.

compiler/unify_proc.m:
	Generate unification procedures for complicated unifications
	of tuples (other than in-in unifications). These are generated
	lazily as required.

compiler/make_hlds.m:
	Export add_special_pred for use by unify_proc.m.

compiler/polymorphism.m:
	Export polymorphism__process_pred for use by unify_proc.m.

compiler/bytecode_gen.m:
compiler/code_util.m:
compiler/ml_code_util.m:
	Handle unify procedure names and tags for tuple types.

compiler/mlds_to_c.m:
	Output tuple types as MR_Tuple.

compiler/ml_unify_gen.m:
	Compute the field types for tuples.

compiler/polymorphism.m:
compiler/pseudo_type_info.m:
	Treat tuple type_infos in a similar way to higher-order type_infos.

compiler/hlds_data.m:
	Document how cons_ids for tuple types are represented.

compiler/switch_gen.m:
compiler/table_gen.m:
	Add tuple types to switches on type_util__builtin_type.

compiler/llds_out.m:
util/mdemangle.c:
profiler/demangle.m:
	Transform items named "{}" to "f_tuple" when mangling symbols.

library/builtin.m:
	Define the type_ctor_info used for tuples.

library/private_builtin.m:
	Add `builtin_unify_tuple/2' and `builtin_compare_tuple/3',
	both of which abort. All comparisons and in-in unifications
	of tuples are performed by the generic unification functions
	in runtime/mercury_ho_call.c and runtime/mercury.c.

library/std_util.m:
	Implement the various RTTI functions for tuples.

	Encode tuple `TypeCtorDesc's in a similar way to that
	used for higher-order types. This has the consequence that the limit
	on the arity of higher-order types is now MAX_VIRTUAL_REG,
	rather than 2*MAX_VIRTUAL_REG.

	Avoid calling MR_GC_free for the type-info vector returned
	from ML_expand() for tuples because unlike the vectors
	for du types, it is not copied.

runtime/mercury_type_info.h:
	Add macros for extracting fields from tuple type-infos.
	These just call the macros for extracting fields from higher-order
	type-infos.

	Add a macro MR_type_ctor_rep_is_variable_arity(), which
	returns TRUE for tuples and higher-order types.

	The distinction between higher-order and first-order types
	is now misnamed -- the distinction is really between fixed arity
	types and builtin variable arity types. I'm not sure whether
	it's worth renaming everything.

runtime/mercury.h:
runtime/mercury.c:
	Define unification and comparison of tuples in
	high-level code grades.

runtime/mercury_deep_copy_body.h:
runtime/mercury_make_type_info_body.h:
runtime/mercury_tabling.c:
runtime/mercury_unify_compare_body.h:
	Handle tuple types in code which traverses data using RTTI.

tests/hard_coded/construct.{m,exp}:
tests/hard_coded/expand.{m,exp}:
	Test RTTI functions from std_util.m applied to tuples.

tests/hard_coded/tuple_test.{m,exp}:
	Test unification, comparison, term_to_type etc. applied to tuples.

tests/hard_coded/deep_copy.{m,exp}:
	Test deep copy of tuples.

tests/hard_coded/typeclasses/tuple_instance.{m,exp}:
	Test instance declarations for tuples.

tests/tabling/expand_tuple.{m,exp}:
	Test tabling of tuples.

tests/hard_coded/write.m:
	Add some module qualifications for code which uses
	`{}/1' constructors which are not tuples.

tests/invalid/errors2.{m,err_exp,err_exp2}:
	Test handling of tuples in type errors messages.

NEWS:
doc/reference_manual.texi:
w3/news/newsdb.inc:
	Document tuples.

doc/transition_guide.texi:
	Document the change to the parsing of '{}/N' terms.
2000-09-18 11:53:19 +00:00
Fergus Henderson
4d0dff1860 Allow typeclass instance declarations to contain clauses, as an
Estimated hours taken: 10

Allow typeclass instance declarations to contain clauses, as an
alternative to the current `pred(<MethodName>) is <ImplName>)' syntax.
This avoids the need for the user to explicitly define names for
procedures that just implement type class methods.

XXX Note that currently we only permit one clause per method.

compiler/prog_data.m:
	Change the second `sym_name' field of `instance_method'
	into a new type `instance_proc_def', which has two alternatives.
	The first, `name(sym_name)', is for the old syntax.
	The second, `clauses(list(item))', is for the new syntax.

compiler/prog_io_typeclass.m:
	Parse the new syntax.

compiler/make_hlds.m:
	Add new predicate `produce_instance_method_clauses',
	for use by check_typeclass.m.  This handles the generation of
	HLDS clauses_infos for both the old and new syntax for
	instance method definitions.
	Return the qual_info produced by `parse_tree_to_hlds',
	so that it can be passed to `produce_instance_method_clauses'.

compiler/mercury_compile.m:
	Pass the qual_info returned by make_hlds.m to check_typeclass.m.

compiler/check_typeclass.m:
	Move the code which produces HLDS definitions for instance
	methods into `produce_instance_method_clauses' in make_hlds.m.
	Thread the io__state and qual_info throughout most of the code,
	since this they are needed to process the new syntax.
	(The io__state is needed so we can spit out warnings about
	singleton variables in clauses in type class methods, and
	the qual_info is needed to handle explicit type qualifiers
	in such clauses.)

compiler/mercury_to_mercury.m:
	Output the new syntax.

tests/hard_coded/typeclasses/Mmakefile:
tests/hard_coded/typeclasses/instance_clauses.m:
tests/hard_coded/typeclasses/instance_clauses.exp:
	A test case for the new feature.

doc/reference_manual.texi:
	Document the new feature.
2000-09-16 00:08:32 +00:00
Tyson Dowd
401298c013 Make the syntax for defining modes and insts similar to type equivalence.
Estimated hours taken: 2

Make the syntax for defining modes and insts similar to type equivalence.

Old syntax:
	:- inst foo = someinstdefn.
	:- mode foo :: someinst -> someotherinst.

New syntax:
	:- inst foo == someinstdefn.
	:- mode foo == someinst >> someotherinst.

The old syntax is still supported.  For `::' and `->' it may eventually
be phased out (but it doesn't cause many problems apart from possible
confusion of users, so it's a low priority).

In the case of `:- inst' we could already use `==' or `=', however we
now make `==' the standard syntax.  Again, we support both and probably
will for quite some time.

NEWS:
	Mention these changes.

compiler/prog_io.m:
	Make `==' the standard operator for `:- inst <InstDefn>.'
	declarations.

	Make `==' and `>>' the standard operators for
	`:- mode foo == someinst >> someotherinst'.
	`::' and `->' are still supported.

compiler/prog_io_util.m:
	Make `>>' the standard operator for inline mode declarations.
	`->' is still supported.

doc/reference_manual.texi:
	Update the syntax in the reference manual.
	Mention that `::' and `->' is deprecated.

tests/valid/Mmakefile:
tests/valid/mode_syntax.m:
	Add a new test of the new syntax.

compiler/fact_table.m:
	Fix a typo (missing quote) in the verbose messages for fact tables.
2000-09-15 11:25:02 +00:00
Tyson Dowd
db64a3588d Add MR_ prefixes to the types used when generating C code.
Estimated hours taken: 4

Add MR_ prefixes to the types used when generating C code.
This means types such as Word, String, Bool, Float become MR_Word,
MR_String, MR_Bool, MR_Float.  Also define MR_Box for both the LLDS and
MLDS backends so we can use it uniformly.

This is very important in environments where String or Bool have already
been used as system types (for example, managed C++).  And besides, we
should do it anyway as part of the grand namespace cleanup.

I have fixed all of the uses of the non-prefixed types in the runtime
and trace directories.  I haven't done it for the library and compiler
directories yet (no promises that I will do it in future either).  But
if you see a non-prefixed type in code from now on, please consider it a
bug and fix it.

mercury_bootstrap.h contains #defines to map the non-prefixed types into
the prefixed ones.  Like many of the other namespace cleaning backwards
compatibility macros, this can be turned off with
MR_NO_BACKWARDS_COMPAT.

This shouldn't break any code, but this kind of change affects so many
things that of course there could be problems lurking in there somewhere.

If you start getting errors from the C compiler after this change is
installed, you will want to make sure you at least have the runtime
system updated so that you are getting the backwards compatibility
definitions in mercury_bootstrap.h.  Then if you continue to have
problems you can bug me about it.

compiler/export.m:
compiler/llds_out.m:
compiler/mlds_to_c.m:
	Use MR_Word, MR_Float, MR_Bool, etc when generating C.

doc/reference_manual.texi:
	Update the reference manual to talk about MR_Word, MR_String,
	MR_Char, etc.

runtime/mercury_bootstrap.h:
	Add bootstrapping typedefs.

runtime/*:
trace/*:
	Change Word, Float, Bool, Code, String, etc to
	MR_Word, MR_Float, MR_Bool, MR_Code, MR_String.
2000-08-03 06:19:31 +00:00
Simon Taylor
7b5b1c0a34 Minor improvements to the Aditi documentation.
Estimated hours taken: 1

Minor improvements to the Aditi documentation.

doc/reference_manual.texi:
doc/user_guide.texi:
	Fix the formatting of the Aditi entries in the menus -- texinfo
	doesn't like @ifset commands in menus.

	Remove references to extras/aditi. The transaction interface
	is distributed as part of Aditi.

	State that Aditi memoing doesn't work yet.
2000-06-01 08:47:37 +00:00
Simon Taylor
bbbac5099a The Aditi transaction paper published a few years ago contained
Estimated hours taken: 0.5

The Aditi transaction paper published a few years ago contained
a small error which I included in my code -- the state arguments
passed into queries to ensure that database predicates are only
called from within a transaction should have mode `mui' rather
than `ui'. Compiling queries with the alias branch mode checker
confirms this.

Because `mui' modes do not yet work on the main branch, `aditi_mui'
(equivalent to `in') is used instead. This change replaces
all instances of `aditi_ui' with `aditi_mui'.

compiler/*.m:
doc/*.texi:
extras/aditi/*:
tests/valid/aditi*.m:
tests/invalid/aditi*.m:
	s/aditi_ui/aditi_mui
2000-05-05 06:08:23 +00:00
Tyson Dowd
79d75acdb0 Add impure functions to Mercury, clean up the purity module somewhat,
Estimated hours taken: 30

Add impure functions to Mercury, clean up the purity module somewhat,
fix some bugs in purity, update and expand the purity documentation,
and re-organize the purity checks.

Impure functions can be declared just like impure preds.
However, they can only be called in an explicit unification preceeded
by a purity level:

	impure X = some_impure_func(Y, Z)

The bug fixed was the fact that closures of impure predicates
were only being detected when using lambda syntax.  Purity information
was discarded and impure closures could be created like this:

	Pred = some_impure_pred

You could then use this predicate anywhere you like without any purity
declarations.

compiler/hlds_module.m:
	Add get_pred_id pred which will return the pred_id of a
	predicate matching a given type.  This is like
	get_pred_and_proc_id, but only gets the information we are
	interested in, and is semidet.
	We need a semidet version to handle cases where type inference
	cannot infer a type before the limit is reached, but we try to
	purity check this code.  (The bug mentioned above was stopping
	us from purity checking the test case for this before).

compiler/make_hlds.m:
	Check for "impure" unifications with expressions that are not
	function calls and issue appropriate error messages.
	When unravelling impure function call unifications, put the input
	parameter unifications (if any) before the actual call.
	Only mark the goal_info for the function call as impure.

compiler/mercury_to_goedel.m:
compiler/mercury_to_mercury.m:
compiler/module_qual.m:
compiler/prog_data.m:
compiler/prog_io.m:
compiler/prog_io_dcg.m:
compiler/prog_io_goal.m:
compiler/prog_util.m:
	Add purity information to unify goals.
	Don't assume unify goals are pure.

compiler/purity.m:
	Allow impure functions.
	Check unification goals for purity (not just lambda unification).
	Check unifications that are transformed into calls to make sure
	the call is purity correct.
	Put purity checking logic into separate predicates.
	Use an enum to return different errors and warnings.
	(The last two changes make it much easier to see the
	similarities between checking goals and checking predicates for
	purity correctness).
	Give different error messages for impure functions (highlight
	that you need to use them in an explicit unification).
	Handle unknown predicate lookups (can occur when unifying with
	a higher order term whose type could not be inferred).
	Add a few comments delineating where changes might need to be
	made to make foreign code impure by default in future.

compiler/notes/authors.html:
	Add Peter Schachte to the authors list.

doc/reference_manual.texi:
	Document impure functions.
	Expand more on what impure predicates/functions can do.
	Explain the concept of worst purity, and use it to explain the
	"inferred purity"/"declared purity" concepts.
	Make it more explicit that only impure goals obey
	strict-sequential like semantics.

tests/invalid/type_inf_loop.err_exp2:
	Fix this test case to reflect the new error message new that we
	check the purity of this code correctly (or rather, we correctly
	fail to be able to purity check this code).

tests/hard_coded/Mmakefile:
tests/hard_coded/purity.exp:
tests/hard_coded/purity.m:
tests/hard_coded/purity/Mmakefile:
tests/hard_coded/purity/impure_func_t1.m:
tests/hard_coded/purity/purity.m:
tests/hard_coded/purity/runtests:
	Remove purity tests from the hard_coded directory, give it a
	sub-directory of its own.

tests/invalid/Mmakefile:
tests/invalid/purity.err_exp:
tests/invalid/purity.m:
tests/invalid/purity_nonsense.err_exp:
tests/invalid/purity_nonsense.m:
tests/invalid/purity/Mmakefile:
tests/invalid/purity/impure_func_t2.err_exp:
tests/invalid/purity/impure_func_t2.m:
tests/invalid/purity/impure_func_t3.err_exp:
tests/invalid/purity/impure_func_t3.m:
tests/invalid/purity/impure_func_t4.err_exp:
tests/invalid/purity/impure_func_t4.m:
tests/invalid/purity/impure_func_t5.err_exp:
tests/invalid/purity/impure_func_t5.m:
tests/invalid/purity/impure_pred_t1.err_exp:
tests/invalid/purity/impure_pred_t1.m:
tests/invalid/purity/impure_pred_t2.err_exp:
tests/invalid/purity/impure_pred_t2.m:
tests/invalid/purity/purity.err_exp:
tests/invalid/purity/purity.m:
tests/invalid/purity/purity_nonsense.err_exp:
tests/invalid/purity/purity_nonsense.m:
tests/invalid/purity/runtests:
	Remove purity tests from the invalid directory, give it a
	sub-directory of its own.
2000-04-22 07:12:53 +00:00
Simon Taylor
20938c3dec Uncomment the Aditi sections of the Mercury documentation.
Estimated hours taken: 1

doc/reference_manual.texi
doc/user_guide.texi
	Uncomment the Aditi sections of the Mercury documentation.
2000-04-20 06:26:42 +00:00
Simon Taylor
7622eb1d36 Finish the implementation of Aditi updates.
Estimated hours taken: 120

Finish the implementation of Aditi updates.

compiler/hlds_goal.m:
	Refactor the aditi_builtin type so that operations with
	similar syntax and implementations are grouped together.

	Add operations to delete a single tuple (`aditi_delete') and
	to modify tuples (`aditi_bulk_modify').

compiler/*.m:
	Minor changes required by refactoring the aditi_builtin type.

compiler/make_hlds.m:
	Parse `aditi_delete' and `aditi_bulk_modify' goals.

	Parse a nicer syntax for `aditi_bulk_delete' and
	`aditi_bulk_insert' goals
	(e.g. aditi_bulk_delete(p(_, X, _) :- X > 2)).

compiler/rl_out.pp:
	For each base relation, generate RL procedures to apply
	deletions and modifications to the relation. `aditi_bulk_modify'
	takes a closure which produces tuples which contain both the
	attributes of the tuple to delete and the tuple to insert. The
	modification RL procedure performs two projections on the
	closure result to produce the tuples to delete and the tuples
	to delete.

	The input stream to the rl_PROC_delete RL instruction must contain
	only tuples taken from the relation to delete from -- the deletion
	is done using the tuple-id rather than the tuple contents.
	The generated deletion procedure performs a semi-join of the
	relation to delete from with the relation containing the
	tuples to delete.

compiler/rl.m:
	Add predicates to generate the names of the modification
	and deletion RL procedures generated for each base relation.

compiler/rl_exprn.m:
	Generate the projection expressions required by the modification
	RL procedures generated for each base relation.

	Generate the equi-join expressions required by the modification
	and deletion RL procedures generated for each base relation.

compiler/unify_gen.m:
	Implement code generation for `aditi_bottom_up' closures.

compiler/rl.m:
compiler/magic.m:
	Factor out the code used to create the name of the RL procedure
	used to interface top-down Mercury to Aditi, for use by unify_gen.m
	to generate `aditi_bottom_up' closures.

compiler/code_util.m:
	Add predicate code_util__make_user_proc_label, which constructs
	a label name from the given all the individual pieces of information
	used to construct it, rather than just a pred_id and proc_id.
	This is used to produce the RL procedure name for an `aditi_bottom_up'
	closure, so that the code doesn't have to work out what the pred_id
	of the magic sets transformed procedure is.

compiler/magic.m:
	Always create new procedures to interface Mercury to Aditi,
	to make it easier for unify_gen.m to work out what the name
	of the interface procedure is -- don't optimize the case of
	a predicate with no input arguments.

	Alter the goal generated for the interface procedures so
	that it doesn't matter whether the interface procedure
	and the procedure it interfaces to are compiled together
	by rl_gen.m -- the old code generated for these procedures
	assumed they were compiled separately, which wasn't always the
	case.

	Don't pass a `magic_info' through the code to generate the
	C interface procedures -- only the module_info field was
	required.

compiler/magic_util.m:
compiler/magic.m:
compiler/context.m:
	Don't pass a `magic_info' through
	magic_util__create_input_test_unifications --
	only the module_info and proc_info fields were used.

compiler/post_typecheck.m:
compiler/magic_util.m:
	Don't report errors for the second `aditi__state' argument
	of the closure passed to `aditi_bulk_modify'.

compiler/purity.m:
	Change the mode of the second `aditi__state' argument
	of the closure passed to `aditi_bulk_modify' to `unused'.

compiler/call_gen.m:
	Generate `aditi_delete' and `aditi_bulk_modify'.

	Remove the `aditi__state' from the tuple to insert passed
	to an `aditi_insert' or `aditi_delete' operation -- the relation
	on disk does not contain the `aditi__state' attribute.

extras/aditi/aditi.m:
	Implement the updates.

	Allocate all memory on the Mercury heap to avoid memory
	leaks when a transaction aborts.

	Uncaught exceptions within a transaction now cause
	the transaction to abort, and the exception is rethrown
	to the caller.

	If using trailing, add trail entries for the output relation
	and cursor created for a call to an Aditi procedure, so that
	they will be cleaned up if only one solution of the call
	is needed or if an exception is thrown.

	Include line numbers in the debugging messages if an Aditi API
	function fails.

compiler/llds.m:
compiler/*.m:
	Rename the `do_aditi_modify' label to `do_aditi_bulk_modify' -- we
	may eventually want to implement a modification goal type which
	doesn't produce all modified tuples before applying the update.

doc/reference_manual.texi:
	Document `aditi_delete' and `aditi_bulk_modify'.

	Add some extra spacing in the Aditi update section to
	improve readability.

tests/valid/aditi_update.m:
tests/invalid/aditi_update_errors.m:
tests/invalid/aditi_update_errors.err_exp:
tests/invalid/aditi_update_mode_errors.m:
tests/invalid/aditi_update_mode_errors.err_exp:
	Changed to fit in with the new syntax.

tests/valid/Mmakefile:
	Code generation for Aditi updates now works, so enable full
	compilation of the aditi_update.m test case, rather than
	just checking for errors.
2000-04-14 08:39:24 +00:00
Fergus Henderson
83660cb0c8 Apply some corrections that Warwick spotted in his
Estimated hours taken: 0.25

Apply some corrections that Warwick spotted in his
review of my recent trailing changes.

runtime/mercury_context.c:
	Fix a couple of bugs in init_context(): the ticket_counter
	should be initialized to 1, not 0, and we need to also
	initialize the ticket_high_water field.

compiler/notes/trailing.html:
doc/reference_manual.texi:
	Fix typos.
2000-03-22 14:45:43 +00:00
Fergus Henderson
a636a6ba82 Fix an inconsistency in the manual, which was using
Estimated hours taken: 0.25

doc/reference_manual.texi:
	Fix an inconsistency in the manual, which was using
	`multidet' and `multi' inconsistently: s/multidet/multi/g

library/string.m:
	Use `multi' rather than `multidet', to match the
	language reference manual.
2000-03-20 09:01:49 +00:00
Fergus Henderson
84c8146d0d Fix several bugs in the trail handling.
Estimated hours taken: 20

Fix several bugs in the trail handling.
Also improve the documentation of trailing, and add a new macro
MR_choicepoint_newer() to the public trailing interface.

The bugs which this change fixes are:
  - choice point ids were being reused after commits,
    rather than only after backtracking;
  - for if-then-elses with nondet conditions, the generated code was
    using MR_commit rather than MR_solve as the MR_untrail_reason;
  - for semidet disjunctions, when committing to a particular disjunct
    the generated code was not calling MR_reset_ticket(..., MR_commit)
    to invoke function trail entries, and was also leaking a trail ticket
  - the all-solutions predicates in std_util.m were leaking trail
    tickets (i.e. allocating them but not pruning or discarding them).

runtime/mercury_trail.h:
runtime/mercury_regorder.h:
runtime/mercury_regs.h:
runtime/mercury_wrapper.c:
runtime/mercury_context.h:
runtime/mercury_engine.h:
	A bunch of changes to add a new virtual register
	`MR_ticket_high_water':
	- in mercury_trail.h, add MR_ticket_high_water_var variable;
	- in mercury_regorder.h, add MR_ticket_high_water macro;
	- in mercury_regs.h, add MR_TICKET_HIGH_WATER_RN macro;
	- in mercury_wrapper.c, change
	  print_register_usage_counts() to handle
	  MR_TICKET_HIGH_WATER_RN.
	- in mercury_context.h and mercury_engine.h,
	  add code to save/restore this new register when
	  appropriate.

runtime/mercury_trail.h:
	- Change MR_store_ticket() so that it does
	  `MR_ticket_counter = ++MR_ticket_high_water'
	  rather than just `MR_ticket_counter++'.
	- Add new macros MR_prune_ticket() and MR_prune_tickets_to(),
	  which only reset MR_ticket_counter, not MR_ticket_high_water.
	- Change the old macros MR_discard_ticket() and MR_discard_tickets_to()
	  so that they reset both MR_ticket_high_water and MR_ticket_counter.
	- Add new macro MR_choicepoint_newer().
	- Enclose macro arguments in parentheses.
	- Some minor changes to the documentation.

doc/reference_manual.texi:
	Document MR_choicepoint_newer().
	Update the documentation to reflect the fact that exceptions
	are now a standard part of Mercury.
	Clarify the documentation in the "Avoiding Redundant Trailing"
	section, and add a longish example.

compiler/notes/trailing.html:
	Add some documentation on the trail and how we manage it.

compiler/llds.m:
compiler/mlds.m:
	Add new `prune_ticket' and `prune_tickets_to' instructions,
	corresponding to the new macros defined in runtime/mercury_trail.h.
	Comment out the `discard_tickets_to' instruction, since it
	is no longer used in the compiler (the MR_discard_tickets_to()
	macro is only used by library/exception.m and the debugger's
	retry command).
	Replace the duplicated documentation in mlds.m with a pointer
	to llds.m.

compiler/ite_gen.m:
compiler/code_gen.m:
compiler/code_info.m:
	Change the trail handling code generated after commits
	so that the ticket is pruned rather than discarded.

compiler/ite_gen.m:
	When generating the reset_ticket instruction for
	if-then-elses with nondet conditions, use `solve'
	rather than `commit' as the reset_trail_reason.

compiler/disj_gen.m:
	Add code to generate a reset_ticket(..., commit)
	instruction at the end of every non-last disjunct
	in semidet disjunctions.

compiler/dupelim.m:
compiler/livemap.m:
compiler/llds_common.m:
compiler/llds_out.m:
compiler/ml_elim_nested.m:
compiler/middle_rec.m:
compiler/opt_debug.m:
compiler/opt_util.m:
compiler/value_number.m:
compiler/vn_*.m:
	Trivial modifications to handle the changes to the
	trailing instructions.

library/exception.m:
	Change the trail handling code so that when the goal in an
	exception handler succeeds (rather than failing or throwing an
	exception), the trail ticket we created on entry to the
	handler is pruned rather than discarded.

library/std_util.m:
	Add a new impure predicate `discard_trail_ticket', which calls
	MR_discard_ticket(), and call it in `builtin_aggregate' and
	`do_while' to discard the ticket that gets allocated by the
	call to MR_store_ticket() in `get_registers'.
2000-03-20 05:27:30 +00:00
Fergus Henderson
6a7ade6973 Replace some old documentation about a planned
Estimated hours taken: 0.75

doc/reference_manual.texi:
	Replace some old documentation about a planned
	`unique [X]' quantifier with a description of
	the `promise_only_solution' function in the
	standard library.
2000-03-08 13:16:50 +00:00
Fergus Henderson
56b7456d88 Generalize the higher-order term syntax:
Estimated hours taken: 3

Generalize the higher-order term syntax:
in `Foo(Args)', allow Foo to be any term,
not just a variable.

doc/reference_manual.texi:
	Document the new higher-order term syntax.

library/parser.m:
	Implement the new higher-order term syntax.

tests/hard_coded/Mmakefile:
tests/hard_coded/higher_order_syntax2.m:
tests/hard_coded/higher_order_syntax2.exp:

NEWS:
	Mention this change.
2000-02-16 08:36:20 +00:00
Tyson Dowd
f9b942b30e Allow functions to be declared by supplying the determinism but not the
Estimated hours taken: 12

Allow functions to be declared by supplying the determinism but not the
modes (we assume the default modes).

compiler/make_hlds.m:
	Assume default modes if determinism is declared without modes
	in the :- func declaration.

compiler/prog_io.m:
	Don't give an error message for determinism without modes for
	function.

compiler/prog_io_goal.m:
	Update documentation to reflect default mode syntax.
	Assume default modes if determinism is declared without modes
	in lambda expressions.

compiler/prog_util.m:
	Mention that declaring modes for some but not all of the
	arguments of a function will be noticed in prog_io, so shouldn't
	be a concern in this code.

doc/reference_manual.texi:
	Document the new syntax.

tests/valid/Mmakefile:
tests/valid/func_default_modes.m:
	A test case for the new syntax.
2000-02-16 07:28:13 +00:00
Fergus Henderson
c7ae3c205f Fix some typos / formatting errors in the documentation
Estimated hours taken: 0.25

doc/reference_manual.texi:
	Fix some typos / formatting errors in the documentation
	of backquotes.
2000-02-11 05:04:05 +00:00
Fergus Henderson
5d081641d8 Some minor clarifications to the documentation of type classes.
Estimated hours taken: 0.25

doc/reference_manual.texi:
	Some minor clarifications to the documentation of type classes.
2000-02-11 05:00:36 +00:00
Fergus Henderson
fdcba4702b In the example use of c_pointer, use a no_tag type rather
Estimated hours taken: 0.25

doc/reference_manual.texi:
	In the example use of c_pointer, use a no_tag type rather
	than an equivalence type, so that type class instance
	declarations will work properly for such a type.
2000-02-08 12:18:48 +00:00
Fergus Henderson
b1522bb009 Document that equality predicates can have declartions
Estimated hours taken: 0.5

doc/reference_manual.texi:
	Document that equality predicates can have declartions
	that are more general than pred(T::in, T::in) is semidet.
2000-02-02 07:33:20 +00:00
Simon Taylor
196a91d14a Address some issues Fergus raised in his review of the record syntax
Estimated hours taken: 1

Address some issues Fergus raised in his review of the record syntax
documentation.

compiler/make_hlds.m:
tests/hard_coded/record_syntax.m:
	Change the syntax for DCG field extraction from
	`Value := ^ field' to `Value =^ field'.

NEWS:
doc/reference_manual.texi:
	Document the changed syntax.

doc/reference_manual.texi:
	Clear up the description of how to construct higher-order
	terms for field access functions.

library/ops.m:
compiler/mercury_to_mercury.m:
doc/transition_guide.texi:
	Add `=^' and `:=' to the operator table.
2000-01-25 04:10:29 +00:00
Simon Taylor
5940825cdb Implement syntax for getting and setting fields of constructors.
Estimated hours taken: 70

Implement syntax for getting and setting fields of constructors.

compiler/make_hlds.m:
	Add information about field definitions to the module_info.

	Check that user-defined field access functions for exported
	fields are also exported, otherwise predicates in other modules
	could use a different method to access a field than predicates
	in module defining the field.
	Add a `predicate preds_add_implicit_report_error' to allow that check
	to be performed for functions which are added to the module_info
	by some means other than a `:- func' declaration.

	Parse field access goals and expressions.

	Add predicates `insert_arg_unifications_with_supplied_contexts',
	and `append_arg_unification', which allow more control over
	the contexts given to the added unifications. These are
	useful because the field value for an update is really an
	argument of the inner-most update function call, while the
	input term is an argument of the outer-most function call.

compiler/prog_io_dcg.m:
	Allow DCG goals of the form `:=(DCGArg)', which unifies `DCGArg'
	with the output DCG argument, ignoring the input DCG argument.
	The rationale for this change is that if we have convenient syntax
	for updating parts of a DCG argument, we should also have convenient
	syntax for updating the whole DCG argument.

compiler/typecheck.m:
	Add a default clause for field access functions for which
	the user has supplied type and mode declarations but no
	clauses.

	Typecheck field access function calls.

	Use `io__write_list' to remove some duplication of code
	to write out comma separated lists of error descriptions.

compiler/post_typecheck.m:
	Expand field accessor goals into the equivalent unifications.
	They are expanded inline rather than generating new get and set
	predicates for field name to avoid having to work out how to mode
	the generated predicates.

	Remove an unnecessary goal traversal to qualify function
	calls and constructors. That code is now called from purity.m.

compiler/prog_data.m:
compiler/prog_io.m:
compiler/mercury_to_goedel.m:
compiler/mercury_to_mercury.m:
	Store field names as `sym_name's rather than strings.
	Use a `maybe' type rather than an empty string to designate
	an unlabelled field.

compiler/hlds_data.m:
	Define data structures to hold information about
	the field names visible in a module.

compiler/hlds_module.m:
	Add a field to type module_info to hold information
	about the fields visible in a module.

compiler/hlds_pred.m:
	Add predicates to identify field access function names,
	and to handle the arguments of field access functions.

compiler/make_hlds.m:
compiler/hlds_goal.m:
compiler/modecheck_call.m:
compiler/higher_order.m:
compiler/purity.m:
compiler/polymorphism.m:
compiler/dnf.m:
compiler/cse_detection.m:
compiler/lambda.m:
	Move `create_atomic_unification' from make_hlds.m to hlds_goal.m
	because it is used by several other modules.

compiler/hlds_goal.m:
	Add a version of goal_info_init which takes the context of
	the goal, for use by make_hlds.m.

compiler/type_util.m:
	Add a predicate `type_util__get_type_and_cons_defn' to
	get the hlds_type_defn and hlds_cons_defn for a user-defined
	constructor.

compiler/prog_util.m:
	Add predicates to add and remove prefixes or suffixes
	from the unqualified part of a sym_name.

compiler/prog_out.m:
	Add a predicate to convert a `sym_name/arity' to a string.

compiler/hlds_out.m:
	Add `hlds_out__simple_call_id_to_string' to convert a
	`pred_or_func - sym_name/arity' to a string for use in
	error messages.

compiler/purity.m:
	Thread through the pred_info so that the expansion of field accessor
	goals can add new variables.

compiler/mercury_to_mercury.m:
library/ops.m:
	Reduce precedence of `^/2' for use as a field name separator.

	Add operator `^'/1 to designate which side of the `:=' is
	the field name in a DCG field access goal.

	Add operator `:=/2' for field update expressions.

doc/reference_manual.texi:
	Document the new syntax.

doc/transition_guide.texi:
	Document the new operators.

tests/hard_coded/Mmakefile:
tests/hard_coded/record_syntax.m:
tests/hard_coded/record_syntax.exp:
tests/invalid/Mmakefile:
tests/invalid/record_syntax_errors.m:
tests/invalid/record_syntax_errors.err_exp:
	Test cases.
2000-01-13 06:19:43 +00:00
Simon Taylor
1fe6f30a21 Use meta-variables consistently in the paragraph on the
Estimated hours taken: 0.1

doc/reference_manual.texi:
	Use meta-variables consistently in the paragraph on the
	`X `OP` Y' syntax.
2000-01-08 23:15:43 +00:00
Simon Taylor
bfbf449793 Apply a suggestion from Fergus to my previous change -
Estimated hours taken: 0.1

doc/reference_manual.texi:
    Apply a suggestion from Fergus to my previous change -
    s/Predicate and function types/Predicate and function type declarations/.
2000-01-07 03:47:15 +00:00
Simon Taylor
f013759c10 Improve the structure of the "Types" chapter by
Estimated hours taken: 0.25

doc/reference_manual.texi:
	Improve the structure of the "Types" chapter by
	adding menus and sectioning commands.
2000-01-07 03:01:09 +00:00
Simon Taylor
176dbeff76 Fix meta-variables in the paragraph describing
Estimated hours taken: 0.1

doc/reference_manual.texi:
	Fix meta-variables in the paragraph describing
	the `X `OP` Y' syntax.
2000-01-07 02:39:22 +00:00
Fergus Henderson
50cb3a6fa0 Update the documentation about bugs with the implementation
Estimated hours taken: 0.25

doc/reference_manual.texi:
	Update the documentation about bugs with the implementation
	of existential types:
		- RTTI for existential types is now supported
		- document the problem with reordering better
1999-12-13 13:30:47 +00:00
Fergus Henderson
d7c31b4bfe Document that pragma memo' and pragma loopcheck'
Estimated hours taken: 0.5

doc/reference_manual.texi:
	Document that `pragma memo' and `pragma loopcheck'
	are broken for for model_non procedures.
1999-12-13 12:25:11 +00:00
Simon Taylor
0bfc9dbad7 Report errors if a variable occurs multiple times in the
Estimated hours taken: 1

compiler/make_hlds.m:
	Report errors if a variable occurs multiple times in the
	argument list of a `:- pragma c_code' declaration.

doc/reference_manual.texi:
	Document that variables must occur only once in a
	`:- pragma c_code' argument list.

tests/invalid/Mmakefile:
tests/invalid/pragma_c_code_dup_var.m:
tests/invalid/pragma_c_code_dup_var.err_exp:
	Test case.
1999-12-10 02:18:10 +00:00
Fergus Henderson
a31e217e7a Fix a typo in one of the examples. Thanks to Nicholas
Estimated hours taken: 0.1

doc/reference_manual.texi:
        Fix a typo in one of the examples.  Thanks to Nicholas
	Nethercote <njn@cat.cs.mu.OZ.AU> for reporting this.
1999-11-25 08:21:16 +00:00
Peter Ross
cbe2de18fb Completely remove support for `:- assertion' declarations.
Estimated hours taken: 1

Completely remove support for `:- assertion' declarations.

This change can be bootstrapped with the tag
bootstrap_19991116_promise_decls in the compiler and library
directories.

configure.in:
    The up-to-date check must now ensure that `:- promise' declarations
    can be parsed, and the declarations don't have to have every
    variable explicitly quantified.

compiler/mercury_to_mercury.m:
compiler/prog_io.m:
library/ops.m:
    Remove the support for parsing `:- assertion' declarations.

doc/reference_manual.texi:
library/int.m:
    s/assertion/promise/
1999-11-16 07:51:20 +00:00
Fergus Henderson
3cfe84b541 Change the documentation of `pragma loop_check' to say
Estimated hours taken: 0.1

doc/reference_manual.texi:
	Change the documentation of `pragma loop_check' to say
	that it throws an exception rather than reporting a
	runtime error.
	This change corrects another place which I missed in
	my last change.
1999-10-29 07:24:41 +00:00
Fergus Henderson
6c27bf5b48 Change the documentation of `pragma loop_check' to say
Estimated hours taken: 0.25

doc/reference_manual.texi:
	Change the documentation of `pragma loop_check' to say
	that it throws an exception rather than reporting a
	runtime error.
1999-10-29 06:01:56 +00:00
Fergus Henderson
5335b3ea3f Improve the documentation for if-then-else.
Estimated hours taken: 0.5

doc/reference_manual.texi:
	Improve the documentation for if-then-else.
	This change is in response to a suggestion from
	Don Smith <dsmith@now.cirl.uoregon.edu> that we
	say in the reference manual that Mercury's if-then-else
	(in contrast to Prolog) does not prune away all but the
	first solution of condition.
1999-10-13 06:16:16 +00:00
Fergus Henderson
851ca1ee20 Change the documentation of existential types to say that
Estimated hours taken: 1

doc/reference_manual.texi:
	Change the documentation of existential types to say that
	existential constraints must precede universal constraints
	rather than vice versa.

	This change makes the documentation consistent with the
	behaviour of the compiler.

	The rationale for changing the documentation rather than
	changing the compiler is that the order that the compiler
	uses more closely matches the logic of the type declaration.
1999-10-05 04:16:40 +00:00
Simon Taylor
00df2750bd Remove the limitation of user-guided type specialization that
Estimated hours taken: 50

Remove the limitation of user-guided type specialization that
the replacement types must be ground.

compiler/higher_order.m:
	Only add extra type-infos, not typeclass-infos when
	--typeinfo-liveness is set, extracting type-infos from
	typeclass-infos where necessary. The arguments of the
	specialized version are now independent of the class context
	of the requesting procedure, which maximises the chance of multiple
	specialized calls to the same procedure being able to use the
	same code. The code to specialize calls is now slightly simpler
	because it does not have to work out how to order extra
	typeclass-info arguments.

	Specialize special preds for no-tag types where the
	wrapped type is an atomic type and the no-tag type does not
	have a user-defined equality pred. This will be useful
	for specializations involving type `term__var/1'.

	Make sure the proc_infos for specialized procedures are
	valid before reanalyzing the goals requesting the
	specializations.

	Rework the handling of branched goals to ensure that pred_infos
	and proc_infos are single threaded through branched goals - when
	higher_order.m was first written they were constant.

	Always go over all procedures for every predicate to make
	sure unifications are specialized in all procedures.

compiler/make_hlds.m:
	Check for type variables substituted multiple times
	or occurring on both sides of the substitution.

	Adjust the arity for specializations of functions.

compiler/polymorphism.m:
	Make sure the vartypes field for imported procedures is valid
	by copying it from the clauses_info to the proc_info.

compiler/polymorphism.m:
compiler/simplify.m:
compiler/table_gen.m:
compiler/magic.m:
	Remove an unused argument from polymorphism__make_type_info_vars.

compiler/type_util.m:
compiler/det_analysis.m:
	Add a predicate `type_util__type_has_user_defined_equality_pred'
	replacing similar code in det_analysis.m.

compiler/post_typecheck:
	Don't overwrite the vartypes field in the pred_info for
	automatically generated unification procedures for imported types.

library/varset.m:
	Add predicates `varset__merge_without_names' and
	`varset__merge_subst_without_names'.

compiler/equiv_type.m:
	Use the new predicates in varset.m to avoid adding the variable
	names from the declarations of equivalence types into the tvarsets
	of declarations which use those types. This is needed so that
	`varset__create_name_var_map' (used by make_hlds.m for
	`:- pragma type_spec' declarations and explicit type qualifications)
	is not confused by multiple occurrences of a variable name.

doc/reference_manual.texi:
	Remove documentation of the limitation that the substituted types
	must be ground.

tests/hard_coded/type_spec.m:
tests/hard_coded/type_spec.err_exp:
	Tests for non-ground substitutions and specialization of
	unification of no-tag types.

tests/invalid/type_spec.err_exp:
	Remove the error for a non-ground substitution.
	Add tests for recursive type substitutions and type variables
	with multiple replacement types.
1999-10-03 04:17:29 +00:00