Mercury Bugs - mercury
View Issue Details
0000360mercuryFeature Requestpublic2014-09-15 14:542014-09-18 20:57
Reporterjuliensf 
Assigned Tozs 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionnot fixable 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000360: minimal_model tabling of semidet procedures
DescriptionThe attached program is a version of the Happy Numbers task from RosettaCode,
<http://rosettacode.org/wiki/Happy_numbers>. It attempts to use minimal_model tabling
to avoid the explicit caching that the existing version uses. That doesn't work since minimal_model
tabling and semidet predicates are not supported. Can this restriction be lifted? In the meantime,
the reference manual section on tabling should make mention of the restriction.
TagsNo tags attached.
Attached Files? happy_mm.m (799) 2014-09-15 14:54
https://bugs.mercurylang.org/file_download.php?file_id=224&type=bug

Notes
(0000789)
zs   
2014-09-16 13:45   
No, minimal model evaluation cannot be applied to model_semi procedures (or model_det, for that matter). Its current implementation inherently relies on the predicate having its stack frame on the nondet stack, because it works by manipulating that stack. Giving a model_det or model_semi procedure a frame on the nondet stack would violate invariants that say that such procedures do not touch the nondet stack.
(0000790)
zs   
2014-09-18 20:57   
Clarification to the documentation committed sep 18.

Issue History
2014-09-15 14:54juliensfNew Issue
2014-09-15 14:54juliensfFile Added: happy_mm.m
2014-09-16 13:45zsNote Added: 0000789
2014-09-18 20:57zsNote Added: 0000790
2014-09-18 20:57zsStatusnew => closed
2014-09-18 20:57zsAssigned To => zs
2014-09-18 20:57zsResolutionopen => not fixable