eclipse-ocl / org.eclipse.ocl

Eclipse Public License 2.0
0 stars 0 forks source link

[pivot evaluation] Fix null / invalid 4-valued Boolean iterators. #1598

Open eclipse-ocl-bot opened 1 month ago

eclipse-ocl-bot commented 1 month ago

| --- | --- | | Bugzilla Link | 474550 | | Status | NEW | | Importance | P3 normal | | Reported | Aug 08, 2015 16:25 EDT | | Modified | Aug 09, 2015 04:50 EDT | | Reporter | Ed Willink |

Description

The OCL spec specifies that any invalid body during an iteration propagates as invalid. This prohibits the current premature return once a good return is found.

e.g.

"Sequence{Sequence{true}, Sequence{false}, Sequence{}}->any(i | i->first())"

should be invalid, not true.

The OCL spec is also clear on how null body values interact with reject/select etc. The current implementation treats null as a 3-valued invalid.

A full iteration is burdensome for CG. A cannot-be-invalid analysis may permit a premature return.

eclipse-ocl-bot commented 1 month ago

By Ed Willink on Aug 09, 2015 04:50

Fixed on the OCL 2.5 branch.

Could be committed to maintenance but it's all a bit subtle.