Skip to content

belongsTo doesn't seem to work #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
simi2525 opened this issue Feb 21, 2019 · 1 comment
Closed

belongsTo doesn't seem to work #4

simi2525 opened this issue Feb 21, 2019 · 1 comment

Comments

@simi2525
Copy link
Contributor

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.

@dlucanu
Copy link
Contributor

dlucanu commented Feb 21, 2019

You are right. The manual is updated now. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants