[m-rev.] for post-commit review: fix mantis bug 361
Julien Fischer
jfischer at opturion.com
Tue Sep 16 13:33:31 AEST 2014
On Tue, 16 Sep 2014, Zoltan Somogyi wrote:
> The code change is minimal. The review is for the comment
> and the updated documentation.
...
> diff --git a/doc/reference_manual.texi b/doc/reference_manual.texi
> index ee8fc05..56ce910 100644
> --- a/doc/reference_manual.texi
> +++ b/doc/reference_manual.texi
> @@ -9794,6 +9794,9 @@ is the perfect model.)
> The current Mercury implementation supports
> three different pragmas for tabling, to cover these three cases:
> @samp{loop_check}, @samp{memo}, and @samp{minimal_model}.
> +
> + at itemize @bullet
> + at item
> The @samp{loop_check} pragma asks only for loop checking.
> With this pragma, the memo table will map each distinct set of input arguments
> only to a single boolean saying whether
> @@ -9801,6 +9804,19 @@ a call with those arguments is currently active or not;
> the pragma's only effect is to cause the predicate to throw an exception
> if this boolean says that the current call has the same arguments
> as one of its ancestors, which indicates an infinite recursive loop.
> +
> +Note that loop checking for nondet and multi predicates assumes that
> +calls to these predicates generate all their solutions and then fail.
> +If a caller asks them only for some solutions
> +and then cuts away all later solutions
> +(e.g. via a quantification
> +that only asks whether a solution satisfying a particular test exists),
> +then the cut-away call never get a chance
s/get/gets/ (or has)
> +to record the fact that it is not longer active.
> +The next call to that predicate with the same arguments
> +will therefore think that the previous call is still active,
> +and will consider this call to be an infinite loop.
> + at item
That looks ok otherwise. Thanks for looking into that so promptly.
Cheers,
Julien.
More information about the reviews
mailing list