Commit Graph

10049 Commits

Author SHA1 Message Date
Simon Taylor
eb0d327aa9 Remove a reference to the MERCURY_C_INCL_DIR environment
Estimated hours taken: 0.1
Branches: main

util/Mmakefile:
	Remove a reference to the MERCURY_C_INCL_DIR environment
	variable, which is no longer supported.
2002-07-25 08:48:35 +00:00
Fergus Henderson
038ac85fa8 This commit was generated by cvs2svn to compensate for changes in r11424,
which included commits to RCS files with non-trunk default branches.
2002-07-25 05:27:54 +00:00
Fergus Henderson
f55686514b Import version 6.1alpha5 of the Boehm collector,
Estimated hours taken: 0.5
Branches: gc

Import version 6.1alpha5 of the Boehm collector,
using the following commands:

	zcat gc6.1alpha5.tar.gz | tar -xvf -
	cd gc6.1alpha5
	cvs import -I \! mercury/boehm_gc gc gc_6_1alpha5
2002-07-25 05:27:54 +00:00
Fergus Henderson
8e331d3459 This commit was generated by cvs2svn to compensate for changes in r11422,
which included commits to RCS files with non-trunk default branches.
2002-07-25 05:27:53 +00:00
Fergus Henderson
d69ac8f140 Import version 6.1alpha5 of the Boehm collector,
Estimated hours taken: 0.5
Branches: gc

Import version 6.1alpha5 of the Boehm collector,
using the following commands:

	zcat gc6.1alpha5.tar.gz | tar -xvf -
	cd gc6.1alpha5
	cvs import -I \! mercury/boehm_gc gc gc_6_1alpha5
2002-07-25 05:27:53 +00:00
Peter Ross
fae70ca9b2 Backout out my previous change to place foreign_decls in header files so
Estimated hours taken: 2
Branches: main

Backout out my previous change to place foreign_decls in header files so
that the definitions would be available for use by pragma exports.

compiler/export.m:
compiler/foreign.m:
compiler/mercury_compile.m:
    Backout changes.

library/io.m:
runtime/mercury_init.h:
    Remove foreign_type version of io__stream, as this required the
    previous change.
2002-07-24 16:05:13 +00:00
Zoltan Somogyi
26442ca52f Generalize the script to allow it to summarize the results from speed
Estimated hours taken: 0.2
Branches: main

tools/speed_summary:
	Generalize the script to allow it to summarize the results from speed
	trials of programs other than the compiler.
2002-07-24 10:29:23 +00:00
Fergus Henderson
801607b810 Fix some bugs where the code was using == instead of =.
Estimated hours taken: 0.25
Branches: main

util/mdemangle.c:
	Fix some bugs where the code was using == instead of =.
2002-07-23 19:39:00 +00:00
Simon Taylor
4b2b99cee1 Back out Peter Ross's last change. It doesn't compile.
Estimated hours taken: 0.1
Branches: main

compiler/export.m:
compiler/foreign.m:
compiler/mercury_compile.m:
compiler/mlds_to_c.m:
	Back out Peter Ross's last change. It doesn't compile.
