Fix typos in Paul's recent change.

java/runtime/MercuryRuntime.java:
java/runtime/MercuryThreadPool.java:
samples/java_interface/standalone_java/JavaMain.java
	As above.
Step 3 of moving trace_*_io_state out of private_builtin.m.

At the moment private_builtin.m imports the io module. This is undesirable,
since private_builtin should not depend on any other module. The import
is needed only for trace_{get,set}_io_state, predicates that are used
in the implementation of trace [io(!IO)] scopes to create and destroy
dummy I/O states.

The obvious thing to do to remove this undesirable dependency is to move
those predicates to another module, and the io module is the obvious choice.
Since these two predicate can also be used to implement Mercury's version
of Haskell's unsafe_perform_io, give the moved versions names that reflect
this, unsafe_{get,set}_io_state.

However, since private_builtin.trace_{get,set}_io_state are builtins,
moving them requires several steps.

The first step is making io.unsafe{get,set}_io_state builtins, with definitions
identical to private_builtin.trace_{get,set}_io_state.

The second step, once the first step has been installed on all developers'
machines, is to add declarations for io.unsafe{get,set}_io_state to io.m
(but not definitions, since these should not be there for builtins), and
to get the compiler to generate references to these instead of to
private_builtin.trace_{get,set}_io_state.

The third step, once the second step has been similarly installed, will be
to remove the declarations of private_builtin.trace_{get,set}_io_state,
and to remove the undesirable import.

library/private_builtin.m:
    Remove the declarations of private_builtin.trace_{get,set}_io_state,
    and the import of io.m.

compiler/md4.m:
    libs.md4.c used to #include mercury_string.h very indirectly, through
    private_builtin.m, which imported io.m, which imported string.m, and
    which #included mercury_string.h. Now that the second step has been
    broken, we have to #include mercury_string.h directly.
Add date_time/0 as a synonym for date/0.

library/calendar.m:
	As above.
Factor out common code in code generation for switches.

compiler/switch_util.m:
    Move here some code that was common to switch_gen.m and ml_switch_gen.m.

compiler/switch_gen.m:
compiler/ml_switch_gen.m:
    Remove the code moved to switch_util.m.

    In switch_gen.m, remove a long unused predicate.

compiler/code_info.m:
    Simplify the interface of the init predicate for code_infos.

compiler/proc_gen.m:
    Conform to the change in code_info.m.
Use require_switch_arms_det in the motivating code.

compiler/parse_string_format.m:
library/string.parse_runtime.m:
    Use a single require_switch_arms_det scope instead of wrapping each arm
    in a require_det scope.
Fix spelling in the deep profiler.

Fix some other issues as well that I found while fixing the spelling.

mdbcomp/feedback.automatic_parallelism.m:
deep_profiler/autopar_find_best_par.m:
deep_profiler/mdprof_create_feedback.m:
    Rename the best_par_algorithm type to alg_for_finding_best_par,
    since the old name was misleading. Perform the same rename for
    another type based on it, and the option specifying it.

    Remove the functor estimate_speedup_by_num_vars, since it hasn't
    been used by anything in a long time, and won't in the future.

deep_profiler/autopar_calc_overlap.m:
deep_profiler/autopar_costs.m:
deep_profiler/autopar_reports.m:
deep_profiler/autopar_search_callgraph.m:
deep_profiler/autopar_search_goals.m:
deep_profiler/coverage.m:
deep_profiler/create_report.m:
deep_profiler/dump.m:
deep_profiler/mdprof_report_feedback.m:
deep_profiler/measurement_units.m:
deep_profiler/measurements.m:
deep_profiler/message.m:
deep_profiler/query.m:
deep_profiler/recursion_patterns.m:
deep_profiler/report.m:
deep_profiler/startup.m:
deep_profiler/var_use_analysis.m:
mdbcomp/mdbcomp.goal_path.m:
mdbcomp/program_representation.m:
    Conform to the above. Fix spelling errors. In some places, improve
    comments and/or variable names.
Prevent overflow when computing Mid in binary searches.

library/array.m:
library/bt_array.m:
    As above.
Print formatted dates and durations with io.print.

Change the io.print family of predicates to print out the formatted version of
dates and durations rather than their underlying representation.

library/io.m:
library/stream.string_writer.m:
	As above.

	Avoid a change of tense in the middle of the descriptive comment
	for {io,stream.string_writer}.print.

tests/hard_coded/Mmakefile:
tests/hard_coded/print_date.{m,exp}:
	Add a test for the above.
Fix a bug in io.print_line/{4, 5}.

library/io.m:
    In the above predicates the trailing newline should be written to the
    specified stream, not the standard output.
Overflow in string-to-float conversions.

The behaviour of string.to_float/2 is not currently consistent between backends
when the conversion overflows.  The C and Java backends return infinity or
-infinity, while the C# backend fails.  Fix this by specifying that
string.to_float/2 should return infinity or -infinity on the conversion
overflowing and modify the C# implementation to do this.

library/string.m:
	Specify what happens when string.to_float/2 overflows.

	Address the XXX in the C# implementation of string.to_float/2:
	we need to catch System.OverflowException.  If we do catch
	it then return +/- infinity as appropriate.

	Fix a typo: s/Formating/Formatting/

tests/hard_coded/Mmakefile:
tests/hard_coded/string_to_float_overflow.{m,exp}:
	Add a test for string-to-float conversion overflow.
Fix a bug with io.write_float/4.

In the Java grade io.write_float/4 was incorrectly printing infinity as
"Infinity" and -infinity as "-Infinity".  (io.write_float/3 implemented
the correct behaviour.)

The recently added string_to_float_overflow test case also acts as
a test case for this.

library/io.m:
    Make io.write_float/4 print infinities correctly.
Address review comments from Paul.

library/string.m:
    As above.