Given the set, for example, {1, 2, 4, 10, 6} how can I get the element 4 to a variable var. What I want is to get element "4" from the set to a variable var: var = 4 And remove the element 4 from the set: set = {1, 2, 10, 6}
Based on the comments, it sounds like you want this:
with x \in set do
var := x;
set := set \ {x};
end with;