2002-07-23 16:35:36 +00:00
Simon Taylor
6c788ae45f Put instance declarations in the `.int2' files to avoid
Estimated hours taken: 0.5
Branches: main

compiler/modules.m:
	Put instance declarations in the `.int2' files to avoid
	producing `superclass constraints not satisfied' errors
	for instance declarations for subclasses defined in the
	interface of importing modules.

	Without this change, all modules importing the module defining
	the instance for the subclass must also import the module
	defining the instance for the superclass.

tests/valid/Mmakefile:
tests/valid/transitive_instance.m:
	Test case.
2002-07-23 13:34:04 +00:00
Peter Ross
f741711fa1 Place the decls both in the .mh file and in either the .c (LLDS) or .mih (HLDS) file protected with a #ifndef/#define block.
Estimated hours taken: 2
Branches: main

Place the decls both in the .mh file and in either the .c (LLDS) or .mih (HLDS) file protected with a #ifndef/#define block.

compiler/export.m:
	Don't output #line blocks around the decls so as to avoid unnecessary
	changes to the .mh file and redundant compilations.

compiler/foreign.m:
	Add the function decl_guard which returns the string that is used to
	protect the declarations from being defined twice.

compiler/export.m:
compiler/mercury_compile.m:
compiler/mlds_to_c.m:
	Protect all the declarations with a #ifndef/#define block.
2002-07-23 10:12:34 +00:00
Peter Ross
1851f1f045 Add the change to mlds_to_il.m which checks that every argument is
Estimated hours taken: 0.25
Branches: main

compiler/mlds_to_il.m:
	Add the change to mlds_to_il.m which checks that every argument is
	boxed that didn't get commited in my previous change.
2002-07-23 08:50:58 +00:00
Peter Ross
1fd2a43d9f Allow the library to compile in the grade il (high level data).
Estimated hours taken: 120
Branches: main

Allow the library to compile in the grade il (high level data).

compiler/ml_util.m:
	Add more types which need to be represented using the low level
	representation because of how they are handled in the library.

compiler/mlds_to_il.m:
	Remove an XXX which is no longer necessary.
	Add the heap_pointer type to the list of types whose RTTI is defined
	by hand.

library/exception.m:
	Move the definition of Exception from the runtime to the local module.
	This is needed for when univ/0 is no longer represented as a low level
	type.

runtime/mercury_mcpp.cpp:
	Remove the implementation of Exception that is now in exception.m.

library/Mmakefile:
	The lowlevel Exception type is now defined in the library not the
	runtime, so add rules to ensure that the foreign code is built in
	the correct order.

library/io.m:
	Reimplement io__stream as a foreign_type.  This makes the code more
	type safe and avoids problems with the different representation of
	the io__stream type when using high and low level data.
	Change io__command_line_arguments so that it throws an exception
	when we use high level data, as I am yet to work out how to access
	high level lists.

library/rtti_implementation.m:
	Add a comment that get_subterm doesn't work with high level data.
	Fix some bugs with the default versions of type_ctor_compare_pred and
	type_ctor_unify_pred.

library/sparse_bitset.m:
	Remove the foreign_proc implementation of make_bitset_elem as it
	will not work with both data representations and their is a Mercury
	implementation.

library/string.m:
	Remove the foreign_proc implementation of all the predicates which
	manipulate lists as they all have a Mercury implementation, as I am yet
	to work out how to access high level lists.
	Add a Mercury implementation for string__join_list.

runtime/mercury_mcpp.h:
library/array.m:
library/builtin.m:
library/private_builtin.m:
library/type_desc.m:
	Define and use typedefs where appropiate for type_info/0, type_info/1,
	comparison_result/0 and univ/0, as there representation may change in
	the future between using high level and low level data.
2002-07-23 08:26:30 +00:00
Simon Taylor
82ba3eede2 Fix a bug in Zoltan's last change which broke hlc grades.
Estimated hours taken: 0.1
Branches: main

browser/util.m:
	Fix a bug in Zoltan's last change which broke hlc grades.
	Use `:- pragma foreign_import_module(c, bool)' rather
	than `#include "bool.h"'.
2002-07-23 02:30:55 +00:00
Zoltan Somogyi
048f8357cf Until now, programmers could add `tabled_for_io' annotations to foreign_procs
Estimated hours taken: 12
Branches: main

