View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
---|---|---|---|---|---|---|---|---|---|
0000347 | mercury | Bug | public | 2014-07-16 05:47 | 2014-08-12 19:53 | ||||
Reporter | lpimmes | ||||||||
Assigned To | zs | ||||||||
Priority | high | Severity | major | Reproducibility | always | ||||
Status | closed | Resolution | no change required | ||||||
Platform | mac | OS | osx | OS Version | 10.9 | ||||
Product Version | |||||||||
Target Version | Fixed in Version | ||||||||
Summary | 0000347: Typing problem; how to represent 'types with additional info) in base type. See below. | ||||||||
Description | % included (by itself) works but I want included(none, 1) array2d.set(1, R, included(none, 1), InArr, UpdArr) included( ....) is a kind of info as :- type declarations show this. Not sure how represent in a calling function/predicate; line 75 knapsackDP_lib.m knapsackDP 501>make ... Making Mercury/ints/knapsackDP_lib.int Making Mercury/cs/knapsackDP_lib.c knapsackDP_lib.m:075: In clause for function `updArr'/2: knapsackDP_lib.m:075: in argument 4 of call to predicate `array2d.set'/5: knapsackDP_lib.m:075: type error: variable `InArr' has type knapsackDP_lib.m:075: `array2d.array2d(knapsackDP_lib.info)', knapsackDP_lib.m:075: expected type was knapsackDP_lib.m:075: `array2d.array2d(knapsackDP_lib.included)'. knapsackDP_lib.m:075: The partial type assignment was: knapsackDP_lib.m:075: R_4: int knapsackDP_lib.m:075: InArr_5: array2d.array2d(knapsackDP_lib.info) knapsackDP_lib.m:075: UpdArr_6: array2d.array2d(knapsackDP_lib.info) knapsackDP_lib.m:075: V_7: int knapsackDP_lib.m:075: V_8: knapsackDP_lib.included knapsackDP_lib.m:075: V_9: knapsackDP_lib.infoP knapsackDP_lib.m:075: V_10: int knapsackDP_lib.m:075: In clause for function `updArr'/2: ... error log truncated, see `knapsackDP_lib.err' for the complete log. ** Error making `Mercury/cs/knapsackDP_lib.c'. | ||||||||
Steps To Reproduce | See .zip file for *.m and Makefile. Extract into a directory then do > make Thanks for your time. | ||||||||
Tags | No tags attached. | ||||||||
Attached Files |
|
Notes | |
lpimmes (reporter) 2014-07-18 06:21 |
Problem work around: by using a less complicated solution: :- type status ---> included; omitted; includedAndOmitted; noSolution; notUsed; notSet. % notUsed: meaning index is not in range because of 0 based counting % notSet: my problem, if I didn't update value in progrom to: % either included, omitted, includeAndOmitted, or noSolution. :- type info ---> info( % only for included, but optional- 0,0 means not applicable n_om :: int, k_om :: int, n_inc :: int, k_inc :: int, theStatus :: status, kToPack :: int % part of return answer ). |
wangp (developer) 2014-07-18 16:38 |
You could do this: :- type info ---> included(included) ; omitted(omitted) ; includedAndOmitted(included, omitted) ; noSolution ; notUsed ; notSet. :- type included ---> included( gotoInc :: infoP, kToPack :: int ). :- type omitted ---> omitted( gotoOm :: infoP ). |
zs (developer) 2014-08-12 19:53 |
Not a compiler bug. |
Issue History | |||
Date Modified | Username | Field | Change |
---|---|---|---|
2014-07-16 05:47 | lpimmes | New Issue | |
2014-07-16 05:47 | lpimmes | File Added: compErr.zip | |
2014-07-18 06:21 | lpimmes | Note Added: 0000746 | |
2014-07-18 16:38 | wangp | Note Added: 0000749 | |
2014-08-12 19:53 | zs | Note Added: 0000761 | |
2014-08-12 19:53 | zs | Status | new => closed |
2014-08-12 19:53 | zs | Assigned To | => zs |
2014-08-12 19:53 | zs | Resolution | open => no change required |