Document experience on AIX.

README.AIX:
	As above.
Fix whatespace

java/runtime/JavaInternal.java:
    Use tabs/spaces consistently (four spaces)

    Remove trailing whitespace

library/exception.m?
    Remove trailing whitespace
Fix a typo in the configure script.

configure.ac:
	Add a missing '=' character in a variable assignment.
Merge branch 'version-14_01-branch'
Fix standard library compilation in erlang grade.

library/thread.m:
	Workaround a problem that was preventing this module from compiling
	successfully in the erlang grade.
Simplify workaround for Erlang backend.

The bug avoided by the preceding commit is that the Erlang backend can
produce code for cc_multi_equal(!IO) which refers to a non-existent
dummy IO variable.

library/thread.m:
	Replace `cc_multi_equal' by a disjunction to convince the
	compiler that `spawn_context_2' is non-deterministic.

	Delete the Erlang foreign proc.
Add support for weak pointers to the C RTS

A weak pointer (aka weak reference) is a pointer to some garbage collector
(GC) allocated object or memory that is not considered by the GC when
deciding if the object is garbage or not.  Additionally, if the object is
reclaimed by the GC the GC will zero-out this pointer so that other code can
test if this object is still available.  Weak pointer can be useful when
implementing caches or cyclic data structures (my motivation for this
change).

This change introduces a weak pointer type (a typedef) in Mercury's runtime
system for the C backends.  Two macros are provided to create and deference
these weak pointers.  Extra documentation, and constraints on how these can
be used are described in mercury_memory.h.

runtime/mercury_memory.c:
runtime/mercury_memory.h:
    As above.

tests/general/weak_ptr.m:
tests/general/Mmakefile:
    Add a test for the C RTS's weak pointer support

tests/general/weak_ptr.exp:
    Expected output for the test.  This isn't the real program's output.
    weak_ptr's output is too volatile to use reliably (see weak_ptr.m).
Use C's 'const' keyword correctly in version_array.m

library/version_array.m:
    Use pointers to constant structures rather than constant pointers to
    structures.
Make version_array's rewind code use constant stack space.

Although rewinding version arrays should be rare it is better if this code
uses constant stack space to avoid crashes.  Currently the list of updates
made in a version array is kept in a singly linked list.  This list needs to
be walked backwards to unwind updates, such as when updating an old version
of an array (to fork into two separate arrays).  The stack is used to
perform this backwards work and can overflow for long histories.

This patch makes these lists doubly-linked so that they can be traversed in
either direction.  The back pointers are implemented using weak pointers in
all backends.  This avoids unnecessary memory retention when a programmer
only maintains a reference to the lastest version of the array, which is the
common case.

library/version_array.m:
    As above; I developed this algorithm in the C implementation first and
    then replicated the changes in the Java and C# implementations.

tests/hard_coded/version_array_test.m:
tests/hard_coded/version_array_test.exp:
    Extend the test case to exercise implicitly unwinding a version array by
    updating an old version of an array.  Note that the implicit and
    explicit unwind codepaths are different as they are out-of-place and
    in-place respectively.
Merge branch 'version-14_01-branch'
Add missing MR_GC_malloc_atomic procedure

In the runtime system we create wrappers for a number of procedures from the
Boehm GC, this helps provide portability incase we change garbage
collectors or compile without garbage collection support.

This patch adds the useful MR_GC_malloc_atomic procedure to this set of
procedures.

runtime/mercury_memory.c:
runtime/mercury_memory.h:
    As above.
Escape backslashes in foreign code.

library/version_array.m:
    Escape backslashes in foreign code so that gcc and gdb give us
    meaningful line numbers.
Minor cleanups before work on bug 311.

compiler/delay_partial_inst.m:
    Avoid unnecessarily splitting a predicate in two.

    Eliminate a number of unnecessary accesses and updates to the module
    info.

    Return the list of changed pred ids in order.

    Add conditional trace goals to write out procedure bodies
    if this pass changes them.
Add the fused multiply-add operation to the math module.

Support the fused multiply-add operation in C grades, where the underlying math
library provides it.  Add a predicate that allows program to test for the
presence of this operation.
(The non-C target languages do not currently provide this operation.)

