Closed Luke-Michael-Brown closed 11 years ago
Tested and works well. Here's a summary of outputs for old clafer and the one in i226:
// Alloy 4.1 (old)
fact { (c1_x.@ref) = ((-(1.add[2])).div[3]) }
// Alloy 4.1 (new)
fact { (c1_x.@ref) = (((1.add[2]).mul[-1]).div[3]) }
// Alloy 4.2 (old)
fact { (c1_x.@ref) = ((.minus[](1.plus[2])).div[3]) }
// Alloy 4.2 (new)
fact { (c1_x.@ref) = (((1.plus[2]).mul[-1]).div[3]) }
This can be merged.
see http://gsd.uwaterloo.ca:8888/question/948/unary-minus-generated-incorrectly-for-alloy42
Simple change of (-exp) to (exp*(-1))