View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0000359 | mercury | Bug | public | 2014-09-05 17:31 | 2018-03-06 15:45 | ||||||||
Reporter | wangp | ||||||||||||
Assigned To | |||||||||||||
Priority | normal | Severity | minor | Reproducibility | always | ||||||||
Status | new | Resolution | open | ||||||||||
Product Version | |||||||||||||
Target Version | Fixed in Version | ||||||||||||
Summary | 0000359: constrained polymorphic modes | ||||||||||||
Description | Saving test cases to fix some other time. | ||||||||||||
Tags | No tags attached. | ||||||||||||
Attached Files |
|
Notes | |
wangp (developer) 2014-10-09 11:44 |
The problem in lambda.m: http://www.mercurylang.org/list-archives/users/2002-August/001921.html |
mark (administrator) 2015-07-15 11:37 |
A workaround for this is to use an explicit pred expression. For the lambda.m example, write: P = (pred(Z::out(bound(1))) is det :- id(1, Z)) This will ensure that the inst variable for call to id/2 is bound in the way that is intended. |
wangp (developer) 2018-03-06 15:31 |
While investigating something else, I found that modecheck_higher_order_call calls inst_expand which does not look past a top-level node of constrained_inst_vars. So this does not work, but I think there is no reason it should not work. :- inst b == (pred(in) is semidet). :- pred p2(pred(int)::in(I)) is semidet <= I =< b. p2(X) :- X(42). |
wangp (developer) 2018-03-06 15:45 |
The compiler crashes on create_test_unification.m: Software Error: predicate `parse_tree.prog_mode.get_arg_insts'/4: Unexpected: defined_inst simplify_goal_switch.create_test_unification calls inst_expand (which does not touch an inst with constrained_inst_vars at the top level) followed by get_arg_insts (which expects the inst to be expanded). |
Issue History | |||
Date Modified | Username | Field | Change |
---|---|---|---|
2014-09-05 17:31 | wangp | New Issue | |
2014-09-05 17:31 | wangp | File Added: lambda.m | |
2014-10-09 11:44 | wangp | Note Added: 0000793 | |
2015-07-15 11:37 | mark | Note Added: 0000843 | |
2018-03-06 15:24 | wangp | File Added: ho_constrained_poly_inst.m | |
2018-03-06 15:31 | wangp | Note Added: 0000966 | |
2018-03-06 15:41 | wangp | File Added: create_test_unification.m | |
2018-03-06 15:45 | wangp | Note Added: 0000967 |