Commit Graph

366 Commits

Author SHA1 Message Date
Peter Ross
2dd493be45 Use the pretty_print module to pretty print terms in
Estimated hours taken: 3
Branches: main

Use the pretty_print module to pretty print terms in
the debugger, rather than pprint.

browser/browse.m:
	Use the new pretty_printer.

browser/browser_info.m:
	Make the debugger type a member of the stream
	typeclass, so that we can use it from the new
	pretty printer.
2007-08-14 05:25:24 +00:00
Peter Ross
d94ba52167 Use the pretty_print module to pretty print terms in
Estimated hours taken: 3
Branches: main

Use the pretty_print module to pretty print terms in
the debugger, rather than pprint.

browser/browse.m:
	Use the new pretty_printer.

browser/browser_info.m:
	Make the debugger type a member of the stream
	typeclass, so that we can use it from the new
	pretty printer.
2007-08-14 05:24:47 +00:00
Zoltan Somogyi
e33ca246a5 Move the code for reading procedure representations from the browser directory
Estimated hours taken: 0.2
Branches: main

Move the code for reading procedure representations from the browser directory
(in declarative_execution.m) to the mdbcomp directory (the file
program_representation.m) in order to make it accessible for the deep
profiler, since future changes by Paul Bone will require this.

browser/declarative_execution.m:
mdbcomp/program_representation.m:
	Make the move.

	Turn a semidet function into a predicate.

	Update some old constructs.

mdbcomp/program_representation.m:
mdbcomp/slice_and_dice.m:
	Change the prefix on the functions exported to C to MR_MDBCOMP
	from the previous mixture of MR_MDB and ML.

trace/*.c:
	Conform to the new prefixes on exported C functions.
2007-07-31 05:48:21 +00:00
Peter Wang
7fa0dff1b5 Add more documentation for the Erlang backend.
Estimated hours taken: 6
Branches: main

Add more documentation for the Erlang backend.

Make it possible to configure and install the Erlang backend without too
much manual tweaking.

NEWS:
	Mention the Erlang backend.

README.Erlang:
	Add installation and other notes for Erlang.

doc/reference_manual.texi:
doc/user_guide.texi:
	Add documentation for Erlang.

aclocal.m4:
configure.in:
	Check that the bootstrap compiler knows about the
	builtin_compound_{eq,lt} builtins, and understands
	--erlang-native-code.

	Make configure check for Erlang tools.

	Add configure --enable-erlang-grade option.  Erlang support
	is disabled by default.

scripts/Mercury.config.in:
	Add `--erlang-compiler <erl>' and `--erlang-interpreter <erlc>'
	options to be set by configure.

analysis/ANALYSIS_FLAGS.in:
compiler/COMP_FLAGS.in:
mdbcomp/MDBCOMP_FLAGS.in:
	Add `--erlang-include-directory <dir>/Mercury/hrls' options so that
	the compiler can find Erlang header files from other subdirectories.

compiler/Mercury.options:
library/Mercury.options:
	Work around bugs in the HiPE compiler when compiling two modules.

	Delete the workaround that was necessary while bootstrapping
	builtin_compound_{eq,lt}.

compiler/options.m:
	Add notes that two options to check that the compiler is recent enough
	won't be recognised because they begin "no-" prefixes, and we have
	to use "--no-no-" instead.

compiler/options_file.m:
	Support ERLANG_FLAGS, EXTRA_ERLANG_FLAGS variables in options files to
	be the same as passing --erlang-flags.

browser/Mmakefile:
compiler/Mmakefile:
deep_profiler/Mmakefile:
library/Mmakefile:
mdbcomp/Mmakefile:
profiler/Mmakefile:
runtime/Mmakefile:
slice/Mmakefile:
trace/Mmakefile:
	Make the build system do the same things in the Erlang grade as for
	the IL and Java grades.

scripts/final_grade_options.sh-subr:
scripts/parse_grade_options.sh-subr:
	Make these scripts know about the erlang grade so that parts of the
	build system won't abort on seeing it.
2007-07-20 01:22:06 +00:00
Julien Fischer
2c2542814e Ignore autoconf generated files and files generated
Estimated hours taken: 0.1
Branches: main

*/.cvsignore:
	Ignore autoconf generated files and files generated
	by the tests.
2007-06-15 12:41:47 +00:00
Peter Ross
6878dc5e0d Remove !X ^ field := Y occurences and thus the test
Estimated hours taken: 1
Branches: main

configure.in:
browser/declarative_oracle.m:
	Remove !X ^ field := Y occurences and thus the test
	for it in configure.
2007-06-12 04:22:40 +00:00
Julien Fischer
977c445e00 Don't use the `!A ^ field :=' syntax yet.
browser/declarative_debugger.m:
	Don't use the `!A ^ field :=' syntax yet.
2007-06-08 15:43:15 +00:00
Ian MacLarty
5e7d665e9f Add a --reset-knowledge-base option to the mdb `dd' command. The new option
resets the declarative debugger's knowledge base of previous question answers.

NEWS:
	Mention the new option.

	Move an item that was in the wrong place.

browser/declarative_debugger.m:
browser/declarative_oracle.m:
	Export a procedure to reset the oracle's knowledge base.

doc/user_guide.texi:
	Document the new option.

tests/debugger/declarative/oracle_db.exp:
tests/debugger/declarative/oracle_db.inp:
	Test the new option.

trace/mercury_trace_cmd_dd.c:
trace/mercury_trace_declarative.c:
trace/mercury_trace_declarative.h:
	Add the new option.
2007-06-07 06:53:54 +00:00
Peter Wang
4a16515a16 s/paramater/parameter/
Estimated hours taken: 0.1
Branches: main

browser/browser_info.m:
compiler/hlds_pred.m:
compiler/prog_io_goal.m:
tests/invalid/trace_goal_env.err_exp:
	s/paramater/parameter/

doc/reference_manual.texi:
	s/It practice/In practice/
2007-05-30 03:49:50 +00:00
Zoltan Somogyi
ebb805a2d3 Currently, all disjuncts from a disjunction generate an event with the same
Estimated hours taken: 3
Branches: main

Currently, all disjuncts from a disjunction generate an event with the same
port: MR_PORT_DISJ. However, the declarative debugger treats first disjuncts
differently from later ones, and the g12 visualizer will want this distinction
too. Therefore this diff splits MR_PORT_DISJ into two: MR_PORT_DISJ_FIRST
and MR_PORT_DISJ_LATER.

(The visualizer will also probably want to know when the disjunction is
complete, but it is not yet known whether this should be done as a separate
port type for the last disjunct or a new kind of event that happens when
execution backtracks out of the disjunction overall, so we hold off for now.)

runtime/mercury_trace_base.[ch]:
	Make the split described above.

	Move the user-visible names of ports from the source file to the
	header file to make them easier to maintain.

	Update the list of places that need to be updated when the list of
	ports is changed.

	Have two sets of names for trace ports: one that uniquely identifies
	each port, and one that conflates MR_PORT_DISJ_FIRsT and
	MR_PORT_DISJ_LATER. The first is for use by automatic tools,
	the second is for presentation to humans (so that mdb output,
	for example, remains the same.)

	Put some parts of the header file in a more logical order.

browser/declarative_execution.m:
mdbcomp/prim_data.m:
mdbcomp/trace_counts.m:
compiler/layout_out.m:
trace/mercury_trace_internal.m:
trace/mercury_trace_tables.m:
	Conform to the above changes.

compiler/trace_params.m:
	Conform to the above changes. Start numbering ports from 0, since C
	enums start from 0. This change has no repercussions since we don't
	yet have any code that depends on the details of the encoding.

compiler/trace_gen.m:
	Decide which kind of disj event to create.

trace/mercury_trace_declarative.c:
	Handle first and later disjuncts separately.
2007-05-02 02:16:02 +00:00
Zoltan Somogyi
9ce35377f6 Fix a problem with the representation of goal paths for switches on unbounded
Estimated hours taken: 2
Branches: main

Fix a problem with the representation of goal paths for switches on unbounded
numbers of function symbols, such as ints, floats and strings. We used to
represent such switches as a negative number in the field representing the
number of function symbols in the switched-on type, but some parts of the
system weren't handling negative numbers specially, and they couldn't be
properly parsed back in anyway (since "-" was also the character separating
the case's ordinal number from this number).

mdbcomp/program_representation.m:
	Change the switch goal path step to use a maybe type to record the
	number of function symbols in the switched-on type, with a "no" meaning
	the type is unbounded. Update the goal path step printing and parsing
	code accordingly.

	Make the names of some other function symbols more expressive.

browser/declarative_execution.m:
	Conform to the change to program_representation.m.

compiler/goal_path.m:
compiler/deep_profiling.m:
compiler/unneeded_code.m:
	Update the code that creates goal path steps.

	In deep_profiling.m, fix an old bug: the two integers (case number,
	number of function symbols in switched-on type) were swapped.

	In deep_profiling.m, give a prefix to the field names of the main
	structure passed around, to try to make them unique.

tests/debugger/switch_on_unbounded.{m,inp,exp}:
	New test case to test this fix.

tests/debugger/Mmakefile:
	Enable the new test case.
2007-04-19 04:24:53 +00:00
Zoltan Somogyi
b56885be93 Fix a bug that caused bootchecks with --optimize-constructor-last-call to fail.
Estimated hours taken: 12
Branches: main

Fix a bug that caused bootchecks with --optimize-constructor-last-call to fail.

The problem was not in lco.m, but in follow_code.m. In some cases,
(specifically, the LCMC version of insert_2 in sparse_bitset.m),
follow_code.m moved an impure goal (store_at_ref) into the arms of an
if-then-else without marking those arms, or the if-then-else, as impure.
The next pass, simplify, then deleted the entire if-then-else, since it
had no outputs. (The store_at_ref that originally appeared after the
if-then-else was the only consumer of its only output.)

The fix is to get follow_code.m to make branched control structures such as
if-then-elses, as well as their arms, semipure or impure if a goal being moved
into them is semipure or impure, or if they came from an semipure or impure
conjunction.

Improve the optimization of the LCMC version of sparse_bitset.insert_2, which
had a foreign_proc invocation of bits_per_int in it: replace such invocations
with a unification of the bits_per_int constant if not cross compiling.

Add a new option, --optimize-constructor-last-call-null. When set, LCMC will
assign NULLs to the fields not yet filled in, to avoid any junk happens to be
there from being followed by the garbage collector's mark phase.

This diff also makes several other changes that helped me to track down
the bug above.

compiler/follow_code.m:
	Make the fix described above.

	Delete all the provisions for --prev-code; it won't be implemented.

	Don't export a predicate that is not now used anywhere else.

compiler/simplify.m:
	Make the optimization described above.

compiler/lco.m:
	Make sure that the LCMC specialized procedure is a predicate, not a
	function: having a function with the mode LCMC_insert_2(in, in) = in
	looks wrong.

	To avoid name collisions when a function and a predicate with the same
	name and arity have LCMC applied to them, include the predicate vs
	function status of the original procedure included in the name of the
	new procedure.

	Update the sym_name of calls to LCMC variants, not just the pred_id,
	because without that, the HLDS dump looks misleading.

compiler/pred_table.m:
	Don't have optimizations like LCMC insert new predicates at the front
	of the list of predicates. Maintain the list of predicates in the
	module as a two part list, to allow efficient addition of new pred_ids
	at the (logical) end without using O(N^2) algorithms. Having predicates
	in chronological order makes it easier to look at HLDS dumps and
	.c files.

compiler/hlds_module.m:
	Make module_info_predids return a module_info that is physically
	updated though logically unchanged.

compiler/options.m:
	Add --optimize-constructor-last-call-null.

	Make the options --dump-hlds-pred-id, --debug-opt-pred-id and
	--debug-opt-pred-name into accumulating options, to allow the user
	to specify more than one predicate to be dumped (e.g. insert_2 and
	its LCMC variant).

	Delete --prev-code.

doc/user_guide.texi:
	Document the changes in options.m.

compiler/code_info.m:
	Record the value of --optimize-constructor-last-call-null in the
	code_info, to avoid lookup at every cell construction.

compiler/unify_gen.m:
compiler/var_locn.m:
	When deciding whether a cell can be static or not, make sure that
	we never make static a cell that has some fields initialized with
	dummy zeros, to be filled in for real later.

compiler/hlds_out.m:
	For goals that are semipure or impure, note this fact. This info was
	lost when I changed the representation of impurity from markers to a
	field.

mdbcomp/prim_data.m:
	Rename some ambiguous function symbols.

compiler/intermod.m:
compiler/trans_opt.m:
	Rename the main predicates (and some function symbols) of these modules
	to avoid ambiguity and to make them more expressive.

compiler/llds.m:
	Don't print line numbers for foreign_code fragments if the user has
	specified --no-line-numbers.

compiler/make.dependencies.m:
compiler/mercury_to_mercury.m:
compiler/recompilation.usage.m:
	Don't use io.write to write out information to files we may need to
	parse again, because this is vulnerable to changes to the names of
	function symbols (e.g. the one to mdbcomp/prim_data.m).

	The compiler still contains some uses of io.write, but they are
	for debugging. I added an item to the todo list of the one exception,
	ilasm.m.

compiler/recompilation.m:
	Rename a misleading function symbol name.

compiler/parse_tree.m:
	Don't import recompilation.m here. It is not needed (all the components
	of parse_tree that need recompilation.m already import it themselves),
	and deleting the import avoids recompiling almost everything when
	recompilation.m changes.

compiler/*.m:
	Conform to the changes above.

compiler/*.m:
browser/*.m:
slice/*.m:
	Conform to the change to mdbcomp.

library/sparse_bitset.m:
	Use some better variable names.
2007-01-19 07:05:06 +00:00
Peter Wang
742c919c64 Fix problem installing grade libraries with `mmake --use-mmc-make'.
Estimated hours taken: 1
Branches: main

