|Re: false or null = null? [message #1754046 is a reply to message #1754038]
||Tue, 14 February 2017 07:15
| Ed Willink
Registered: July 2009
No and Yes.
The new Pivot-based Eclipse OCL that prototypes solutions to many specification problems is correct. It has a JUnit sub-test:
ocl.assertQueryNull(null, "let b : Boolean = null in false or b");
The classic Eclipse OCL that has a number of issues that are too hard to resolve has:
assertResultInvalid("let b : Boolean = null in false or b");
Unfortunately migration to the new Pivot OCL is a still an aspiration for QVTo, which is I think what you are using.
This is an area that changed as a consequence of the observation by the Isabelle researchers that OCL Boolean operations were not idempotent for null. i.e "X = not not X" should be true. OCL 2.4 Boolean is consistently 4-valued, whereas OCL 2.3 Boolean was 3.5-valued, results were always 3-valued, although the inputs could be 4-valued; there was no difference between null/invalid as input; hence I call it 3.5-valued. IMHO the 3.5-valued seems slightly better, although it seems that in practice code that actually uses this corner is dangerous. When I've tried to have a logic that re-uses Boolean to handle explicitly-true, explicitly-false, unspecified, I find that I need to implement logic explicitly.
Powered by FUDForum
. Page generated in 0.01993 seconds