Mercury Bugs - mercury
View Issue Details
0000244mercuryBugpublic2011-12-07 07:132011-12-10 00:28
Reportercolanderman 
Assigned Tozs 
PrioritynormalSeverityminorReproducibilityalways
StatusfeedbackResolutionreopened 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000244: Re-entering partially memoized multi/nondet predicate causes spurious loop exception
DescriptionIf a memoized multi or nondet predicate is called, and after a few (but not all) results have been returned, is called again in a context which requires all of its solutions (e.g. by the solutions module or an all [] goal), then the following spurious runtime error will be produced:

Uncaught Mercury exception:
Software Error: detected need for minimal model in XXX
Stack dump not available in this grade.

See attached program for example. Comment out the memo pragma to see the expected behavior.
Additional InformationPossibly related to bug 111.
TagsNo tags attached.
Attached Files? nondet_memo_bug.m (343) 2011-12-07 07:13
https://bugs.mercurylang.org/file_download.php?file_id=146&type=bug

Notes
(0000437)
zs   
2011-12-09 18:08   
This is not a bug. In such situations, the expected value of an atom depends on itself. The Mercury system cannot compute that value without minimal model tabling, as the error message says.
(0000438)
colanderman   
2011-12-10 00:28   
No, it doesn't depend on itself. The example in the attached test case isn't even recursive. Comment out the pragma memo and it runs just fine.

Issue History
2011-12-07 07:13colandermanNew Issue
2011-12-07 07:13colandermanFile Added: nondet_memo_bug.m
2011-12-09 18:08zsNote Added: 0000437
2011-12-09 18:08zsStatusnew => resolved
2011-12-09 18:08zsResolutionopen => fixed
2011-12-09 18:08zsAssigned To => zs
2011-12-10 00:28colandermanNote Added: 0000438
2011-12-10 00:28colandermanStatusresolved => feedback
2011-12-10 00:28colandermanResolutionfixed => reopened