browser/Mmakefile:
mdbcomp/Mmakefile:
	Fix problem installing grade libraries with `mmake --use-mmc-make'.
	`mmc --make' only makes `.init' files as a side-effect of building
	libraries so move library dependencies before init file dependencies
	in install targets.  Also we need to use lib<name> targets instead of
	separate lib<name>.$A and lib<name>.$(EXT_FOR_SHARED_LIB) targets.

	Don't install mer_mdbcomp.init to non-grade specific directory.

library/Mmakefile:
	Remove `install_init' rule that installed mer_std.init to
	non-grade specific directory.
2007-01-08 07:07:04 +00:00
Zoltan Somogyi
2bada9761f Eliminate some code duplication by unifying the two goal_path types have had
Estimated hours taken: 2
Branches: main

Eliminate some code duplication by unifying the two goal_path types have had
until now: one in mdbcomp/program_representation.m and compiler/hlds_goal.m,
which differed in only one detail (whether we record the total number of arms
in a switch). The new type is in program_representation.m, but with the
definition from goal_path.m.

Add a "step_" prefix to the function symbols of the goal_path_step type,
to avoid ambiguity with the hlds goals the steps describe.

Turn the predicates operating on goal_paths into functions for greater
convenience of use.

mdbcomp/program_representation.m:
compiler/hlds_goal.m:
	Make the change described above.

browser/*.m:
compiler/*.m:
mdbcomp/*.m:
slice/*.m:
	Conform to the change above.

tests/debugger/*.exp:
	Expect the extra information now available for goal path steps
	describing switches.
2007-01-06 10:56:27 +00:00
Simon Taylor
6de3b102ba Add support for deconstructing by functor number rather than name,
Estimated hours taken: 20
Branches: main

Add support for deconstructing by functor number rather than name,
for use by write_binary.

library/deconstruct.m:
runtime/mercury_deconstruct.h:
runtime/mercury_deconstruct.c:
runtime/mercury_ml_expand_body.h:
runtime/mercury_ml_deconstruct_body.h:
	Add predicates deconstruct.functor_number and
	deconstruct.deconstruct.du, which returns a functor number
	suitable for use by construct.construct rather than a functor
	name.

library/construct.m:
library/term.m:
browser/term_rep.m:
extras/quickcheck/qcheck.m:
tests/valid/agc_unbound_typevars.m:
tests/valid/agc_unbound_typevars2.m:
	Add a function get_functor_lex, which returns the lexicographic
	functor number given an ordinal functor number.

	Add equivalence types to make it clearer which ordering is
	being used by which functor numbers.

	Remove a C-ism: num_functors now fails rather than returning -1
	for types without functors.

NEWS:
	Document the new predicates and functions.

runtime/mercury_type_info.h:
runtime/mercury_builtin_types.c:
runtime/mercury_mcpp.h:
compiler/rtti.m:
compiler/rtti_out.m:
compiler/type_ctor_info.m:
compiler/rtti_to_mlds.m:
compiler/opt_debug.m:
	Add a field to MR_TypeCtorInfo which contains a mapping from
	an ordinal functor number to a lexicographic functor number
	which can be passed to construct.construct.

	Bump MR_RTTI_VERSION.

tests/hard_coded/expand.m:
tests/hard_coded/expand.exp:
tests/hard_coded/expand.exp2:
tests/hard_coded/construct_test.m:
tests/hard_coded/construct_test.exp:
tests/hard_coded/construct_test_exist.m:
tests/hard_coded/construct_test_exist.exp:
	Test cases.
2007-01-05 02:19:46 +00:00
Simon Taylor
f1275fa6e8 Implement io.write for arbitrary streams. With type specialization
Estimated hours taken: 25
Branches: main

Implement io.write for arbitrary streams.  With type specialization
this is only slightly slower than the original.

library/stream.string_writer.m:
library/library.m:
	A module containing predicates for writing to streams
	which accept strings.

library/stream.m:
	Move stream.format to stream.string_writer.m.

	Add stream.put_list, which is like io.write_list.

library/io.m:
	Move io.write and io.print to stream.string_writer.m.

library/term_io.m:
	Add stream versions of predicates used by io.write.

library/ops.m:
	Move io.adjust_priority_for_assoc to here (private
	predicate used only by library modules).

	Export ops.mercury_max_priority for use by
	stream.string_writer.write.

Mmake.common.in:
compiler/modules.m:
compiler/mlds.m:
compiler/mlds_to_c.m:
compiler/mlds_to_java.m:
compiler/mlds_to_managed.m:
compiler/prog_util.m:
compiler/format_call.m:
mdbcomp/prim_data.m:
	Allow sub-modules in the standard library.

compiler/polymorphism.m:
	Fix a bug which caused tests/hard_coded/print_stream.m to
	fail with this change.  The wrong argument type_info would
	be extracted from a typeclass_info if the constraints of the
	typeclass-info were not all variables.

browser/browse.m:
tests/hard_coded/stream_format.m:
tests/hard_coded/test_injection.m:
tests/invalid/string_format_bad.m:
tests/invalid/string_format_unknown.m:
	Updated for predicates moved between library modules.

util/mdemangle.c:
	The demangler doesn't properly handle the arguments MR_DECL_LL*
	and various other recently added macros for type specialized
	procedures.  It's still broken (it doesn't handle mode and label
	suffixes properly), but the output is at least more readable.
2006-12-21 11:11:37 +00:00
Julien Fischer
5f1ecdb283 Fix a typo in the browser help message.
Estimated hours taken: 0
Branches: main

Fix a typo in the browser help message.

browser/browse.m:
	s/flat-prety/flat-pretty/
2006-12-05 03:20:07 +00:00
Julien Fischer
26de67a4c4 Remove support for non-grade specific .init files.
Estimated hours taken: 0.5
Branches: main

Remove support for non-grade specific .init files.

browser/Mmakefile:
runtime/Mmakefile:
scripts/Mmake.rules:
compiler/make.program_target.m:
	Don't install the .init files in the non-grade specific location.
2006-12-04 01:33:29 +00:00
Julien Fischer
b4c3bb1387 Clean up in unused module imports in the Mercury system detected
Estimated hours taken: 3
Branches: main

Clean up in unused module imports in the Mercury system detected
by --warn-unused-imports.

analysis/*.m:
browser/*.m:
deep_profiler/*.m:
compiler/*.m:
library/*.m:
mdbcomp/*.m:
profiler/*.m:
slice/*.m:
	Remove unused module imports.

	Fix some minor departures from our coding standards.

analysis/Mercury.options:
browser/Mercury.options:
deep_profiler/Mercury.options:
compiler/Mercury.options:
library/Mercury.options:
mdbcomp/Mercury.options:
profiler/Mercury.options:
slice/Mercury.options:
	Set --no-warn-unused-imports for those modules that are used as
	packages or otherwise break --warn-unused-imports, e.g. because they
	contain predicates with both foreign and Mercury clauses and some of
	the imports only depend on the latter.
2006-12-01 15:04:40 +00:00
Zoltan Somogyi
9ec86d6a6d The objective of this diff is to switch from a table of solver events built
Estimated hours taken: 32
Branches: main

The objective of this diff is to switch from a table of solver events built
into the compiler (and eventually the debugger) into a table of events
defined by a file provided by the user to the compiler, which the compiler
then records in the executable for use by the debugger.

The current design, for speed of implementation, uses temporary files parsed
by a bison-generated parser. Since the compiler needs to be able to invoke
the parser even if it is compiled in a non-debug grade, the parser is in
a new library, the eventspec library, that is always linked into the Mercury
compiler and is always linked into any Mercury program with debugging enabled
(but is of course linked only once into a Mercury compiler which has debugging
enabled).

Modify the debugger to give it the ability to print the attributes of
user-defined events (for now, only the non-synthesized attributes).
Implement a new debugger command, "user", which goes to the next user-defined
event.

configure.in:
	Require flex and and bison to be available.

doc/user_guide.texi:
	Document user defined events and the new debugger capabilities.

doc/mdb_categories:
	Include "user" in the list of forward movement commands.

	Fix some earlier omissions in that list.

runtime/mercury_stack_layout.h:
	Include an event number in the user-defined event structure.

	Include a string representing an event set specification in module
	layout structures.

runtime/mercury_stack_layout.h:
runtime/mercury_trace_base.[ch]:
runtime/mercury_types.h
	Switch from solver events to user events in names.

runtime/mercury_trace_term.[ch]:
	Provide a representation of flat terms, for use in representing
	the calls that generate synthesized attributes.

	Ensure that exported field names have an MR_ prefix.

browser/cterm.m:
	Conform to the change to runtime/mercury_trace_term.h.

scripts/c2init.in:
scripts/ml.in:
	Include the eventspec library in programs compiled with debugging
	enabled.

compiler/Mmakefile:
	Include the eventspec library in the compiler.

compiler/options.m:
	Add a new option, --event-spec-file-name, that allows the user to
	specify the set of user-defined events the program may use.

compiler/handle_options.m:
	Set this optimization from an environment variable (which may be
	set by the mmc script) if the new option is not explicitly given.

compiler/prog_data.m:
	Define the data structures for the compiler's representation of the
	event set specification.

	Move some definitions around to group them more logically.

compiler/hlds_module.m:
	Include the event set specification as a new field in the module_info.

compiler/prog_event.m:
	Add the code for invoking the parser in the eventspec library,
	and for converting the simple term output by the parser to the
	compiler own representation, which contains more information
	(to wit, the types of the function attributes) and which has had
	a whole bunch of semantic checks done on it (e.g. whether synthesized
	attributes depend on themselves or on nonexistent attributes).

	Provide a function to generate a canonicalized version of the event
	specification file.

compiler/module_qual.m:
compiler/equiv_type.m:
	Process event spec specifications as well as items, to module qualify
	the names of the types of event arguments, and expanding out
	equivalence types.

	In equiv_type.m, rename some variables to make clear what kind of info
	they represent.

compiler/mercury_compile.m:
	Process the event set specification file if one has been selected:
	read it in, module qualify it, expand its equivalence types, and add
	to the module_info.

compiler/compile_target_code.m:
	Include the event_spec library when linking debuggable executables.

compiler/call_gen.m:
compiler/continuation_info.m:
compiler/trace_gen.m:
compiler/trace_params.m:
mdbcomp/prim_data.m:
mdbcomp/trace_counts.m:
runtime/mercury_goto.h:
	Generate user-defined events instead of solver events.

compiler/layout.m:
compiler/layout_out.m:
compiler/stack_layout.m:
	Include a canonicalized version of the event specification file
	in the module layout if the module has any user-defined events.

compiler/code_info.m:
compiler/llds_out.m:
compiler/modes.m:
compiler/modules.m:
compiler/opt_debug.m:
compiler/typecheck.m:
	Conform to the changes above.

compiler/passes_aux.m:
	Rename a predicate to avoid an ambiguity.

trace/Mmakefile:
	Add the definition and rules required to build the eventspec library.

trace/mercury_event_scanner.l:
trace/mercury_event_parser.y:
	A scanner and a parser for reading in event spec specifications.

trace/mercury_event_spec_missing.h:
	Provide the declarations that should be (but aren't) provided by
	flex and bison.

trace/mercury_event_spec.[ch]:
	The main module of the eventspec library. Provides functions to read
	in event set specifications from a file, and to write them out as a
	Mercury term in the form needed by the compiler.

trace/mercury_trace_tables.c:
	If the module layouts being registered include event set
	specifications, then check their consistency. Make the specification
	and the consistency indication available to other modules.

trace/mercury_trace_internal.c:
	During initialization, if the modules contain a consistent set of event
	set specifications, then read that specification into the debugger.
	(We don't yet make use of this information.)

	Add an extra mdb command, "user", which goes forward to the next
	user-defined event.

trace/mercury_trace.[ch]:
trace/mercury_trace_cmd_forward.[ch]:
	Implement the new mdb command.

trace/mercury_trace_vars.[ch]:
	For user-defined events, include the attributes' values among the
	values that can be printed or browsed.

trace/mercury_trace_cmd_browsing.c:
trace/mercury_trace_declarative.c:
	Minor changes.

scripts/scripts/prepare_tmp_dir_grade_part:
	Copy the .y and .l files to the tmp dir we use for installs.

tools/bootcheck:
	Copy the .y and .l files of the trace directory to stage 2.

tools/lmc.in:
	Include the eventspec library when linking debuggable executables.

tests/debugger/user_event.{m,inp,exp}:
tests/debugger/user_event_spec:
	New test case to test the new functionality.

tests/debugger/Mercury.options:
tests/debugger/Mmakefile:
	Enable the new test case.

tests/debugger/completion.exp:
	Expect the new "user" mdb command in the completion output.
2006-11-24 03:48:30 +00:00
Julien Fischer
3ace02fd26 A side effect of the introduction of trace goals is that .init files are
Estimated hours taken: 10
Branches: main

A side effect of the introduction of trace goals is that .init files are
now grade dependent.  Consider a module that contains the following
trace goal:

	trace [ compile_time(grade(debug)),
		run_time(env("FOO"))
	] (
		...
	),

In a debug grade the .init file for a library containing that module will
include the following directive:

	ENVVAR FOO

In a non-debug grade it won't.  At the moment which version of the .init
file is actually installed depends upon which grade was the first to
be built.  This can result in linker errors if the wrong grade is used
with the wrong .init file.

There are two possible fixes.  (1) always output ENVVAR directives
regardless of whether the compile time conditions of the trace goals to
which they are attached are true or not.  (2) build grade specific .init
files and install them in grade specific locations.

The following diff implements the first stage of (2).  For each grade in
which a library is to be installed we create a grade specific .init file
and then install it in a grade specific location, e.g.
`$(INSTALL_PREFIX)/lib/mercury/modules/<grade>'.  (For bootstrapping
purposes .init files are currently still installed in the old location
as well.)

