View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0000236 | mercury | Bug | public | 2011-11-28 08:22 | 2011-11-28 10:39 | ||||||||
Reporter | colanderman | ||||||||||||
Assigned To | |||||||||||||
Priority | normal | Severity | text | Reproducibility | N/A | ||||||||
Status | new | Resolution | open | ||||||||||
Product Version | |||||||||||||
Target Version | Fixed in Version | ||||||||||||
Summary | 0000236: Documentation for unsorted_aggregate incorrect (trivial) | ||||||||||||
Description | solutions.unsorted_aggregate claims to be declaratively identical to calling list.foldl on the output of solutions.unsorted_solutions, when in fact it acts as if list.foldr is called. This is apparent from the definition of unsorted_solutions in solutions.m, which uses list.cons to build the solutions list (hence building it right-to-left). | ||||||||||||
Tags | No tags attached. | ||||||||||||
Attached Files |
|
Notes | |
2011-11-28 09:28 |
I don't think this is a bug, because declaratively the order of the solutions returned by unsorted_solutions is not defined (in fact all orders are valid in the declarative reading), so whether foldl or foldr is used for the declarative definition is irrelevant. It would be declaratively identical either way. |
colanderman (reporter) 2011-11-28 10:39 |
In practice, the order of solutions stays constant from run to run. It is useful while testing code to be able to replace unsorted_solutions with unsorted_aggregate (and v.v.) and obtain the same result. That this assumption is unreliable is sufficiently documented by the cc_multi determinism. Changing "foldl" to "foldr" in the documentation is at least on some level "more correct", and is not from any perspective that I can think of less correct. |
Issue History | |||
Date Modified | Username | Field | Change |
---|---|---|---|
2011-11-28 08:22 | colanderman | New Issue | |
2011-11-28 09:28 |
|
Note Added: 0000413 | |
2011-11-28 10:39 | colanderman | Note Added: 0000414 |