Negation should probably work such that
(~(<1>))[1] = 0 (~(<1>))[2] = infinity
So ~ transforms the element counts as 0 --> infty, x --> 0 if x != 0.
You'd also have
m = ~(<1>) & (<1, 2, 2, 3>); m[1] == 0 m[2] == 1 // Really the count is 2 m[3] == 1 m[4] == +infinity
m & ~~(<1,2,3>) == (<2,2,3>)
/ Niels Möller ()
Previous text:
2003-02-06 14:04: Subject: Xor
Would ~(< 1 >)[1] return (infinity-1) or 0? And ~(< 1,1 >)[1] (infinity-2)?
It would probably be more useful to view multisets as sets when negating them. I think. That is, (~(< 1 >))[1] is 0.
/ Per Hedbor ()