Until now, programmers could add `tabled_for_io' annotations to foreign_procs
that do I/O, which asks the compiler to make those foreign_procs idempotent,
i.e. ensures that they are performed at most once even in the presence of a
retry operation in the debugger. This change adds a compiler option,
--trace-table-io-require, which generates an error if a foreign_proc that does
I/O does not have this annotation. Specifying this option thus ensures
that all I/O done by the program is idempotent.

In the future, we may want to have this option turned on in all debugging
grades. Until we decide about, the new option is not yet documented.

compiler/options.m:
	Add the new option --trace-table-io-require.

compiler/handle_options.m:
	Make --trace-table-io-require imply --trace-table-io.

compiler/table_gen.m:
	If --trace-table-io-require is enabled, require all I/O primitives
	to have the tabled_for_io annotation.

compiler/mercury_compile.m:
	Pass I/O states to table_gen.m, since it can now generate error
	messages.

trace/mercury_trace_util.h:
trace/mercury_trace_vars.c:
	When calling Mercury code from the trace directory, disable I/O
	tabling, since any I/O actions executed by Mercury code in the browser
	directory (or by library code called from there) should not be tabled,
	not being part of the user program.

	Due to the depth of nesting, make mercury_trace_vars.c use four-space
	indentation.

browser/collect_lib.m:
browser/declarative_debugger.m:
browser/declarative_execution.m:
browser/dl.m:
browser/io_action.m:
browser/mdb.m:
browser/name_mangle.m:
browser/util.m:
compiler/gcc.m:
compiler/mercury_compile.m:
compiler/passes_aux.m:
compiler/process_util.m:
compiler/stack_layout.m:
library/io.m:
library/time.m:
tests/debugger/declarative/tabled_read_decl.m:
	Add a whole lot of tabled_for_io annotations, to enable the compiler to
	bootstrap with --trace-table-io-require enabled.

	In many cases, this required turning old-style pragma c_code into
	pragma foreign_proc. While doing that, I standardized the layouts
	of pragma foreign_procs.

browser/util.m:
	Turn an impure semidet predicate into a pure det predicate with I/O
	states, to allow it to be tabled. Make it return a Mercury bool
	to indicate success or failure.

library/bool.m:
	Add functions that allow C code to get their hands on the constants
	`yes' and `no', for communication with Mercury code.

library/table_builtin.m:
	Add debugging code to the main primitive of I/O tabling. This is
	controlled both by the macro for retry debugging and a boolean global.

library/mercury_trace_base.[ch]:
	Add the boolean global variable to switch the new debugging code in
	table_builtin.m on and off.

library/mercury_trace_internal.c:
	When starting I/O tabling with retry debug enabled, turn on the switch.

tests/debugger/queens.exp3:
	New expected output file that applies when the library is compiled with
	--trace-table-io-require.
2002-07-22 07:13:14 +00:00
Simon Taylor
9dbcf4714a Fix a bug which caused type-incorrect HLDS to be generated by mode
Estimated hours taken: 5
Branches: main

Fix a bug which caused type-incorrect HLDS to be generated by mode
analysis, which then caused a compiler abort in simplification.
In the code below, mode analysis must treat the headvar unification
as a construction followed by a var-var unification. If it is treated
as a deconstruction, the argument unifications will be ill-typed.

	:- type t ---> some [T] f(T) => enum(T).
	:- pred p(t::in) is semidet.
	p('new f'(1)).

compiler/modecheck_unify.m:
	Make sure unifications with a RHS of the form 'new f(X)'
	are always classified as constructions.