After this change has been installed on our machines I will add the
second part of this change which modifies the compiler to look for the
.init files in the new grade specific locations.  The final part of the
change will then remove support for installing .init files in the old
location.)

scripts/Mmake.vars.in:
	Add a variable that holds the name of a grade specific directory
	in which to install .init files.

scripts/Mmake.rules:
	Add a rule to install the .init files in a grade specific location.

browser/Mmakefile:
mdbcomp/Mmakefile:
runtime/Mmakefile:
	Change the dependencies on the library installation targets so
	that installing a library causes the .init files to be built and
	installed.
	(Currently this dependency is on the install target, which means
	that the install_init rule is only invoked once, rather than
	every time a grade is built.)

	Install the .init files for these libraries in grade specific
	locations.  (For bootstrapping purposes they are currently also
	installed in the old location.)

runtime/Mmakefile:
	Remove the code that deletes runtime.init if it exists.
	(Anyone who has a Mercury installation old enough for this to
	be a problem is going to encounter more serious problems than
	the runtime being initialized twice.)

	Unrelated change: remove some duplicate entries from the list
	of header files.

compiler/make.program_target.m:
	Have mmc --make install the .init files in a grade specific location.
	(They are also still installed in the old location.)

NOTE: the `XXX trace goal fix.' comments are placeholders for
things that need to be changed during the latter stages of this change.
2006-11-23 04:08:55 +00:00
Ian MacLarty
3cba42d5cc Use the new stream typeclass in the term_to_xml standard library module.
Estimated hours taken: 5
Branches: main

Use the new stream typeclass in the term_to_xml standard library module.
In the process remove some clutter from the interface by marking as obsolete
the predicates that do not take a stream argument and remove the
"_to_stream" suffix from those predicates that do take a stream
argument.

library/term_to_xml.m:
	Use the stream.writer/3 typeclass where appropriate.

	Make all XML writer predicates require a stream argument
	and remove the "_to_stream" suffix from these predicates.

	Move all deprecated predicates to the end of the interface and
	pragma obsolete them.

	Reword some comments.

	Remove the behaviour of replacing "]]>" with "]]&gt;" in CDATA
	elements, since that behaviour is a bit misleading, because "&gt;"
	has no special meaning in CDATA.  Instead just document that "]]>"
	is not allowed in CDATA elements.

browser/browse.m:
tests/hard_coded/write_xml.m:
tests/hard_coded/xmlable_test.m:
	Conform to the above changes.
2006-10-30 07:20:57 +00:00
Zoltan Somogyi
e21193c283 Rename a bunch of predicates and function symbols to eliminate
Estimated hours taken: 6
Branches: main

browser/*.m:
compiler/*.m:
	Rename a bunch of predicates and function symbols to eliminate
	ambiguities.

	The only real change is factoring out some common code in the mlds
	and llds code generators, replacing them with single definitions
	in switch_util.m.
2006-10-15 23:26:56 +00:00
Julien Fischer
2d25acf696 Change the representation of file streams in the io module so that they
Estimated hours taken: 25
Branches: main

Change the representation of file streams in the io module so that they
can be used as typeclass instances.  This is not currently possible because
file streams are defined as equivalence types and making them typeclass
instances results in overlapping instances.

This diff changes the representation by putting notag wrappers around the
various file stream types: io.input_stream, io.output_stream,
io.binary_input_stream, etc.  This avoids the problem with overlapping
instances.  It also improves type-safety; it is now not possible to pass a
binary input stream where a binary output stream is expected and so forth.

This change is complicated by the fact that the io module interacts with both
the runtime and the debugger via the C interface.  In order to preserve the
existing C interface that the io module presents to the runtime (the
alternative being to more or less change all the argument types to MR_Word),
the I/O operations that operate on file streams have been split into two
parts: a "typed" part that is exported from the io module and an "untyped"
part that deals with primitive streams (the io.stream type).

For the debugger the problem is the reverse since there we typically pass
values of type MercuryFilePtr to exported Mercury procedures.  In order
to avoid warnings from gcc we add a set of macros to the runtime that
wrap or unwrap MercuryFilePtrs.  There should be no performance impact
since the macros just expand to casts.

library/io.m:
	Do not define the various I/O streams as equivalence types in order
	to avoid problems with overlapping instances when these types are
	used as typeclass instances.

	Mark io.seek_binary/5 and io.binary_stream_offset/4 as obsolete.
	Add a typeclass io.binary_stream and make both binary file stream
	types instances of it.  This is so that the above predicates will
	continue to work until they are deleted.

	Add new predicates: io.seek_binary_input/5, io.seek_binary_output/5
	io.binary_input_stream_offset/4 and io.binary_input_stream_offset/4
	to replace the above.

	When using io.write to print file streams strip off the wrapper
	before printing the entry from the stream database.  The information
	in the wrapper is redundant - we use that from the stream db since
	that is more detailed.

	Format some section headings to conform with our current coding
	standard.

	Lots of minor formatting changes.

runtime/mercury_init.h:
	s/io.h/io.mh/ in a comment.

runtime/mercury_library_types.h:
	Add macros to wrap (and in one case unwrap) file stream types
	as we pass them across the C interface.  This avoids warnings
	from gcc.

browser/listing.m:
	Upwrap the input stream passed to mercury_stream_to_c_FILE_star
	before trying to extract the underlying C file pointer.

trace/mercury_trace_browse.c:
trace/mercury_trace_declarative.c:
trace/mercury_trace_external.c:
trace/mercury_trace_help.c:
	Use the new macros in the runtime to wrap streams that we pass back to
	Mercury procedures.

compiler/export.m:
	Unrelated change: s/Word/MR_Word/

NEWS:
	Announce the changes to the io module.

tests/debugger/declarative/io_stream_test.exp2:
	Conform to the changes in the io module.

tests/hard_coded/Mmakefile:
tests/hard_coded/print_stream.{m,exp}:
	Test for io.write and file streams.

tests/invalid/Mmakefile:
tests/invalid/mixed_up_streams.{m,err_exp}:
	Test that it isn't possible to pass binary input streams where
	binary output streams are expected.

tests/valid/Mmakefile:
tests/valid/file_stream_instances.m:
	Add a test case to check that we can use the various file stream
	types as typeclass instances.
2006-10-09 06:40:29 +00:00
Zoltan Somogyi
863874df85 Document my recent change implementing coverage testing.
Estimated hours taken: 6
Branches: main

Document my recent change implementing coverage testing. At the same time,
eliminate the old hack that allowed a file containing a list of file names to
be considered a trace count file. We haven't needed it since the addition of
mtc_union, and it can lead to incomprensible error messages. (The presence
of the old hack made documenting coverage testing harder.)

In the process, fix the tools code for rerunning failed test cases only.

doc/user_guide.texi:
	Document my recent change implementing coverage testing, and the
	elimination of the old hack.

mdbcomp/trace_counts.m:
	Modify the predicates for reading in trace count files along the lines
	above.

mdbcomp/slice_and_dice.m:
	Modify the predicates for reading in slices and dices along the lines
	above.

	Rename some function symbols to avoid ambiguities.

compiler/tupling.m:
slice/mcov.m:
slice/mtc_diff.m:
slice/mtc_union.m:
trace/mercury_trace_declarative.c:
	Conform to the changes above.

slice/mcov.m:
	Fix the usage message, which referred to this program by its old name
	mct.

	Allow the output to be restricted to a set of named modules only.
	This is to make testing easier.

slice/mtc_diff.m:
	Rename the long form of the -o option from --out to --output-file,
	to make it consistent with the other programs.

tests/run_one_test:
tools/bootcheck:
	Modify the algorithm we use to gather trace counts for the Mercury
	compiler from both passed and failed test cases to run mtc_union
	periodically instead of gathering all the trace counts file and keeping
	them to the end (which takes far too much disk space).

	Fix an old bug: gather trace counts from executions of the Mercury
	compiler only.

tests/debugger/Mmakefile:
tests/debugger/dice.passes:
	Modify the dice test case to compute the union of the trace counts for
	the passed versions of this test case to use mtc_union to create
	dice.passes, instead of having dice.passes statically contain the list
	of the names of the passed trace count files (since that capability
	is deleted by this diff).

tools/bootcheck:
tests/Mmake.common:
	Fix the code for rerunning failed tests only.

mdbcomp/prim_data.m:
	Eliminate some ambiguities in predicate names.

compiler/*.m:
	Conform to the change to prim_data.m.

compiler/error_util.m:
	Add reading files as a phase in error messages.

compiler/mercury_compile.m:
	Use the new facilities in error_util for printing an error message.
2006-10-02 05:21:44 +00:00
Zoltan Somogyi
9eed887d33 This diff is the second step in implementing trace events.
Estimated hours taken: 24
Branches: main

This diff is the second step in implementing trace events. It modifies
label layouts to include room for solver-event-specific information, and
modifies the compiler to generate this information. Modifications to the
debugger to use this information, user-level documentation and test cases
will come later.

runtime/mercury_stack_layout.h:
	Modify label layouts to allow them to hold information about solver
	events.

	Modify the macros creating label layouts to include a null pointer
	as the value of the label layout's solver event field. For each such
	macro, add a version that puts a pointer to the label's solver event
	structure in that field.

	Modify the definition of the MR_Long_Lval type to allow the
	representation of constants, since without this capability solver
	events would often need to be preceded by code to put constant
	values (e.g. solver ids) into lvals. To make it easier to locate
	all the places where MR_Long_Lvals are used (which need to be updated),
	change the type MR_Long_Lval from a synonym for an int to a structure
	containing an int.

runtime/mercury_types.h:
	Add the typedefs now required for mercury_stack_layout.h.

runtime/mercury_goto.h:
	Add a macro needed by mercury_stack_layout.h.

runtime/mercury_grade.h:
	Change the binary compatibility version number for debug grades,
	due to the change to label layouts.

runtime/mercury_layout_util.c:
	Update the functions interpreting MR_Long_Lvals to conform to the
	change in mercury_stack_layout.h.

runtime/mercury_deep_profiling_hand.h:
	Fix a bug, possibly the bug preventing us from bootchecking in deep
	profiling grades: stack slot numbers of ProcStatic structures are
	supposed to be plain integers, not MR_Long_Lvals.

runtime/mercury_stack_trace.c:
library/exception.m:
trace/mercury_trace.c:
	Conform the change in MR_Long_Lval.

runtime/mercury_trace_base.[ch]:
	Add a new port: the solver event port.

	Add a macro and a function for solver events: MR_SOLVER_EVENT and
	MR_solver_trace. For now, they do the same thing as MR_EVENT and
	MR_trace, but in future, they can do something else (e.g. generate
	information for a visualization tool).

mdbcomp/prim_data.m:
	Add a new port: the solver event port.

	Rename all ports to eliminate clashes with language keywords such as
	"call".

mdbcmp/trace_counts.m:
browser/declarative_execution.m:
slice/mcov.m:
compiler/tupling.m:
	Conform to the change in port names, and to the addition of the new
	port.

compiler/trace_params.m:
	Conform to the change in port names, and to the addition of the new
	port.

	Rename some function symbols to avoid some ambiguities.

trace/mercury_trace_declarative.c:
	Ignore the solver port when building the annotated trace, since it
	doesn't fit into it.

compiler/prog_event.m:
	Extend the representation of events to include names for the event
	attributes.

compiler/call_gen.m:
	Implement event goals. The implementation consists of a call to
	MR_SOLVER_EVENT with a layout structure whose solver event field
	points to a solver event structure giving the event goal's arguments.

	Rename some function symbols to avoid some ambiguities.

compiler/trace_gen.m:
	Add a predicate for generating solver events.

	Conform to the change in port names.

	Rename some function symbols to avoid some ambiguities.

compiler/code_info.m:
	When recording trace layout information for a label, take an extra
	argument describing the label layout's associated solver event, if any.

compiler/continuation_info.m:
	Extend the first representation of label layouts to include room
	for solver events.

compiler/stack_layout.m:
	Convert the representation of solver events in continuation_info.m's
	data structure to the data structure required by layout_out.m.

	Conform to the changes in MR_Long_Lvals.

compiler/layout.m:
	Extend the compiler's internal representation of the contents of label
	layout structures to accommodate the optional solver event field.

compiler/layout_out.m:
	Generate the extended label layout structures, using the new macros
	in mercury_stack_layout.h if necessary.

	Conform to the change in the MR_Long_Lval type.

	Conform to the change in port names.

	Rename some function symbols to avoid some ambiguities.

compiler/global_data.m:
	Modify rval_type_as_arg to require only the value of the relevant
	option, not a package of such options. This is for the new code
	in stack_layout.m.

compiler/var_locn.m:
	Conform to the change in global_data.m.

compiler/llds_out.m:
	Conform to the change in continuation_info.m.

	Delete this module's unused definition of rval_type_as_arg.

compiler/opt_debug.m:
	Conform to the change in continuation_info.m.
2006-09-29 06:34:57 +00:00
Zoltan Somogyi
2ca194ab17 Rename some function symbols and predicates to eliminate a bunch
Estimated hours taken: 3
Branches: main

library/term_to_xml.m:
library/rtti_implementation.m:
	Rename some function symbols and predicates to eliminate a bunch
	of ambiguities.

browser/browse.m:
tests/hard_coded/write_xml.m:
tests/hard_coded/xmlable_test.m:
	Conform to the change above.
2006-09-25 01:56:17 +00:00
Zoltan Somogyi
f9cac21e3e Get rid of a bunch more ambiguities by renaming predicates, mostly
Estimated hours taken: 8
Branches: main

Get rid of a bunch more ambiguities by renaming predicates, mostly
in polymorphism.m, {abstract,build,ordering}_mode_constraints.m, prog_type.m,
and opt_debug.m in the compiler directory and term_io.m, term.m, parser.m,
and string.m in the library.

In some cases, when the library and the compiler defined the same predicate
with the same code, delete the compiler's copy and give it access to the
library's definition by exporting the relevant predicate (in the undocumented
part of the library module's interface).

NEWS:
	Mention that the names of some library functions have changed.

library/*.m:
compiler/*.m:
mdbcomp/*.m:
browser/*.m:
	Make the changes mentioned above, and conform to them.

test/general/string_test.m:
test/hard_coded/string_strip.m:
test/hard_coded/string_strip.exp:
	Conform to the above changes.
2006-09-20 09:42:28 +00:00
Zoltan Somogyi
91501d2453 This diff is the first step in implementing trace events.
Estimated hours taken: 12
Branches: main

This diff is the first step in implementing trace events. It introduces the
representation of trace event goals into both the parse tree and HLDS
representations, and updates most compiler passes to handle them.
Changes to the code generator and to the runtime system, user-level
documentation and test cases will come later.

library/ops.m:
	Add "event" as an operator.

mdbcomp/program_representation.m:
	Extend the representation of goals to include events.

browser/declarative_execution.m:
	Allow the reconstruction from bytecode of event goals.

browser/declarative_tree.m:
	Extend the algorithm for following terms to their sources to allow
	it to traverse events (which never generate any values).

compiler/prog_item.m:
compiler/hlds_goal.m:
	Extend the parse tree and the HLDS representations to include event
	goals.

compiler/prog_io_goal.m:
	Convert the term representation of events to the parse tree
	representation.

compiler/add_clause.m:
	Convert the parse tree representation of events to the HLDS
	representation.

compiler/prog_event.m:
	Add this new module to contain the compiler's database of event types.

compiler/notes/compiler_design.html:
	Mention the new module.

compiler/parse_tree.m:
	Include the new module.

compiler/prog_rep.m:
	Generate the extended bytecode for event goals.

compiler/mercury_to_mercury.m:
	Output event goals.

compiler/typecheck.m:
	Typecheck event goals. The types of the arguments of each event type
	is given by the database in prog_event.m.

compiler/typecheck_errors.m:
	Add a predicate for reporting unknown events.

compiler/modecheck_call.m:
	Add a predicate to modecheck event goals. The modes of the arguments
	are also given by the database in prog_event.m.

compiler/modes.m:
	Call the new predicate in modecheck_call.m for event goals.

	Some predicates in this module took a boolean flag, tested many times
	at runtime, to control whether an exact match was required or not.
	However, the choice was fixed at all call sites except one. I have
	split each predicate into two, one for each value of the boolean flag,
	both for clarity of code and for slightly improved speed.

compiler/ml_call_gen.m:
	Ignore event goals, since the MLDS backend doesn't support debugging.

compiler/call_gen.m:
	Document the fact that event goals *should* be handled here.

compiler/build_mode_constraints.m:
compiler/deep_profiling.m:
compiler/exception_analysis.m:
compiler/goal_util.m:
compiler/hlds_out.m:
compiler/hlds_pred.m:
compiler/intermod.m:
compiler/mercury_to_mercury.m:
compiler/mlds_to_c.m:
compiler/mode_constraints.m:
compiler/modecheck_unify.m:
compiler/module_qual.m:
compiler/prog_util.m:
compiler/purity.m:
compiler/simplify.m:
compiler/superhomogeneous.m:
compiler/tabling_analysis.m:
compiler/term_traversal.m:
compiler/trailing_analysis.m:
compiler/typecheck.m:
compiler/typecheck_errors.m:
compiler/unique_modes.m:
	Handle the new goal type. In most cases the new code should be
	functional, but in a few cases (e.g. constraint based mode analysis
	and deep profiling) it just aborts the compiler.
2006-09-05 06:21:37 +00:00
Julien Fischer
553fb3f7d9 Use pragma foreign_export' in preference to pragma export' throughout
Estimated hours taken: 1
Branches: main

Use `pragma foreign_export' in preference to `pragma export' throughout
the Mercury distribution.

