Mercury Bugs - mercury | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0000317 | mercury | Bug | public | 2014-02-07 15:33 | 2014-02-10 10:38 |
Reporter | lpimmes | ||||
---|---|---|---|---|---|
Assigned To | juliensf | ||||
Priority | high | Severity | major | Reproducibility | always |
Status | resolved | Resolution | no change required | ||
Platform | OS | OSx 10.9.1 | OS Version | ||
Product Version | |||||
Target Version | Fixed in Version | ||||
Summary | 0000317: :- pragma memo(findLngCmnSubsqStck/3). WORKING; not sure how to do static Asymptotic analysis | ||||
Description | Answers for longest common subsequence appear to be correct. If pragma commented out, we take forever on longer test cases. Thus pragma is working, but how? I returned number of calls to findLngCmnSubsqStck/3. Number of calls remains the same regardless of pragma or not. I would expect calls to be reduced significantly. This is a bug in my understanding. Thank goodness pragma works, because it really speeds things up. I would like to resolve what other authors have determined: 'total number of calls is at most 2(m+1)(n+1)+1 and the time is O(mn)' | ||||
Steps To Reproduce | See listing for comments of trace run. Perhaps I counted incorrectly. Thanks again to the Mercury team, and Mercury! | ||||
Additional Information | Example output: % lngCommSubseqStck 495>./lngCommonSubseqStck % Input test case 0, 1, 2, 3, 4, ... Output longest common subsequence. % ^d to quit. % Caching really speeds up execution, but same number of calls. % 0 % LongestCommonSubsequence('a', 'a')='a', % a length: 1, b length: 1, findLngCmnSubsqStck calls: 2. % 1 % LongestCommonSubsequence('aa', 'bb')='', % a length: 2, b length: 2, findLngCmnSubsqStck calls: 4. % 2 % LongestCommonSubsequence('aaa', 'bbb')='', % a length: 3, b length: 3, findLngCmnSubsqStck calls: 7. % 3 % LongestCommonSubsequence('aaaa', 'bbbb')='', % a length: 4, b length: 4, findLngCmnSubsqStck calls: 11. % 4 % LongestCommonSubsequence('aaaaa', 'bbbbb')='', % a length: 5, b length: 5, findLngCmnSubsqStck calls: 16. % 5 % LongestCommonSubsequence('aaaaaa', 'bbbbbb')='', % a length: 6, b length: 6, findLngCmnSubsqStck calls: 22. % 6 % LongestCommonSubsequence('aaaaaaa', 'bbbbbbb')='', % a length: 7, b length: 7, findLngCmnSubsqStck calls: 29. % 7 % LongestCommonSubsequence('aaaaaaaa', 'bbbbbbbb')='', % a length: 8, b length: 8, findLngCmnSubsqStck calls: 37. % 9 % LongestCommonSubsequence('aaaaaaaaaa', 'bbbbbbbbbb')='', % a length: 10, b length: 10, findLngCmnSubsqStck calls: 56. | ||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | lngCommonSubseqStck.m (9,448) 2014-02-07 15:33 https://bugs.mercurylang.org/file_download.php?file_id=201&type=bug lngCommonSubseqStck_tbl.m (12,434) 2014-02-07 19:34 https://bugs.mercurylang.org/file_download.php?file_id=202&type=bug |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
Issue History | |||||
Date Modified | Username | Field | Change | ||
---|---|---|---|---|---|
2014-02-07 15:33 | lpimmes | New Issue | |||
2014-02-07 15:33 | lpimmes | File Added: lngCommonSubseqStck.m | |||
2014-02-07 16:39 | juliensf | Note Added: 0000640 | |||
2014-02-07 19:34 | lpimmes | File Added: lngCommonSubseqStck_tbl.m | |||
2014-02-07 19:36 | lpimmes | Note Added: 0000641 | |||
2014-02-07 20:06 | juliensf | Note Added: 0000642 | |||
2014-02-08 07:26 | lpimmes | Note Added: 0000643 | |||
2014-02-09 01:45 | ttmrichter | Note Added: 0000644 | |||
2014-02-10 10:38 | juliensf | Note Added: 0000645 | |||
2014-02-10 10:38 | juliensf | Status | new => resolved | ||
2014-02-10 10:38 | juliensf | Resolution | open => no change required | ||
2014-02-10 10:38 | juliensf | Assigned To | => juliensf |