Mercury Bugs - mercury
View Issue Details
0000155mercuryBugpublic2010-07-07 17:512010-07-07 18:01
Reporterpbone 
Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
StatusnewResolutionopen 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000155: Mode error with impure code.
DescriptionI'm writing a failure driven loop that uses impurity to implement a branch and bound solver. The mode checker tells me that a value is 'free' when it should be (and is) 'ground'.

I will attach two programs that exhibit this error. Note that removing the switch on BestSolutionFinal and changing the type of the predicates output makes the problem go away.
TagsNo tags attached.
Attached Files? bug155a.m (2,863) 2010-07-07 17:58
https://bugs.mercurylang.org/file_download.php?file_id=103&type=bug
? bug155b.m (2,709) 2010-07-07 18:01
https://bugs.mercurylang.org/file_download.php?file_id=104&type=bug

Notes
(0000275)
pbone   
2010-07-07 17:59   
Test case one:

pbone@taura:/tmp$ mmc --compile-to-c bug155a
bug155a.m:060: In clause for `branch_and_bound((pred(in, out) is nondet),
bug155a.m:060: (func(in) = out is det), out)':
bug155a.m:060: in argument 2 of call to predicate `float.<'/2:
bug155a.m:060: mode error: variable `BestObjective' has instantiatedness
bug155a.m:060: `free',
bug155a.m:060: expected instantiatedness was `ground'.
For more information, recompile with `-E'.
(0000276)
pbone   
2010-07-07 18:01   
Test case two:

pbone@taura:/tmp$ mmc --compile-to-c bug155b
bug155b.m:069: In clause for `branch_and_bound((pred(in, out) is nondet),
bug155b.m:069: (func(in) = out is det), out)':
bug155b.m:069: in argument 2 of call to predicate `mutvar.set_mutvar'/2:
bug155b.m:069: mode error: variable `BestSolutions' has instantiatedness
bug155b.m:069: `free',
bug155b.m:069: expected instantiatedness was `ground'.
For more information, recompile with `-E'.

Issue History
2010-07-07 17:51pboneNew Issue
2010-07-07 17:58pboneFile Added: bug155a.m
2010-07-07 17:59pboneNote Added: 0000275
2010-07-07 18:01pboneFile Added: bug155b.m
2010-07-07 18:01pboneNote Added: 0000276