This fixes mantis bug 402.
compiler/prog_item.m:
Change the representation of require_complete_switch and
require_switch_arms_{det,semi,...} goals so that the switch variable
does not have to be a plain variable, but can also be the current value
of a state variable. (You can't switch on the future value.)
compiler/prog_io_goal.m:
When parsing the switched-on variable in these kinds of scopes,
allow the variable in the singleton list to be !.SV as well as a plain
variable.
compiler/goal_expr_to_goal.m:
Expand out the !.SV in these scopes if the switched-on variable
is of that form.
compiler/prog_io_util.m:
Change the return value of the predicate that parses both plain and
state vars to make the meaning of its return value more self-describing.
compiler/parse_tree_out_clause.m:
compiler/prog_util.m:
Conform to the change in prog_item.m.
tests/valid/bug402.m:
New regression test for the bug.
tests/valid/Mmakefile:
Enable the new test.