eclipse-ocl / org.eclipse.ocl

Eclipse Public License 2.0
0 stars 0 forks source link

[evaluation] Internal problems can be optimized, external errors are not OCL #1789

Open eclipse-ocl-bot opened 2 hours ago

eclipse-ocl-bot commented 2 hours ago

| --- | --- | | Bugzilla Link | 509713 | | Status | NEW | | Importance | P3 normal | | Reported | Dec 26, 2016 05:07 EDT | | Modified | Mar 06, 2017 04:01 EDT | | Blocks | 509404, 509309 | | See also | 509404, 509661, 512738 | | Reporter | Ed Willink |

Description

In order to optimize "aSequence->includes(x)->last()" as "x", it is necessary to prove that aSequence is not-invalid.

This is almost always impossible for arbitrary OCL since any PropertyCallExp may encounter a network access failure.

However if we use "invalid" only for program failures such as null-navigation, divide-by-zero, index-out-of-bound, a static proof of not-invalid will often (?usually) be possible.

Non-program failures such as network/disk/memory/stack failures should instead be an "error" that is only catchable by an explicit aValue.oclIsError(). Errors would pass through logic operations unchanged. 5-level logic, but it's actually what is appropriate and arguably already there.

... raised as http://issues.omg.org/browse/OCL25-209

Therefore change OCL evaluation to remove all catches of non-determinstic Java exceptions.

eclipse-ocl-bot commented 2 hours ago

By Ed Willink on Jan 11, 2017 11:31

CGed PropertyCallExp changed to not-invalid for M5.

eclipse-ocl-bot commented 2 hours ago

By Ed Willink on Mar 06, 2017 04:00

For QVTd, Bug 509404, we would really like run-time failures to fail, so for OCL 2.0 compatibility introduce InvalidEvaluationException that extends InvalidValueException for use by run-time errors.

In the short term, code can catch InvalidEvaluationException before InvalidValueException to handle errors differently.

For OCL 3.0, we can review whether the relative inheritance is correct. JUst possibly only InvalidEvaluationException extends RuntimeException requiring InvalidValueException to be declared.