a + b = c
c - a = b
Ok, now
a & b = c
c ?? a = b
which operator replace "??" ?
Thanks
There is no such operator, because it will be ill-defined if it exists:
so, let a = 0, c = 0
we have
a & 0 = c
a & 1 = c
then, we should have
c ?? a = 0 and c ?? a = 1
, but an operator/function cannot return two values given the same input/parameters.
It's impossible. This is because a & b
is a lossy transformation.
You don't know whether any dropped 1
bits were part of a
or b
.
== 0
(just like &&
). I wonder if there is a three-valued logical operator a ? b
where 0 ? .
is undefined (just like 0/0
) and 1 ? b
is b
. I haven't been able to find one.
Mar 31, 2014 at 20:03
You can't.
0 && 0 == 0
1 && 0 == 0
To reverse this, you'd need an operator that gives back both 0
and 1
.
(But if b == 1
you do of course know that a == c
.)
No operator can replace "??" ! Only relation (logical relation !) b = (c=a)x2 + (not c) can replace ""??".
J.Kawecki: Logical Relations. Warsaw,2019 Druk24h.pl
&
doesn't have an inverse operation. Now see if you can generalize the problem: do any of the logical operators have inverses?