library/math.m:
	Add the function fma/3.

	Add the predicate have_fma/0 which can be used to test for the
	presence of fma operation in the current grade / platform.

configure.ac:
runtime/mercury_conf.h.in:
	Check whether the C99 fma() function is available.

NEWS:
	Announce the above.
Replace simplify.m (which had 4500 lines) with several submodules.

The objective of this change is to improve module cohesion, with each
of the new modules doing only one task, or two or three closely related tasks.
Moving common.m into the new simplify package also improves information hiding,
since the details of the simplify_info data structure that common.m needs
aren't exposed to the rest of the compiler anymore.

This change mostly moves code around. There are no algorithmic changes.
In several places I did

- make predicate names more meaningful,
- reordered predicate definitions to put related predicates together
  (previously, the predicates involved in simplifying a particular kind of goal
  were often interspersed with predicates that worked only on other kinds of
  goals), and
- improved documentation (in some places expanding it, in some places
  correcting comments that suffered bit-rot and were out-of-date).

compiler/simplify.m:
    This file is now a package, including its submodules,
    but no code anymore.

compiler/simplify_goal.m:
    New submodule containing generic processing of goals.

compiler/simplify_goal_call.m:
compiler/simplify_goal_unify.m:
compiler/simplify_goal_conj.m:
compiler/simplify_goal_disj.m:
compiler/simplify_goal_switch.m:
compiler/simplify_goal_ite.m:
compiler/simplify_goal_scope.m:
    New submodules containing goal-type-specific processing of goals.
    Each of these modules is much more cohesive than the original simplify.m
    ever was; most export only one predicate per handled goal type.

compiler/simplify_info.m:
    New submodule containing the definition of simplify_info
    and its access predicates.

compiler/simplify_tasks.m:
    New submodule listing the tasks that the simplification pass
    may be asked to perform.

compiler/simplify_proc.m:
    New submodule containing the top-level processing of procedures.

compiler/common.m:
    Make this module a part of the simplify package. It is only ever invoked
    by simplification, and leaving it outside the package would require
    exporting more than a few internal details of simplify_info.

compiler/format_call.m:
    Make this module a part of the simplify package. It does its job during
    simplification, even though the need for it is noted during determinism
    analysis.

compiler/check_hlds.m:
    Remove common.m and format_call.m from the list of direct submodules
    of check_hlds.m. (They are now indirect submodules, through
    check_hlds.simplify.)

compiler/notes/compiler_design.html:
    Document the new modules, and the new status of common and format_call..

compiler/pd_util.m:
    Move some code from here to the new simplify_proc.m, since it allows us
    to avoid exposing internal details of how simplification works.

compiler/mercury_compile_front_end.m:
    Move a predicate here from the old simplify.m, since the job it does
    belongs here.

    Remove the ability to disable the invocation of cse_detection.
    This capability was only ever needed when measuring the effectiveness
    of determinism analysis for a paper; it hasn't been needed in a decade.

compiler/cse_detection.m:
    Improve the top level comment.

compiler/options.m:
doc/user_guide.texi:
    Remove the option that used to control the invocation of cse_detection.

compiler/*.m:
    Conform to the split of simplify.m, importing its submodules where needed.
Add thread_safe attribute to store procedures.

The mutvar procedures are not truly thread-safe but neither does
obtaining a global lock make them become thread-safe in a useful way,
except perhaps avoiding data races.  On the other hand, the global lock
inhibits parallelism in programs that do use mutvars in a thread-safe
manner.

library/store.m:
	As above.

NEWS:
	Announce change.
Use mutvar in benchmarking.

library/benchmarking.m:
	Use store mutvar type in `benchmark_nondet_loop'.

	Delete redundant implementation of a reference type.
Add thread_safe and not_thread_safe attributes.

library/benchmarking.m:
library/bit_buffer.m:
library/exception.m:
library/gc.m:
library/io.m:
library/library.m:
library/thread.m:
library/time.m:
	Add `thread_safe' or `not_thread_safe' to foreign procs
	where it is clear which is correct.
Delete unused type io.stream_putback.

library/io.m:
	As above.
Fix type of MR_compare_tuple_pred for high-level C grades.

runtime/mercury_ho_call.h:
	Fix the type of MR_compare_tuple_pred function pointer
	for high-level C grades.