Speed up string.format for integers.

library/string.format.m:
    We used to convert Mercury ints to strings by doing arithmetic on
    (arbitrary precision) integers. This diff changes things so we now
    compute only one one digit this way; the rest we compute using
    arithmetic on ints, not integers. In most cases, we should be able
    to avoid doing arithmetic on arbitrary-precision integers at all,
    but that is a more involved change.
Simplify the code paths for formatting integers.

library/string.format.m:
    Instead of deriving the settings of some parameters from the kind
    of unsigned integer conversion requested and then using those parameters,
    use the kind of requested conversion directly. It turned out that some
    of those parameters were being used only in some cases, but of course
    they were being set in all cases.

    Do not test for the same condition twice in a row. If you decide you
    need to reserve room for a prefix, why test again (using the same
    condition) whether you need to add the prefix?

    Avoid using arbitrary precision arithmetic if fixed arithmetic will do
    on all platforms that are at least 16 bit.

    Give some predicates better names.
Factor out commonalities in formatting floats.

library/string.format.m:
    As above.
Add two new options for querying the compiler.

Add two new options for querying the compiler.  The first new option,
--output-target-arch, prints the target architecture.  This is useful in
situations where you are working directly with the contents of the Mercury
subdirectory and --use-grade-subdirs is enabled.  (The directory names
generated by --use-grade-subdirs include the target architecture.) The second
new option, --output-class-dir, deals with a more specific instance of the
above.  It prints out the name of the directory in which the Mercury compiler
places generated Java class files.

Replace the use of 'fullarch' by 'target_arch' throughout the compiler.
(We still currently support '--fullarch' as a synonym for '--target-arch'
but that too will eventually be dropped.)

compiler/options.m:
	Add the new options.

compiler/mercury_compile.m:
	Implement the new options.

	s/fullarch/target_arch/

	Add an XXX comment about an inaccurate error message.

compiler/handle_options.m:
compiler/compile_target_code.m:
compiler/file_names.m:
compiler/make.program_target.m:
	Conform to the above changes.

doc/user_guide.texi:
	Document the new options.
Fix a typo in my last change.

doc/user_guide.texi:
	Fix a typo.
Address review comments.

compiler/options.m:
doc/user_guide.texi:
	Address review comments from Zoltan.
Add require_switch_arms_{det,semidet,...} to the language.

The new construct looks like this:

    require_switch_arms_det [C] (
        (
            C = 'a',
            ... compute Out ...
        ;
            C = 'b',
            ... compute Out ...
        )
    )

If any of the goals computing Out are not det, the compiler will generate
an error message. The det at the end of the keyword can be replaced
by any of the other seven determinisms, though I don't think either
require_switch_arms_failure or require_switch_arms_erroneous will see much use.

This diff adds only the implementation. I will add the documentation
and the NEWS item after we all had a chance to install this diff and
try it out.

compiler/hlds_goal.m:
    Add a scope representing this kind of goal in the HLDS.

compiler/prog_item.m:
    Add a goal expression for this kind of goal in the parse tree.

compiler/prog_io_goal.m:
    Look for the new kind of goal expression in terms when creating
    the parse tree.

    Factor out some commonalities between the parsing of the new goal
    expression and existing types of goal expressions.

compiler/goal_expr_to_goal.m:
    Convert the new kind of goal expression to the new scope in the HLDS.

compiler/det_report.m:
    Implement the checks that the new goal type calls for.

    Factor out some commonalities between the implementation of the new goal
    type and existing goal types.

    Move the types and predicates dealing with comparisons of determinisms
    from here to prog_data.m, due to the sort-of-bugfix to modecheck_call.m.

compiler/prog_data.m:
    Move the types and predicates dealing with comparisons of determinisms
    from det_report.m to here. The old code for this was intended for only one
    requirement, and did not deal well with comparisons of two determinisms
    in which each determinism makes an assertion the other does not make.
    Create a way to represent such comparison results.

compiler/modecheck_call.m:
    When deciding which mode of a procedure to call, we prefer determinisms
    that make more assertions about solution counts. However, when comparing
    incomparable determinisms (such as semidet vs multi, each of which makes
    an assertion the other doesn't), the algorithm chose based solely
    on the ORDER of the modes. We now explicitly prefer modes that promise
    lower maximum solution counts, giving less importance to cannot_fail
    assertions.

compiler/*.m:
    Conform to the change to hlds_goal.m or prog_item.m.

library/ops.m:
    Add the new keywords as operators.

tests/hard_coded/require_scopes.{m,exp}:
    Extend this test case to test the new construct in the absence of errors.

tests/invalid/require_scopes.{m,exp}:
    Extend this test case to test the new construct in the presence of errors.
Fix some overlong lines.
Speed up updating mode_infos.

compiler/mode_info.m:
    If the new value of a field of mode_info is likely to be bit-identical
    to the old value, then test the old and new bits for equality in the
    setter, and if they are the same, do not allocate a new mode_info structure
    that is guaranteed to be the same as the old one.

    By avoiding unnecessary memory turnover, this speeds up the compiler
    by about 4%, as measured by tools/speedtest -l.
Generate better error messages for string.format.

library/string.format.m:
    We used to parse format strings, and pair up format specifiers with
    the list of input poly_types, using semidet code, throwing
    exceptions with generic messages if the semidet code failed.
    This diff switches to using det code that returns a list of
    situation-specific error messages. Since errors after the first
    may be caused by the first error, we now throw exceptions whose
    message is a detailed description of the first error, but that
    decision is easily changeable.

    Simplify some existing code.

tests/general/string_format_test_{2,3}.{exp,exp2,exp3,...}:
tests/invalid/string_format_bad.err_exp:
tests/invalid/string_format_unknown.err_exp:
    Update the expected error messages.