Re:Beyond Functional Programming: The Verse Programming Lang...
by krcz on Sunday December 11, 2022 @08:41PM
(#33949865)
These are not possible, as x can be 7 only if y is 7, and likewise for 8. Semantics isn't based on sets, but on non-deterministic assignments to variables: y is either 7 or 8 and x is either y or 2.
Re:Beyond Functional Programming: The Verse Programming Lang...
by ihm on Sunday December 11, 2022 @08:55PM
(#33949955)
(7, 8) and (8, 7) are not possible because:
If x = 2 then clearly (x, y) is not (7, 8) or (8, 7) because 2 is not 7 or 8.
If x = y then (x, y) is (7, 7) or (8, 8).
Re:Beyond Functional Programming: The Verse Programming Lang...
by zozbot234 on Sunday December 11, 2022 @08:33PM
(#33949786)
It can't be either of those, because any given outcome is forcing a single value of y (or any variable in general).
Re:Beyond Functional Programming: The Verse Programming Lang...
by fercircularbuf on Sunday December 11, 2022 @08:36PM
(#33949822)
Edit: Ah... I see now.
By that logic, how is either (7,7) or (8,8) allowed?
Re:Beyond Functional Programming: The Verse Programming Lang...
by sidlls on Sunday December 11, 2022 @11:51PM
(#33951009)
"x:=(y|2); y:=(7|8); (x|y)"
translates (roughly) to:
(x|y) is a cartesian product--the set of all ordered pairs (X,Y) such that X is in x and Y is in Y, in order.
x has 2 elements: X=y and X=2.
y has 2 elements: Y=7 and Y=8.
So the set of all ordered pairs is (X=Y, Y=7), (X=Y, Y=8), (X=2, Y=7), (X=2,Y=8).
Since X=Y in the first two pairs, replace it with the value of Y from that pair: (X=7,Y=7), (X=8,Y=8).
Re:Beyond Functional Programming: The Verse Programming Lang...
by msk-lywenn on Sunday December 11, 2022 @08:43PM
(#33949875)
It's an exclusive or. So if x is y that is 7, then it can't be 8.
How does x:=(y|2); y:=(7|8); (x|y) Give only (7,7), (8,8), (2,7), (2,8)?
What about (7,8) or (8,7)?