On Wed, Feb 16, 2005 at 12:17:35PM +1100, Damian Conway wrote: > Rod Adams wrote: > >On a slightly different topic, do the following equivalences work: > >[...] > >none($a, $a) == undef > True.
Scott already caught (and Damian acknowledged) this one, it's false if $a == undef. > >none($a,$a,$b) == none($a,$b) > True. Okay, I follow this one -- here's the derivation. -> none($a == none($a, $b), $b == none($a, $b)) -> none(none($a==$a, $a==$b), none($b==$a, $b==$b)) -> none(none(1, 0), none(0, 1)) -> none(0, 0) -> true > >none(none($a,$b),none($c,$d)) == none($a,$b,$c,$d) > True. Hmmmm... -> none(none($a,$b) == none($a,$b,$c,$d), none($c,$d) == none($a,$b,$c,$d)) -> none(none($a == none($a,$b,$c,$d), $b == none($a,$b,$c,$d)), none($c == none($a,$b,$c,$d), $d == none($a,$b,$c,$d))) -> none(none(none($a==$a, $a==$b, $a==$c, $a==$d), none($b==$a, $b==$b, $b==$c, $b==$d)), none(none($c==$a, $c==$b, $c==$c, $c==$d), none($d==$a, $d==$b, $d==$c, $d==$d))) -> none(none(none(1, 0, 0, 0), none(0, 1, 0, 0)), none(none(0, 0, 1, 0), none(0, 0, 0, 1))) -> none(none(0, 0), none(0, 0)) -> none(1,1) -> false Ummm, what am I missing? To state it another way... we can show that none($a,$b) == none($a, $b, $c, $d) is true, so none( none($a,$b), none($c,$d) ) == none($a, $b, $c, $d) is equivalent to none( none($a,$b) == none($a, $b, $c, $d), none($c,$d) == none($a, $b, $c, $d)) which is none(1, 1), or false. Did I autothread wrongly here? And for completeness... > >one($a,$a,$b) == ($a == $b ?? undef :: $b) > True. ...except when $a == $b == undef. Pm