Convert more of the extras distribution to four-space indentation and
other minor cleanups.

browser/*.m:
library/*.m:
samples/*:
extras/*:
	As above.
2006-08-31 11:09:54 +00:00
Julien Fischer
54a8a4f99d Avoid failing the namespace cleanliness check in .par grades.
Estimated hours taken: 0.1
Branches: main

Avoid failing the namespace cleanliness check in .par grades.
Boehm GC now intercepts several pthread functions.

browser/RESERVED_MACRO_NAMES:
library/RESERVED_MACRO_NAMES:
runtime/RESERVED_MACRO_NAMES:
trace/RESERVED_MACRO_NAMES:
	Conform to the recent update of the Boehm collector.
2006-08-30 14:11:48 +00:00
Zoltan Somogyi
00741b0162 This diff contains no algorithmic changes.
Estimated hours taken: 6
Branches: main

This diff contains no algorithmic changes. It merely renames apart a bunch more
function symbols to reduce ambiguity.

After this diff, the summary line from the mdb command "ambiguity -f" is

	Total: 351 names used 975 times, maximum 31, average: 2.78

browser/*.m:
compiler/*.m:
	Rename function symbols to eliminate ambiguities.

tests/debugger/declarative/dependency.exp:
tests/debugger/declarative/dependency2.exp:
	Update the expected out where some internal function symbol names
	appear in the output of the debugger. (This output is meant for
	implementors only.)
2006-08-22 05:04:29 +00:00
Julien Fischer
98894f79cc Add the equivalences text_input_stream == input_stream and
Estimated hours taken: 0.2
Branches: main, release

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

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

	Reformat some documentation.

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

library/dir.m:
	Reposition a section heading.

library/string.m:
browser/declarative_tree.m:
compiler/java_util.m:
compiler/mercury_compile.m:
compiler/typecheck.m:
	Fix some typos.
2006-07-28 04:54:04 +00:00
Peter Wang
257dcf24ca This patch adds preliminary support for deterministic, dependent
Estimated hours taken: 50
Branches: main

This patch adds preliminary support for deterministic, dependent
parallel conjunctions to the low-level backend.  In other backends
dependent parallel conjunctions are converted into plain conjunctions.

For a parallel conjunction (A & B), if the goal B is dependent on a variable
X which is bound by goal A, we transform the conjunction such that
goal B must wait for the value to be produced by A before it begins
executing.  This transformation is not yet useful in practice (you might as
well use a sequential conjunction).  A later version of this transformation
will move the synchronisation deeper into the goals so that B can execute as
much as possible before it waits for the value from A.

There is no coroutining support yet so if there are not enough threads
available then dependent parallel conjunctions can cause the program to
deadlock.


configure.in:
runtime/mercury_conf.h.in:
	Check for existence of semaphore.h and #define MR_HAVE_SEMAPHORE_H
	if it does.

library/library.m:
library/par_builtin.m:
library/private_builtin.m:
mdbcomp/prim_data.m:
mdbcomp/program_representation.m:
	Add a new module `par_builtin' to hold synchronisation primitives.

compiler/modules.m:
	Import `par_builtin' module in parallel grades.

compiler/dep_par_conj.m:
compiler/transform_hlds.m:
compiler/mercury_compile.m:
	Add a transformation to detect dependent parallel conjunctions
	and insert the necessary synchronisation code.

compiler/hlds_goal.m:
	Consider empty parallel conjunctions as atomic, the same as plain
	conjunctions.

compiler/inlining.m:
	Flatten parallel conjunctions when inlining, as for plain conjunctions.

compiler/live_vars.m:
	Fix build_live_sets_in_par_conj to handle dependent parallel
	conjunctions.

compiler/liveness.m:
	Delay deaths in parallel conjunctions the same way as for plain
	conjunctions.

	Update detect_resume_points_in_par_conj for dependent parallel
	conjunctions.

compiler/mode_util.m:
	Treat parallel and plain conjunctions equally when recomputing instmap
	deltas.

compiler/modes.m:
compiler/unique_modes.m:
	Treat parallel and plain conjunctions equally when checking modes and
	uniqueness.  However, don't flatten parallel conjunctions into plain
	conjunctions and vice versa.

compiler/simplify.m:
	Don't reset instmaps and seen calls after each conjunct of a parallel
	conjunction.

compiler/store_alloc.m:
	Update allocation for dependent parallel conjunctions.

compiler/switch_detection.m:
	Detect switches in parallel conjunctions the same as plain
	conjunctions.

compiler/par_conj_gen.m:
	Add a todo comment.

tests/Mmakefile:
tests/par_conj/.cvsignore:
tests/par_conj/Mmakefile:
tests/par_conj/dep_par_1.m:
tests/par_conj/dep_par_10.m:
tests/par_conj/dep_par_11.m:
tests/par_conj/dep_par_11b.m:
tests/par_conj/dep_par_11c.m:
tests/par_conj/dep_par_12.m:
tests/par_conj/dep_par_13.m:
tests/par_conj/dep_par_14.m:
tests/par_conj/dep_par_14b.m:
tests/par_conj/dep_par_14c.m:
tests/par_conj/dep_par_14d.m:
tests/par_conj/dep_par_16.m:
tests/par_conj/dep_par_17.m:
tests/par_conj/dep_par_18.m:
tests/par_conj/dep_par_2.m:
tests/par_conj/dep_par_20.m:
tests/par_conj/dep_par_21.m:
tests/par_conj/dep_par_22.m:
tests/par_conj/dep_par_23.m:
tests/par_conj/dep_par_3.m:
tests/par_conj/dep_par_3b.m:
tests/par_conj/dep_par_3c.m:
tests/par_conj/dep_par_4.m:
tests/par_conj/dep_par_5.m:
tests/par_conj/dep_par_5b.m:
tests/par_conj/dep_par_5c.m:
tests/par_conj/dep_par_5d.m:
tests/par_conj/dep_par_6.m:
tests/par_conj/dep_par_7.m:
tests/par_conj/dep_par_8.m:
tests/par_conj/dep_par_9.m:
tests/par_conj/indep_par_append.exp:
tests/par_conj/indep_par_append.m:
tests/par_conj/indep_par_nested.exp:
tests/par_conj/indep_par_nested.m:
	Add some parallel conjunction test cases.  The dependent parallel
	conjunction tests are not yet executed as they can deadlock if there
	are not enough threads available.

browser/RESERVED_MACRO_NAMES:
library/RESERVED_MACRO_NAMES:
runtime/RESERVED_MACRO_NAMES:
trace/RESERVED_MACRO_NAMES:
	Add LINUX_THREADS, _REENTRANT and _THREAD_SAFE.
2006-06-28 04:46:26 +00:00
Julien Fischer
fc94027616 Fix the failure of debugger/declarative/sort.m.
Estimated hours taken: 3
Branches: main, release

Fix the failure of debugger/declarative/sort.m.  The problem was that the
depth command in the declarative debugger did not affect the depth to which
I/O actions were printed.  This was because printing I/O actions uses the
`print all' configuration parameters and the `depth' command in the
declarative debugger only affects the `print' configuration parameters.  The
solution is to add four new formatting commands to the declarative debugger
(really just variants of the existing commands.)  These are `depth io', `size
io', `lines io' and `width io'.  These function identically to the `depth',
`size', `lines' and `width' commands except that they affect the `print all'
configuration parameters, rather the ones for `print'.

browser/declarative_user.m:
	Add the four new commands described above.

doc/user_guide.texi:
	Document the new commands.

browser/declarative_debugger.m:
	Fix some formatting.

tests/debugger/declarative/sort.inp:
tests/debugger/declarative/sort.exp:
	Use the new commands set the depth to which I/O actions are printed in
	the declarative debugger to an appropriate level for this test - it
	needs to be deep enough to print out the strings returned by
	read_line_as_string_2.

tests/debugger/declarative/dd_params.exp:
tests/debugger/declarative/dd_params.inp:
	Extend this test to cover the new commands.
2006-06-13 06:48:56 +00:00
Zoltan Somogyi
74ce85d476 Provide a mechanism for collecting statistics about tabling operations,
Estimated hours taken: 60
Branches: main

Provide a mechanism for collecting statistics about tabling operations,
and provide a much more convenient mechanism for resetting tables.

Since it would too complex to do this while preserving the capability
of setting --tabling-via-extra-args to no, eliminate that capability
and the option. That option was useful only for measurements of the
performance boost from setting --tabling-via-extra-args to yes in any case,
so users lose no functionality.

Previously, the only way to debug the low level details of the tabling
mechanism was to build a runtime with a specific C macro (MR_TABLE_DEBUG)
and link with that runtime; this was cumbersome. Change that so that
every one of the debuggable tabling macros has a bool argument that says
whether debugging is enabled or not. The compiler can then set this to
MR_TRUE if the new option --table-debug is given, and to MR_FALSE otherwise.
If set to MR_FALSE, the C compiler should optimize away the debug code,
with zero impact on program size or speed.

Since these changes to macros require nontrivial bootstrapping, which we don't
want to do unnecessarily, modify the interface of the tabling macros as
required to support size limits on tables. This diff also implements the
parsing of size limit specifications on tables, but does not implement them
yet; that is for a future change.

To make the syntax simpler, this diff deletes the free-standing fast_loose_memo
pragma. The same functionality is now available with a fast_loose annotation
on an ordinary memo pragma.

Make a bunch of changes to improve readability and maintainability
in the process. These mostly take the form of renaming ambiguous and/or
not sufficiently expressive function symbols.

runtime/mercury_stack_layout.h:
runtime/mercury_tabling.h:
	Move the description of structure of tables from mercury_stack_layout.h
	to mercury_tabling.h, since we now need it for statistics even if
	execution tracing is not enabled.

	Modify those data structures to have room for the statistics.

	Don't distinguish "strict", "fast_loose" and "specified" memoing
	as separate eval methods; treat them as just different kinds
	of the same eval method: "memo".

	Remove underscores from the names of some types that the style guide
	says shouldn't be there.

runtime/mercury_tabling_preds.h:
runtime/mercury_tabling_macros.h:
	Modify the approach we use for macros that implement the predicates
	of library/table_builtin.m. Instead of selecting between debug and
	nondebug based on whether MR_TABLE_DEBUG is defined or not, add
	an explicit argument controlling this to each debuggable macro.
	The advantage of the new arrangement is that it scales. Another
	argument controls whether we are computing statistics (and if yes,
	where do we put it), and a third argument controls whether we maintain
	back links in the tries and hash tables (this last argument is present
	but is ignored for now).

	Since the values of the arguments will be known when the .c files
	containing calls to these macros are compiled, we pay the space and
	time cost of debugging, statistics gathering and the maintenance of
	back links if and only we need the revelant functionality.

	Provide macros for limited backward compatibility with the old set
	of macros; these allow workspaces created by old compilers to work
	with the new macros in the runtime. The old macros followed the
	naming scheme MR_table_*, the new ones are named MR_tbl_*.

runtime/mercury_table_int_fix_index_body.h:
runtime/mercury_table_int_start_index_body.h:
runtime/mercury_table_type_body.h:
	New files containing parts of the old mercury_tabling.c. Each of these
	files contains the body of the functions that used to be in
	mercury_tabling.c. The new mercury_tabling.c #includes each of these
	files more than once, to provide more than one variant of the old
	function. These variants differ in aspects such as whether debugging
	is enabled or statistics is being collected. Each variant therefore
	incurs only the time costs it needs to. (We pay the space cost of
	having all these variants all the time of course, but this cost
	is negligible.)

runtime/mercury_tabling_stats_defs.h:
runtime/mercury_tabling_stats_nodefs.h:
runtime/mercury_tabling_stats_undefs.h:
	New files that serve as wrappers around the newly #included files,
	controlling how they handle statistics.

runtime/mercury_tabling.c:
	Delete functions now in the new files, and #include them instead.
	Delete the data structures that used to contain summary statistics;
	the new approach keeps statistics in compiler-generated,
	procedure-specific data structures.

runtime/mercury_trace_base.c:
	Use the new versions of the tabling macros to access the I/O table.

runtime/mercury_type_info.h:
	Update some documentation for the movement of code out of
	mercury_tabling.c.

runtime/mercury_types.h:
	Provide forward declarations of the identifiers denoting the new types
	in mercury_tabling.h.

runtime/mercury_grade.h:
	Increment the exec trace version number, since we have changed
	a part of the exec trace structure.

runtime/mercury_bootstrap.h:
	Fix some temporary issues that arise from some renames above.

runtime/mercury_hash_lookup_or_add_body.h:
	Fix comment.

runtime/Mmakefile:
	Mention the new files and the dependencies that involve them.

library/table_builtin.m:
	Provide a type for representing statistics and a predicate for
	printing statistics.

	Use the updated versions of the macros in
	runtime/mercury_tabling_preds.h.

compiler/prog_item.m:
	Change representation of tabling pragmas to allow room for the new
	attributes.

	Allow an item to be marked as being generated by the compiler
	as a result of a pragma memo attribute. We use this for the reset
	and statistics predicates.

compiler/mercury_to_mercury.m:
	Write out the new attributes of the tabling pragma.

compiler/prog_data.m:
compiler/hlds_data.m:
	Change the cons_id that used to refer to a procedure's call table root
	to refer to the entirety of the new data structure now containing it.
	The compiler now needs a way to refer to the other components of this
	new data structure, since it contains the statistics.

	As in the runtime, don't distinguish "strict", "fast_loose" and
	"specified" memoing as separate eval methods; treat them as just
	different kinds of the same eval method: "memo".

	Rename some of the uses of the function symbols "c", "java", "il".

compiler/hlds_pred.m:
	Add an extra field in proc_infos for storing any tabling attributes.

	Change the existing proc_info field that records information about
	the kinds of arguments of tabled procedures to record the information
	needed by the debugger too. This was needed to allow us to shift all
	the RTTI for procedure-specific tables (as opposed to the RTTI for
	the global I/O table) from mercury_stack_layout.h to mercury_tabling.h
	without duplicating the data (which would be a maintenance problem).

	Reformat some comments to make them easier to read.

compiler/layout.m:
compiler/layout_out.m:
	Delete the part of the exec trace information that used to record
	RTTI for tables, since this information is not generated only as
	part of the debugger data structures anymore.

compiler/prog_io_pragma.m:
	Recognize the updated syntax for tabling pragmas.

compiler/add_pragma.m:
	When processing tabling pragmas for inclusion in the HLDS, create
	any reset and statistics predicates they ask for.

compiler/make_hlds_passes.m:
	Export a predicate now needed by add_pragma.m.

	Handle the new attributes on tabling pragmas

compiler/globals.m:
	Change the function symbols of the types describing backends and
	foreign languages to say what they are. Previously, both types (as well
	as several others) included the function symbol "c"; now, they are
	target_c and lang_c respectively.

compiler/table_gen.m:
	Implement the changes described at the top.

	When passing around varsets and vartypes, pass the arguments in the
	standard order.

compiler/goal_util.m:
compiler/hlds_goal.m:
	When passing around varsets and vartypes, pass the arguments in the
	standard order.

compiler/rtti.m:
	Provide types for representing the runtime's data structures for
	tabling (which are now significantly more complex than a single word)
	and predicates for manipulating them, for use by both the ml and ll
	backends.

compiler/llds.m:
	Replace the comp_gen_c_var type with the tabling_info_struct type,
	which contains the information needed to create the per-procedure
	tabling data structures.

	Replace references to call tables with references to the various
	components of the new tabling data structures.

compiler/llds_out.m:
	Add code to write out tabling_info_structs.

	Delete the code required for the old, hacky way of resetting tables.

	Reorder some code more logically.

compiler/proc_gen.m:
	Generate tabling_info_structs.

compiler/stack_layout.m:
	Don't generate the information now generated in proc_gen.m.

compiler/mlds.m:
	Give mlds_proc_labels their own function symbols, instead of using
	a pair. Rename some other function symbols to avoid ambiguity and add
	expressiveness.

	Provide for the representation of references to the various components
	of the new tabling data structures, and for the representation of their
	types.

compiler/ml_code_gen.m:
	When generating code for a tabled procedure, generate also the data
	structures required for its table.

compiler/rtti_to_mlds.m:
compiler/ml_util.m:
	Move some predicates from rtti_to_mlds.m to ml_util.m, since we
	now also want to call them from ml_code_gen.m.

compiler/name_mangle.m:
	Add some utility predicates.

compiler/options.m:
	Delete the old --allow-table-reset option.

	Add the new --table-debug option.

	Comment out an implementor-only option.

compiler/add_pred.m:
compiler/add_solver.m:
compiler/add_trail_ops.m:
compiler/add_type.m:
compiler/bytecode_gen.m:
compiler/code_gen.m:
compiler/compile_target_code.m:
compiler/complexity.m:
compiler/dependency_graph.m:
compiler/det_report.m:
compiler/export.m:
compiler/fact_table.m:
compiler/foreign.m:
compiler/global_data.m:
compiler/globals.m:
compiler/handle_options.m:
compiler/higher_order.m:
compiler/hlds_code_util.m:
compiler/hlds_data.m:
compiler/hlds_goal.m:
compiler/hlds_out.m:
compiler/inlining.m:
compiler/intermod.m:
compiler/make.dependencies.m:
compiler/make.module_target.m:
compiler/make.program_target.m:
compiler/make.util.m:
compiler/make_hlds_passes.m:
compiler/mercury_compile.m:
compiler/ml_call_gen.m:
compiler/ml_closure_gen.m:
compiler/ml_code_gen.m:
compiler/ml_code_util.m:
compiler/ml_elim_nested.m:
compiler/ml_optimize.m:
compiler/ml_switch_gen.m:
compiler/ml_tailcall.m:
compiler/ml_type_gen.m:
compiler/ml_unify_gen.m:
compiler/mlds_to_c.m:
compiler/mlds_to_gcc.m:
compiler/mlds_to_il.m:
compiler/mlds_to_ilasm.m:
compiler/mlds_to_java.m:
compiler/mlds_to_managed.m:
compiler/modes.m:
compiler/module_qual.m:
compiler/modules.m:
compiler/opt_debug.m:
compiler/opt_util.m:
compiler/polymorphism.m:
compiler/pragma_c_gen.m:
compiler/proc_label.m:
compiler/prog_data.m:
compiler/prog_foreign.m:
compiler/prog_item.m:
compiler/prog_mutable.m:
compiler/prog_out.m:
compiler/prog_rep.m:
compiler/prog_util.m:
compiler/recompilation.version.m:
compiler/size_prof.m:
compiler/special_pred.m:
compiler/switch_util.m:
compiler/transform_llds.m:
compiler/tupling.m:
compiler/type_ctor_info.m:
compiler/unify_gen.m:
	Conform to the changes above, and/or improve some comments.

mdbcomp/prim_data.m:
	Make the names of the function symbols of the proc_label type more
	expressive and less ambiguous.

mdbcomp/prim_data.m:
mdbcomp/mdbcomp.m:
mdbcomp/program_representation.m:
mdbcomp/rtti_access.m:
mdbcomp/slice_and_dice.m:
mdbcomp/trace_counts.m:
	Use . instead of __ as module qualifier.

	Conform to the change to prim_data.m.

browser/declarative_execution.m:
browser/declarative_oracle.m:
browser/declarative_tree.m:
	Conform the change to mdbcomp/prim_data.m.

tests/debugger/Mercury.options:
	Don't specify --allow-table-reset for fib.m, since that option
	doesn't exist anymore.

tests/debugger/fib.m:
	Use the new mechanism for resetting the table.

tests/debugger/print_table.m:
	Use the new syntax for pragma memo attributes.

tests/invalid/specified.{m,err_exp}:
	Use to the new syntax and reset method for pragma memo attributes.
	Test the handling of errors in the new attribute syntax.

tests/tabling/Mercury.options:
	Don't specify --allow-table-reset for specified.m, since that option
	doesn't exist anymore.

tests/tabling/specified.m:
	Use the new syntax for pragma memo attributes, and use the new
	mechanism for resetting tables. We could also use this test case
	for testing the printing of statistics, but the format of that
	output is still not final.

tests/tabling/fast_loose.m:
	Use the new syntax for pragma memo attributes, and use the new
	mechanism for resetting tables.

trace/mercury_trace.c:
trace/mercury_trace_cmd_developer.c:
	Conform to the changes in the RTTI data structures regarding tabling.

	Remove underscores from the names of some types that the style guide
	says shouldn't be there.

library/robdd.m:
	Comment out the tabling pragma until this change is bootstrapped.
	Without this, the conflict between the old calls to macros generated
	by the existing compiler and the new definition of those macros
	in the runtime would cause errors from the C compiler.
2006-06-08 08:20:17 +00:00
Julien Fischer
f387b99b2a Fix a bug that was causing debugger/declarative/browse_arg to fail.
Estimated hours taken: 5
Branches: main, release

Fix a bug that was causing debugger/declarative/browse_arg to fail.  The
problem was that the default format command in the the declarative debugger
was setting format for the browser rather than for the print command.

browser/browser_info.m:
	If a format command with no options is issued at the dd> prompt make
	sure we update the correct set of params.  The existing code was
	written in such a way that it would _always_ update the params for the
	browser regardless of where the format command was invoked.

borwser/declarative_user.m:
	The default format command at the dd> prompt should change the
	settings for the print command, not the browser.

browser/RESERVED_MACRO_NAMES:
	s/polution/pollution/

tests/debugger/declarative/browse_arg.exp:
	Update the expected output for this test case to match the current
	input.
2006-06-06 07:37:37 +00:00
Julien Fischer
49faf8152a Fix a bunch of typos and some formatting.
Estimated hours taken: 0.5
Branches: main

browser/*.m:
	Fix a bunch of typos and some formatting.
2006-06-06 02:27:16 +00:00
Julien Fischer
fc79e1f63c Fix two bugs in the declarative debugger's command handling.
Estimated hours taken: 2
Branches: main, release.

Fix two bugs in the declarative debugger's command handling.  The `params'
command wasn't being parsed and the code to handle the `actions' command
expected it to be called `num_io_actions'.

browser/declarative_user.m:
	Fix the command handler for `actions'.

	Add a command handler for the `params' command.

	Fix a typo: s/supress/suppress/

browser/parse.m:
browser/browser_info.m:
	Fix some formatting.

tests/debugger/declarative/Mmakefile:
tests/debugger/declarative/dd_params.m:
tests/debugger/declarative/dd_params.inp:
tests/debugger/declarative/dd_params.exp:
	Test case for the above.
2006-06-05 07:03:01 +00:00
Julien Fischer
d77a8ff8a3 Fix the interactive query mechanism in the debugger.
Estimated hours taken: 0.2
Branches: main

Fix the interactive query mechanism in the debugger.  It wasn't
working because the generated query programs did not import the
solutions module.

browser/interactive_query.m:
	Import the solutions module in the generated query program.

	Minor formatting fixes.
2006-05-08 07:28:52 +00:00
Julien Fischer
26cf12c729 Fix a problem with the recent debugger changes that broke the 0.13 branch in
Estimated hours taken: 2
Branches: main, release

Fix a problem with the recent debugger changes that broke the 0.13 branch in
nogc grades on jupiter (and would presumably have broken the main branch
tonight).  The problem was that the static global variable
MR_trace_browser_persistent_state_type, defined in mercury_trace_browser.c, is
referred to in the recently added file mercury_trace_cmd_parameter.c.  This
causes a link-time error in the latter.  This only shows up in nogc grades
since in other grades the the references to
MR_trace_browser_persistent_state_type are eliminated by the preprocessor.

Fix some other problems that cause warnings from the C compiler.

trace/mercury_trace_browse.[ch]:
	Export the global MR_trace_browser_persistent_state_type since it is
	now referred to from the module mercury_trace_cmd_parameter.

trace/mercury_trace_cmd_parameter.c:
	#include mercury_trace_browse.h here because this file refers to
	MR_trace_browser_persistent_state_type.

	Call ML_LISTING_listing_type rather than passing its address to
	MR_make_permanent.

	Avoid a C compiler warning on 64-bit architectures about the size of
	int and MR_Integer differing.

trace/mercury_trace_holds_vars.c:
	Avoid C compiler warnings in calls to MR_make_permanent by adding
	casts so that the arguments have the correct type.
	(Again this only shows up in nogc grades since it's all just macros in
	the other grades.)

browser/listing.m:
	Export ML_LISTING_listing_type as a function rather than as a predicate
	since that is how it was being used in the trace directory.
2006-04-06 06:14:40 +00:00
Zoltan Somogyi
dd44e0ef62 Replace the "set" command of mdb with a bunch of commands: the `format',
Estimated hours taken: 16
Branches: main, release

Replace the "set" command of mdb with a bunch of commands: the `format',
`format_param', `list_context_lines', `list_path', `xml_browser_cmd',
`xml_tmp_filename', `fail_trace_counts', `pass_trace_counts' and
`max_io_actions' commands. Each of these set just one parameter
or one of set of closely related parameters.

Move all these commands, and some existing commands that set parameters
that were elsewhere, to the "parameter" command category.

Extend some of these commands so that if given no arguments, they report
the current values of the parameters they would otherwise set.

Replace the "set" commands of the mdb browser and of the declarative debugger
with a bunch of commands: "format", "depth", "size", "width", "lines",
"actions" and "params" (the last prints the current value of the parameters).

For each category of mdb commands, create files mercury_trace_cmd_<cat>.[ch],
and move the functions dealing with that category of commands there from
mercury_trace_internal.c. Give each of these new files a logical structure
that was sometimes missing from the relevant parts of mercury_trace_internal.c.

NEWS:
	Mention these changes.

doc/mdb_categories:
	Document these changes.

doc/user_guide.texi:
	Document these changes.

	Fix an old documentation bug: you couldn't set listing paramaters
	from a declarative debugger command.

	Fix an old documentation bug: the description of the goal_path step
	for scopes was obsolete.

	Fix some obsolete references to : as module qualifier.

browser/parse.m:
	Update the browser command set along the lines at the top.

browser/declarative_user.m:
	Update the declarative debugger command set along the lines at the top.

	Move the declaration for the type representing declarative debugger
	commands to near the top of the file.

browser/browser_info.m:
	Provide some access predicates.

	Update the predicate that generates mdb commands to save the persistent
	state of the debugger to generate the new forms of parameter commands.

	Move types and predicates for dealing with browser parameters from
	browse.m to here, so that declarative_user.m can use them too.

browser/browse.m:
	Delete the code moved to browser_info.m, and conform to the other
	changes in the other modules.

browser/listing.m:
	Provide a predicate to return the type of listing paths.

scripts/mdbrc.in:
	Update the commands that set the XML parameters.

scripts/Mmakefile:
	Get mmake to rebuild mdbrc from mdbrc.in when mdbrc.in changes.

trace/mercury_trace_internal.c:
trace/mercury_trace_cmds.h:
trace/mercury_trace_cmd_*.[ch]:
	Implement the changes described at the top.

	Fix an old bug: the commands that update the search path for the "list"
	command don't make the search path term permanent, which is needed in
	non-conservative-gc grades.

trace/mercury_trace_spy.c:
	Fix some obsolete references to : as module qualifier.

trace/mercury_trace_browse.[ch]:
	Delete the functionality now moved to mercury_trace_cmd_parameter.c.

tests/debugger/mdb_command_test.inp:
	Update the set of commands being tested.

tests/debugger/save.{inp,exp}:
	Update the parameter commands in this test case.
2006-04-04 07:37:31 +00:00
Zoltan Somogyi
9bafd6369b Update references to stuff that used to be in std_util.
Estimated hours taken: 0.1
Branches: main, release

browser/declarative_tree.m:
	Update references to stuff that used to be in std_util.
2006-04-03 02:01:42 +00:00
Zoltan Somogyi
892bf00ce2 XXX: the change to the mdb "set" command is not yet documented; that will be
Estimated hours taken: 3
Branches: main

XXX: the change to the mdb "set" command is not yet documented; that will be
addressed in the next change.

Fix the debugger's save command so that it saves everything it should save
(with one unavoidable exception). Rename the "save_to_file" command to "dump",
as we agreed.

NEWS:
doc/user_guide.texi:
doc/mdb_categories:
	Document these facts.

browser/browser_info.m:
	Provide a predicate to save the entire persistent state of the browser.

	Provide a predicate to set the number of I/O actions printed by the
	declarative debugger.

	Check that the XML browser command and temp file name being set aren't
	empty, since those are not meaningful.

	Rename predicates to avoid ambiguities and excessively long names.
	Simplify some code.

browser/browse.m:
	Generate better error messages if the user tries to use XML browsing
	without setting it up.

browser/browse.m:
browser/declarative_user.m:
	Conform to the changes in browser_info.m

browser/listing.m:
	Use the correct prefix on global C symbols.

trace/mercury_trace_internal.c:
	Change the save command to save everything of the persistent debugger
	state that can be saved.

	Allow the set command to set the number of I/O actions printed by the
	declarative debugger. Without this, there would be no way to restore
	this part of the debugger persistent state, since a source command
	cannot start the declarative debugger.

	Rename save_to_file as dump.

	Use the correct prefix on global C symbols.

	Avoid misleading capitalization.

trace/mercury_trace_spy.c:
	Extend the code that saves the state of breakpoints to save conditions
	on breakpoints as well.

trace/mercury_trace_browser.[ch]:
	Add a utility function for saving the persistent browser state.

	Conform to the changes in browser/browser_info.m.

trace/mercury_trace_alias.[ch]
	Convert to four-space indentation.

tests/debugger/browser_test.{inp,exp}:
tests/debugger/mdb_command_test.inp:
	Use dump instead of save_to_file.

tests/debugger/save.{m,inp,exp}:
	New test case to test the new behavior of the save command.

tests/debugger/Mmakefile:
	Enable the new test case.
2006-03-31 05:12:19 +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
99c3220a43 Fix typo.
Estimated hours taken: 0.1
Branches: main

browser/tree234_cc.m:
	Fix typo.
2006-03-22 04:45:25 +00:00
Zoltan Somogyi
ef55b420fd Remove from std_util.m the predicates that merely call predicates in
Estimated hours taken: 12
Branches: main

Remove from std_util.m the predicates that merely call predicates in
the type_desc, construct and deconstruct modules, to reduce clutter
in std_util.m.

library/std_util.m:
	Remove those predicates from std_util.m.

library/deconstruct.m:
	Add a type we need that was previously defined in std_util.m.

library/construct.m:
	Delete some module qualifications that have now become unnecessary,

browser/browse.m:
browser/browser_info.m:
browser/declarative_tree.m:
browser/dl.m:
browser/help.m:
browser/sized_pretty.m:
browser/term_rep.m:
compiler/bytecode_gen.m:
compiler/llds_out.m:
compiler/mlds_to_il.m:
compiler/mlds_to_managed.m:
library/assoc_list.m:
library/hash_table.m:
library/io.m:
library/pprint.m:
library/private_builtin.m:
library/prolog.m:
library/require.m:
library/rtti_implementation.m:
library/store.m:
library/term.m:
library/term_to_xml.m:
library/version_hash_table.m:
mdbcomp/program_representation.m:
	Import type_desc.m, construct.m and/or deconstruct.m to provide
	definitions of functions or predicates that up till now were in
	std_util.m. Modify the calls if the called function or predicate
	had a slightly different interface in std_util.m.

	Also, convert term_to_xml.m to four-space indentation, and delete
	unnecessary module qualifications in term.m.

tests/debugger/polymorphic_output.{m,inp,exp,exp2}:
tests/hard_coded/copy_pred_2.m:
tests/hard_coded/deconstruct_arg.exp:
tests/hard_coded/deconstruct_arg.exp2:
tests/hard_coded/deconstruct_arg.m:
tests/hard_coded/elim_special_pred.m:
tests/hard_coded/existential_bound_tvar.m:
tests/hard_coded/expand.m:
tests/hard_coded/foreign_type2.m:
tests/hard_coded/higher_order_type_manip.m:
tests/hard_coded/nullary_ho_func.m:
tests/hard_coded/tuple_test.m:
tests/hard_coded/type_ctor_desc.m:
tests/hard_coded/type_qual.m:
tests/hard_coded/write_xml.m:
tests/hard_coded/sub-modules/class.m:
tests/hard_coded/sub-modules/nested.m:
tests/hard_coded/sub-modules/nested2.m:
tests/hard_coded/sub-modules/nested3.m:
tests/hard_coded/sub-modules/parent.m:
tests/hard_coded/sub-modules/parent2.child.m:
tests/hard_coded/typeclasses/existential_rtti.m:
tests/recompilation/type_qual_re.m.1:
cvs update: Updating tests/submodules
cvs update: Updating tests/tabling
cvs update: Updating tests/term
cvs update: Updating tests/tools
cvs update: Updating tests/trailing
cvs update: Updating tests/typeclasses
cvs update: Updating tests/valid
tests/valid/agc_unbound_typevars.m:
tests/valid/agc_unbound_typevars2.m:
tests/valid/agc_unused_in.m:
	Replace references to the deleted predicates in std_util with
	references to the equivalent predicates in type_desc, construct
	and/or deconstruct. In test cases that already tested both the
	functionality in std_util and in the other modules, simply delete
	the part exercising std_util.
2006-03-22 02:56:44 +00:00
Zoltan Somogyi
7822554732 Replace __ with . as the module qualifier everywhere in all the modules
Estimated hours taken: 2
Branches: main

browser/*.m:
	Replace __ with . as the module qualifier everywhere in all the modules
	of the browser directory. Convert the currently tab-indented modules
	to four-space indentation. Delete some unnecessary module
	qualifications. Change some type names and function symbols to avoid
	ambiguities. Replace a bunch of uses of DCGs with state variable
	notation.
2006-03-10 06:31:06 +00:00
Ian MacLarty
11042e060c Allow field names to be used in the paths used with subterm dependency
Estimated hours taken: 5
Branches: main

Allow field names to be used in the paths used with subterm dependency
tracking.

Allow the user to cd to the return value of a function by giving the
number of arguments plus one as an argument to the `cd' command.

browser/browse.m:
	Export the predicate that removed ".." from paths.
	Make the return value of this predicate a subtype, so we can be
	sure the simplification has been applied to the path.

	Allow the user to do `cd N', where N is the number of arguments of
	a function plus one.  This will cd to the return value of the function.

	Add some more aliases for the directory name of the return value of a
	function.

browser/browser_info.m:
	Use the new simplified_dirs inst.
	When converting a list of directories to a term path, look at the
	value the path applies to to resolve field names in the path.

browser/declarative_user.m:
	Report an error if the user tries to track an I/O action.
	Call the new version of convert_dirs_to_term_path which handles
	field names in the path.

browser/term_rep.m:
	Add predicates to lookup a subterm in a term representation and
	also to look up a named field in a term representation.

tests/debugger/declarative/Mercury.options:
tests/debugger/declarative/Mmakefile:
tests/debugger/declarative/named_fields.exp:
tests/debugger/declarative/named_fields.inp:
tests/debugger/declarative/named_fields.m:
	Test tracking of subterms using a path with a field name.

tests/debugger/polymorphic_output.exp*
	The output of this test has changed, because cd's to the return value
	of a function, using a number, are now allowed.
2006-02-08 21:48:36 +00:00
Peter Wang
0290b5a4bf This fixes some problems with building everything with `mmake --use-mmc-make'
Estimated hours taken: 3
Branches: main

This fixes some problems with building everything with `mmake --use-mmc-make'
on x86, or possibly any platform where shared libraries are supported.

Mmake.workspace:
	Add "--mercury-linkage static" or "--mercury-linkage shared" to
	`MCFLAGS' depending on whether the `LINK_STATIC' makefile variable is
	yes or no.

analysis/ANALYSIS_FLAGS.in:
	Add -L<dir> options so that the analysis library can find the boehm_gc,
	runtime and standard library files when built in shared linking mode.

browser/Mercury.options:
	Work around a problem with per-file variables and `mmake
	--use-mmc-make'.

compiler/COMP_FLAGS.in:
profiler/PROF_FLAGS.in:
slice/SLICE_FLAGS.in:
	Remove "--linkage shared" from these files.  The Mmakefiles in these
	directories have "LINK_STATIC=yes" set.  This was causing a link error
	where the object files where being built with PIC but expected to
	link against lib*.a files.
2006-01-12 07:07:31 +00:00