The example given in the seminar does not work as intended. It gives the following warring/error (I'm not sure since it still prints the final state) :
line 10:10 no viable alternative at input 'forallyin{1..6}if(ybelongsTo'
s1 = { 1 .. 5 }; s2 = { 2, 4, 6, 7 }; a = s1 U s2 ; b = s1 ^ s2; c = s1 \ s2; x = 0; forall y in s2 x = x + y; d = emptySet; forall y in { 1 .. 6 } if (y belongsTo s2) d = d U { y };
The correct way of doing this seems to have changed to using 'in':
if (y in s2) d = d U { y };
The language manual needs to be updated to reflect this change as well as any code examples used in the future.
The example given in the seminar does not work as intended. It gives the following warring/error (I'm not sure since it still prints the final state) :
s1 = { 1 .. 5 }; s2 = { 2, 4, 6, 7 }; a = s1 U s2 ; b = s1 ^ s2; c = s1 \ s2; x = 0; forall y in s2 x = x + y; d = emptySet; forall y in { 1 .. 6 } if (y belongsTo s2) d = d U { y };The correct way of doing this seems to have changed to using 'in':
if (y in s2) d = d U { y };The language manual needs to be updated to reflect this change as well as any code examples used in the future.