compiler/hlds_goal.m:
compiler/*.m:
	Add a field to var-functor unifications which identifies
	those which must be treated as constructions.

compiler/polymorphism.m:
	Fill in the field.

tests/hard_coded/Mmakefile:
tests/hard_coded/unify_existq_cons.{m,exp}:
	Test case.
2002-07-22 06:30:04 +00:00
Ralph Becket
c9ec698575 Removed redundant "\n"s from format arguments for report_error calls
Estimated hours taken: 0.2
Branches: main

compiler/make_hlds.m:
	Removed redundant "\n"s from format arguments for report_error calls
	introduced in the state variable transformation.

ts/invalid/state_vars_test1.m:
tests/invalid/state_vars_test1.err_exp:
tests/invalid/state_vars_test2.m:
tests/invalid/state_vars_test2.err_exp:
tests/invalid/state_vars_test3.m:
tests/invalid/state_vars_test3.err_exp:
tests/invalid/state_vars_test4.m:
tests/invalid/state_vars_test4.err_exp:
tests/invalid/state_vars_test5.m:
tests/invalid/state_vars_test5.err_exp:
        Minor clean-ups and changed the .err_exp files to match the
	expected output after the change to the error message
	formatting.
2002-07-22 02:18:02 +00:00
Ralph Becket
7307384782 Removed redundant "\n"s from format arguments for report_error calls
Estimated hours taken: 0.2
Branches: main

compiler/make_hlds.m:
	Removed redundant "\n"s from format arguments for report_error calls
	introduced in the state variable transformation.
2002-07-22 02:13:52 +00:00
Simon Taylor
f953c34b35 test -e' doesn't work on taifun. Use test -r' instead.
Estimated hours taken: 0.1
Branches: main

tools/bootcheck:
	`test -e' doesn't work on taifun. Use `test -r' instead.
2002-07-21 16:18:22 +00:00
Simon Taylor
18156bf164 Fix a bug in inlining of procedures with typeclass constraints.
Estimated hours taken: 3
Branches: main

compiler/inlining.m:
	Fix a bug in inlining of procedures with typeclass constraints.
	The type_info location for the callee overwrote the location
	in the caller, but the location in the callee may have been
	computed by extracting type_infos from typeclass_infos in the
	caller, so it wouldn't be valid when computing the locations of
	the type variables in the head of the caller.

	Remove a partial work-around for this bug, which disabled
	inlining of procedures with class constraints when tracing
	is enabled. The work-around didn't prevent the code generator
	abort occurring when constructing closure layouts.

tests/valid/Mmakefile:
tests/valid/typeclass_inlining_bug.m:
	Test case.
2002-07-21 08:00:54 +00:00
Simon Taylor
e66536cbe8 Update a comment about a bug which has been fixed.
Estimated hours taken: 0.25
Branches: main

compiler/polymorphism.m:
	Update a comment about a bug which has been fixed.
2002-07-21 03:09:59 +00:00
Peter Ross
5d990b2a2e Allow the library to compile in the grade il (high level data).
Estimated hours taken: 120
Branches: main

Allow the library to compile in the grade il (high level data).

compiler/ml_util.m:
	Add more types which need to be represented using the low
level representation because of how they are handled in the library.

compiler/mlds_to_il.m:
	Remove an XXX which is no longer necessary.  Add the
	heap_pointer type to the list of types whose RTTI is defined by hand.

library/exception.m:
	Move the definition of Exception from the runtime to the local
	module.  This is needed for when univ/0 is no longer represented
	as a low level type.

runtime/mercury_mcpp.cpp:
	Remove the implementation of Exception that is now in exception.m.

library/Mmakefile:
        The lowlevel Exception type is now defined in the library not
the
        runtime, so add rules to ensure that the foreign code is built
in
        the correct order.

library/io.m:
        Reimplement io__stream as a foreign_type.  This makes the code more
        type safe and avoids problems with the different representation of
        the io__stream type when using high and low level data.
        Change io__command_line_arguments so that it throws an exception
        when we use high level data, as I am yet to work out how to access
        high level lists.

library/rtti_implementation.m:
        Add a comment that get_subterm doesn't work with high level data.
        Fix some bugs with the default versions of type_ctor_compare_pred and
        type_ctor_unify_pred.

library/sparse_bitset.m:
        Remove the foreign_proc implementation of make_bitset_elem as it
        will not work with both data representations and their is a Mercury
        implementation.

library/string.m:
        Remove the foreign_proc implementation of all the predicates which
        manipulate lists as they all have a Mercury implementation, as I am yet
        to work out how to access high level lists.
        Add a Mercury implementation for string__join_list.

runtime/mercury_mcpp.h:
library/array.m:
library/builtin.m:
library/private_builtin.m:
library/type_desc.m:
        Define and use typedefs where appropiate for type_info/0, type_info/1,
        comparison_result/0 and univ/0, as there representation may change in
        the future between using high level and low level data.
2002-07-19 14:52:47 +00:00
Peter Ross
f3c664e3f0 Fix generated C errors where a `:- pragma foreign_type' refers to a C
Estimated hours taken: 8
Branches: main

Fix generated C errors where a `:- pragma foreign_type' refers to a C
type which is not in scope where it is used in the prototype for a
predicate with a `:- pragma export' declaration.

compiler/export.m:
    Record in the foreign_export_decls type all the foreign_decls iff
    the module contains foreign types.
    Output the foreign decls in the header file if needed.

compiler/foreign.m:
    Change foreign_export_decls so that it records the foreign_decls
    if needed by virtue of the module containing foreign_types.

compiler/hlds_module.m:
    Add a new field to the module_info which records whether or not a
    module contains a foreign type.

compiler/make_hlds.m:
    Set the contains_foreign_type field.

compiler/mercury_compile.m:
    If the module contains a foreign type then the decls will be placed
    in the header file so remove them from processing in the c file.
2002-07-19 10:40:23 +00:00
Zoltan Somogyi
3866765d3a Allow a workspace to have a file, .BOOT_GRADE, that sets the default
Estimated hours taken: 0.1
Branches: main

tools/bootcheck:
	Allow a workspace to have a file, .BOOT_GRADE, that sets the default
	grade for bootchecks.

	Do not require .KEEP_OBJS, which turns on --keep-objs by default,
	to be a directory.
2002-07-19 05:43:15 +00:00
Zoltan Somogyi
515d0fcca2 Add missing MR_ prefix and fix the base macro name.
Estimated hours taken: 0.2
Branches: main

runtime/mercury_conf_param.h:
	Add missing MR_ prefix and fix the base macro name.
2002-07-19 05:39:04 +00:00
Zoltan Somogyi
fd000e7dcd Convert a Prolog-style is' to ='.
Estimated hours taken: 0.1
Branches: main

compiler/trace.m:
	Convert a Prolog-style `is' to `='.
2002-07-19 05:33:19 +00:00
Zoltan Somogyi
25d546705c Fix typo.
Estimated hours taken: 0.1
Branches: main

compiler/goal_form.m:
	Fix typo.
2002-07-18 07:53:20 +00:00
Simon Taylor
bffc16b124 Don't use `mmake -j realclean' (which puts no limit on the
Estimated hours taken: 0.25
Branches: main, release

tests/startup:
tests/shutdown:
tests/handle_options:
	Don't use `mmake -j realclean' (which puts no limit on the
	number of jobs run). This was exceeding the process limit
	on mundroo.
2002-07-18 05:56:57 +00:00
Mark Brown
0c1cbe8c43 Fix a bug in the documentation of record syntax.
Estimated hours taken: 0.1
Branches: main

doc/reference_manual.texi:
	Fix a bug in the documentation of record syntax.
2002-07-17 07:19:28 +00:00
Simon Taylor
442092c547 Fix a bug which caused compilation to continue
Estimated hours taken: 0.25
Branches: main

compiler/make.module_target.m:
	Fix a bug which caused compilation to continue
	even after errors.
2002-07-17 07:09:21 +00:00
Mark Brown
8ed1a62608 State the rationale for our line width limit.
Estimated hours taken: 0.1
Branches: main

compiler/notes/coding_standards.html:
	State the rationale for our line width limit.
2002-07-17 06:23:57 +00:00
Zoltan Somogyi
dac235671e Added .nocopyright files for the benchmarks.
Estimated hours taken: 0.1
Branches: main

Added .nocopyright files for the benchmarks.
2002-07-17 04:06:43 +00:00
Zoltan Somogyi
696414ecd8 Clean up this file a bit, to make future merges with the
Estimated hours taken: 1.5
Branches: main

library/pprint.m:
	Clean up this file a bit, to make future merges with the
	mode-constraints branch easier.

	Add special casing for variables and sparse bitsets, since these can be
	useful.

	Group predicates and functions logically.

	Put the casting predicates and the *_to_doc functions for the special
	cases in the same order as the special case tests in to_doc itself.

	Shorten excessively long dividing lines.

tests/hard_coded/pprint_test.{m,exp}:
	A new test case to test the new additions to to_doc.

tests/hard_coded/Mmakefile:
	Enable the new test case.
2002-07-16 08:10:48 +00:00
Zoltan Somogyi
d8635d05e9 Make the script exit cleanly if interrupted, and add some
Estimated hours taken: 1
Branches: main

tools/cvdd:
	Make the script exit cleanly if interrupted, and add some
	bulletproofing.
2002-07-16 03:41:09 +00:00
Simon Taylor
a311365b2c Test the hl.* grades. Previously they weren't tested
Estimated hours taken: 0.1

tools/test_mercury:
	Test the hl.* grades. Previously they weren't tested
	because installation of header files for both hl and hlc
	grades didn't work.
2002-07-15 07:12:02 +00:00
Simon Taylor
0c437e9ad0 Fix a bug -- the grade-specific `inc' directory
Estimated hours taken: 0.1
Branches: main

scripts/Mmake.vars.in:
compiler/handle_options.m:
	Fix a bug -- the grade-specific `inc' directory
	for an installed library must be searched first.
	`.mih' files are installed into the non-grade-specific
	directory to avoid adding an extra entry in VPATH,
	but those files won't necessarily be the right ones
	for the current grade.
2002-07-15 07:03:53 +00:00
Simon Taylor
04393bf5e0 Build the source distribution on earth again, now that
Estimated hours taken: 0.1

tools/test_mercury:
	Build the source distribution on earth again, now that
	earth is fixed and venus is flaky.
2002-07-15 06:32:10 +00:00
Simon Taylor
cc992dba59 Fix a bug in inter-module optimization with sub-modules reported
Estimated hours taken: 2
Branches: main

Fix a bug in inter-module optimization with sub-modules reported
by Michael Day <mikeday@bigpond.net.au>. The symptom was a compiler
abort due to an attempt to take the address of a predicate with
multiple modes. The predicate only had multiple mode declarations
because the declarations were read from both the `.int0' and `.opt'
files for the module.

compiler/post_typecheck.m:
compiler/purity.m:
	Remove duplicate modes and report other errors in type
	declarations for all predicates in a separate pass before
	purity checking and overloading resolution.

tests/valid/Mmakefile:
tests/valid/intermod_nested_module_bug.m:
tests/valid/intermod_nested_module_bug2.m:
	Test case.

tests/valid/assoc_list.m:
tests/valid/assoc_list_bug.m:
	Rename the assoc_list test case -- it interfered with
	other test cases attempting to import the assoc_list
	library module.
2002-07-14 15:12:42 +00:00
Tyson Dowd
f81bbbcc62 Fix a bug that meant we generated invalid code for foreign_proc IL.
Estimated hours taken: 2
Branches: main

Fix a bug that meant we generated invalid code for foreign_proc IL.
Recent changes to variable naming unifications uncovered this bug.

compiler/ml_code_gen.m:
	Use the user's names for variables when generating locals for
	use in foreign_proc for IL, so that they match the names given
	in the foreign code.
2002-07-14 04:08:26 +00:00
Zoltan Somogyi
791cf473f8 Added two more benchmark programs.
Estimated hours taken: 2
Branches: main

Added two more benchmark programs.
2002-07-12 23:38:21 +00:00
Simon Taylor
f42325917f Give a better error message for nonexistent modules specified
Estimated hours taken: 0.5
Branches: main

Give a better error message for nonexistent modules specified
in `:- import_module' or `:- include_module' declarations.

compiler/make.m:
compiler/make.dependencies.m:
compiler/make.module_dep_file.m:
	Track which module imported or included the module
	currently being processed when generating dependencies,
	and include the name of the importing module in the error
	message generated when a module can't be found.

tests/invalid/Mmakefile:
tests/invalid/nonexistent_import.{m,err_exp}:
	Test case.
2002-07-12 07:31:27 +00:00
Ralph Becket
8f657f1fe7 Brought up-to-date.
Estimated hours taken: 0.1
Branches: main

tests/general/state_vars_tests.exp:
	Brought up-to-date.
2002-07-11 06:56:52 +00:00
Ralph Becket
d8f47f21de Added pred string__suffix/2.
Estimated hours taken: 4
Branches: main

library/string.m:
	Added pred string__suffix/2.
	Added funcs string__fold[lr]_substring/5.
	Added preds string__fold[lr]_substring/6.
	Added func string__foldr/3.
	Added pred string__foldr/4.
	Added func string__words/1.
	Recoded string__prefix for efficiency.
	Recoded string__sub_string_search_2 for efficiency.
	Minor cosmetic changes to separator comments.

NEWS:
	Mention the above changes.
2002-07-11 04:26:10 +00:00
Zoltan Somogyi
268da5a853 Update the benchmarking tools for the stack slot optimization to
Estimated hours taken: 0.2
Branches: main

bench/*:
	Update the benchmarking tools for the stack slot optimization to
	allow testing at different optimization levels.
2002-07-10 16:05:27 +00:00
Zoltan Somogyi
d2c5e67c88 The source code of four benchmark programs, and everything you
Estimated hours taken: 4
Branches: main

bench/progs/compress/*:
bench/progs/icfp2000/*:
bench/progs/icfp2001/*:
bench/progs/nuc/*:
	The source code of four benchmark programs, and everything you
	need to build them and run run.

bench/progs/*:
	Tools for measuring the speed of these programs.
2002-07-10 08:33:09 +00:00
Simon Taylor
a6019b47d4 Add /' as a synonym for dir__make_path_name'.
Estimated hours taken: 0.1
Branches: main

NEWS:
library/dir.m:
	Add `/' as a synonym for `dir__make_path_name'.
2002-07-10 06:49:35 +00:00
Ralph Becket
67f3f80204 Implemented state variable transformation.
Estimated hours taken: 600
Branches: main

Implemented state variable transformation.

NEWS:
	Record new syntax and withdrawl of !/0 as Prolog cut.

compiler/hlds_goal.m:
compiler/hlds_out.m:
	Added implicit/1 constructor to unify_main_context for cases where
	variables are introduced by compiler transformations.

compiler/make_hlds.m:
	Integrated the state variable transformation with the conversion to
	HLDS.

compiler/mercury_compile.m:
	Removed two unnecessary Prolog cuts left over from the Dark
	Ages.

compiler/mercury_to_mercury.m:
	Added code to output the new goal_expr constructors for state
	variable quantifiers (some_state_vars and all_state_vars.)

	Adapted to handle changes to if_then and if_then_else
	goal_expr constructors which now include lists of state
	variables that scope over the condition- and then-goals.

compiler/module_qual.m:
compiler/prog_util.m:
	Changes to handle some_state_vars, all_state_vars, and changes
	to if_then and if_then_else goal_expr constructors.

compiler/prog_data.m:
	Added some_state_vars, all_state_vars constructors and changed
	if_then and if_then_else constructors in type goal_expr.

compiler/prog_io_dcg.m:
	Changes to handle quantified state variables.

compiler/prog_io_goal.m:
	parse_some_vars_goal now also separates out quantified state
	variables.

compiler/prog_io_util.m:
	Added pred parse_quantifier_vars/3 which also detects state
	variables.

compiler/typecheck.m:
	Added case to report_error_undef_cons to handle any uncaught
	uses of !/1.

doc/reference_manual.texi:
	Documented the transformation.

library/builtin.m:
library/prolog.m:
	Deleted code for `!' as fake Prolog cut.

library/lexer.m:
	Made `!' a graphic token rather char than a special token.

library/ops.m:
	Added `!', `!.' and `!:' as prefix ops.

library/term.m:
	Added func var_id/1 which returns an int associated with its
	var argument which is unique in the context of the given var
	and the varset it belongs to.

library/varset.m:
	Added pred new_uniquely_named_var/4 which creates a named
	variable with a unique (w.r.t. the varset) number suffix.

tests/general/Mmakefile:
tests/general/state_vars_tests.exp:
tests/general/state_vars_tests.m:
tests/general/state_vars_typeclasses.exp:
tests/general/state_vars_typeclasses.m:
tests/invalid/Mmakefile:
tests/invalid/state_vars_test1.err_exp:
tests/invalid/state_vars_test1.m:
tests/invalid/state_vars_test2.err_exp:
tests/invalid/state_vars_test2.m:
tests/invalid/state_vars_test3.err_exp:
tests/invalid/state_vars_test3.m:
tests/invalid/state_vars_test4.err_exp:
tests/invalid/state_vars_test4.m:
tests/invalid/state_vars_test5.err_exp:
tests/invalid/state_vars_test5.m:
	Added.
2002-07-09 06:53:41 +00:00
David Overton
27888d72c8 Action methods are functions so write them out using function syntax
Estimated hours taken: 0.1
Branches: main

extras/moose/moose.m:
	Action methods are functions so write them out using function syntax
	rather than pred syntax.
2002-07-09 03:33:50 +00:00
Ralph Becket
b746233ac4 Implemented state variable transformation.
Estimated hours taken: 600
Branches: main

Implemented state variable transformation.

NEWS:
	Record new syntax and withdrawl of !/0 as Prolog cut.

compiler/hlds_goal.m:
compiler/hlds_out.m:
	Added implicit/1 constructor to unify_main_context for cases where
	variables are introduced by compiler transformations.

compiler/make_hlds.m:
	Integrated the state variable transformation with the conversion to
	HLDS.

	Changed references to foreign_type and du_type constructors to
	match recent changes to the foreign type interface.

compiler/mercury_compile.m:
	Removed two unnecessary Prolog cuts left over from the Dark
	Ages.

compiler/mercury_to_mercury.m:
	Added code to output the new goal_expr constructors for state
	variable quantifiers (some_state_vars and all_state_vars.)

	Adapted to handle changes to if_then and if_then_else
	goal_expr constructors which now include lists of state
	variables that scope over the condition- and then-goals.

compiler/module_qual.m:
compiler/prog_util.m:
	Changes to handle some_state_vars, all_state_vars, and changes
	to if_then and if_then_else goal_expr constructors.

compiler/prog_data.m:
	Added some_state_vars, all_state_vars constructors and changed
	if_then and if_then_else constructors in type goal_expr.

compiler/prog_io_dcg.m:
	Changes to handle quantified state variables.

compiler/prog_io_goal.m:
	parse_some_vars_goal now also separates out quantified state
	variables.

compiler/prog_io_util.m:
	Added pred parse_quantifier_vars/3 which also detects state
	variables.

compiler/typecheck.m:
	Added case to report_error_undef_cons to handle any uncaught
	uses of !/1.

doc/reference_manual.texi:
	Documented the transformation.

library/builtin.m:
library/prolog.m:
	Deleted code for `!' as fake Prolog cut.

library/lexer.m:
	Made `!' a graphic token rather char than a special token.

library/ops.m:
	Added `!', `!.' and `!:' as prefix ops.

library/term.m:
	Added func var_id/1 which returns an int associated with its
	var argument which is unique in the context of the given var
	and the varset it belongs to.

library/varset.m:
	Added pred new_uniquely_named_var/4 which creates a named
	variable with a unique (w.r.t. the varset) number suffix.

tests/general/Mmakefile:
tests/general/state_vars_tests.exp:
tests/general/state_vars_tests.m:
tests/general/state_vars_typeclasses.exp:
tests/general/state_vars_typeclasses.m:
tests/invalid/Mmakefile:
tests/invalid/state_vars_test1.err_exp:
tests/invalid/state_vars_test1.m:
tests/invalid/state_vars_test2.err_exp:
tests/invalid/state_vars_test2.m:
tests/invalid/state_vars_test3.err_exp:
tests/invalid/state_vars_test3.m:
tests/invalid/state_vars_test4.err_exp:
tests/invalid/state_vars_test4.m:
tests/invalid/state_vars_test5.err_exp:
tests/invalid/state_vars_test5.m:
	Added.
2002-07-09 01:31:12 +00:00
Simon Taylor
5a48c38bd8 Create the sub-directories for the ilasm output files.
Estimated hours taken: 0.2
Branches: main

compiler/compile_target_code.m
	Create the sub-directories for the ilasm output files.
2002-07-06 16:02:44 +00:00