[m-rev.] for review: fix documentation of `--no-fully-strict'
Julien Fischer
juliensf at csse.unimelb.edu.au
Tue Nov 6 17:08:22 AEDT 2007
For review by anyone (preferably by Ian if he is around.)
Estimated hours taken: 0.5
Branches: main
Address bug #18: the documentation of the option `--no-fully-strict'
no longer matched what the implementation was doing.
Fix a incorrect warning message.
compiler/options.m:
doc/reference_manual.texi:
doc/user_guide.texi:
Revert the incorrect part of Ian's previous change to the
documentation of `--no-fully-strict'.
Rather than, awkwardly, referring to "calls to error/1 or throw/1",
just refer to "goals with determinism erroneous", which is more
general and closer to what the implementation actually does.
compiler/simplify.m:
Fix an incorrect verbose warning: compiling with `--fully-strict'
is *not* sufficient to prevent the compiler replacing goals that
always fail with false. The compiler may still perform such
replacements even if `--fully-strict' is enabled, so long as the goal
can be proven to terminate and is not erroneous.
Julien.
Index: compiler/options.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/options.m,v
retrieving revision 1.599
diff -u -r1.599 options.m
--- compiler/options.m 6 Nov 2007 05:25:08 -0000 1.599
+++ compiler/options.m 6 Nov 2007 05:57:27 -0000
@@ -3503,10 +3503,8 @@
"--no-reorder-disj",
"\tExecute disjunctions strictly left-to-right.",
"--no-fully-strict",
- "\tAllow mmc to optimize away infinite loops or calls to error/1.",
- "\tAlso allow mmc to replace (semi)pure det goals that have no",
- "\toutputs with `true' and replace (semi)pure goals that will",
- "\talways fail with `fail'.",
+ "\tAllow infinite loops or goals with determinism erroneous to be",
+ "\toptimised away.",
"--allow-stubs",
"\tAllow procedures to have no clauses. Any calls to",
"\tsuch procedures will raise an exception at run-time.",
Index: compiler/simplify.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/simplify.m,v
retrieving revision 1.218
diff -u -r1.218 simplify.m
--- compiler/simplify.m 10 Oct 2007 14:35:27 -0000 1.218
+++ compiler/simplify.m 6 Nov 2007 05:57:27 -0000
@@ -650,11 +650,10 @@
)
->
MainPieces = [words("Warning: this goal cannot succeed.")],
- VerbosePieces =
- [words("The compiler will optimize away this goal,"),
- words("replacing it with `fail'."),
- words("To disable this optimization, use"),
- words("the `--fully-strict' option.")],
+ VerbosePieces = [
+ words("The compiler will optimize away this goal,"),
+ words("replacing it with `fail'.")
+ ],
Msg = simple_msg(Context,
[option_is_set(warn_simple_code, yes,
[always(MainPieces), verbose_only(VerbosePieces)])]),
Index: doc/reference_manual.texi
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/doc/reference_manual.texi,v
retrieving revision 1.411
diff -u -r1.411 reference_manual.texi
--- doc/reference_manual.texi 31 Oct 2007 03:58:25 -0000 1.411
+++ doc/reference_manual.texi 6 Nov 2007 05:57:27 -0000
@@ -6148,9 +6148,8 @@
combinations of the @samp{--no-reorder-conj}, @samp{--no-reorder-disj},
and @samp{--no-fully-strict} options.
(The @samp{--no-fully-strict} option allows the compiler to improve
-completeness by optimizing away infinite loops,
-calls to @code{require.error/1} or @code{exception.throw/1} and
-(semi)pure goals that are declaratively equivalent to true or false.)
+completeness by optimizing away infinite loops and goals with determinism
+ at code{erroneous}.)
The default semantics are the strict commutative semantics.
Enabling @samp{--no-reorder-conj} and @samp{--no-reorder-disj} gives the
strict sequential semantics.
Index: doc/user_guide.texi
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/doc/user_guide.texi,v
retrieving revision 1.550
diff -u -r1.550 user_guide.texi
--- doc/user_guide.texi 6 Nov 2007 05:25:09 -0000 1.550
+++ doc/user_guide.texi 6 Nov 2007 05:57:27 -0000
@@ -6908,11 +6908,8 @@
@sp 1
@item --no-fully-strict
@findex --no-fully-strict
-Allow the compiler to optimize away infinite loops or calls to
- at code{error/1} or @code{throw/1}.
-Also allow the compiler to replace det (semi)pure goals that have no outputs
-with @samp{true}
-and (semi)pure goals that will always fail with @samp{fail}.
+Allow infinite loops or goals with determinism erroneous to be optimised
+away.
@sp 1
@item --allow-stubs
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to: mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions: mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------
More information about the reviews
mailing list