Allow repeated type variables in type class instance heads.

The Mercury compiler has long required that all of the type variables referred
to in type class instance head be distinct.  There is no particularly good
reason for this restriction -- the implication that it helps to ensure that
there are no overlapping instances in the reference manual is misleading, since
the way that we do that (at least in the C grades), by using the names of the
base_typeclass_infos, is not affected by type variables.

The major implementation detail needed to support repeated type variables in
instance declarations is that when doing context reduction, we must do full
matching of instances against constraints (i.e. we need to keep track of the
type variable bindings).  Since we already do this, the only change required to
support repeated type variables is to remove the error checking that prevents
it.

compiler/check_typeclass.m:
	Do not require that type variables in instance heads be distinct.

doc/reference_manual.texi:
	Document that repeated type variables are now allowed in instance
	heads.

NEWS:
	Announce the change.

tests/invalid/instance_dup_var.m:
	Shift this test into the valid directory.

tests/invalid/repeated_instance_vars_unsat.{m,err_exp}:
     Check that we get an error if a repeated type variable is bound
     to different types.

tests/valid/Mmakefile:
tests/invalid/Mmakefile:
	Conform to the above changes.

tests/invalid/invalid_instance_declarations.err_exp:
tests/invalid/invalid_instance_declarations.m:
	Remove instances that are now valid.
Fix the failure of tests/invalid/instance_var_bug.

tests/invalid/instance_var_bug.err_exp;
	Conform to recent changes.
Fix bug #293: GCC 4.8 and the asm_fast grades.

configure.ac:
     Pass -fno-tree-dominator-opts to GCC 4.8 on x86-64 and x86; gcc labels
     are not working correctly in the presence of that optimisation.

NEWS:
     Announce the above.
Add all_{true,false}/2 and is_empty/1 to array and version_array.

library/array.m:
library/version_array.m:
	Add the above predicates.

NEWS:
	Announce the new predicates.

tests/hard_coded/Mmakefile:
tests/hard_coded/array_all_tf.{m,exp}:
	Test the new predicates.

tests/hard_coded/version_array_test.{m,exp}:
	Extend this test case to cover the new predicates.
Fix overlong lines in the usage message.

compiler/options.m:
	As above.

library/type_desc.m:
	Delete a stray '%' in a comment.
Branches: master, 13.05.

Make the calculator example handle CRLF line endings.

samples/calculator.m;
	As above.
Fix non-compiling code in extras.

extras/monte/rnd.m:
	s/index0_det/det_index0/
Automatically decide the value of --install-command (part 1).

Allow the possibility of the compiler automatically deciding what command(s) to
use to install files and directories instead of using the value of
--install-command (which defaults to "cp").  The eventual intention (NYI) is
that in the absence of a value for --install-command, the compiler will choose
an appropriate command based on the setting of --host-env-type (and possibly
some other stuff, for the example the OS version).

The rationale for all this to try to improve the current situation on Windows
(in the absence of Cygwin or MSYS) where file copying is a bit of a mess.  It
should also mean that the same Mercury installation can be more easily used
from both MSYS and cmd.exe.

NOTE: for the moment --install-command is still specified in Mercury.config.
This will be removed in a later change and the compiler will default to
choosing automatically.

compiler/globals.m:
	Add a type whose values describe how we should install files and
	directories.

	Add a field of that type, file_install_cmd, to the globals structure.

	Add access predicates.

compiler/handle_options.m:
	Set the new field in the globals.

compiler/file_util.m:
	Provide functions for constructing a command line for installing files
	and directories based on the value of the file_install_cmd field in
	the globals.

compiler/make.program_target.m:
compiler/module_cmds.m:
	Use the new functions in file_util.m.
Fix a problem with the erlang grade on Windows.

m4/mercury.m4:
	Only keep the basename of ERLC and ERL if their initial values
	are qualified with directories whose names contains spaces.  This
	avoids build problems on Windows.  (We do the same thing for the
	Java tools.)
Merge branch 'version-13_05-branch'
Add map.det_{min,max}_key/1.

library/map.m:
    As above.

NEWS:
    Announce the new functions.
Fix a NEWS entry.

NEWS:
   As above.