<s>
In	O
logic	O
,	O
a	O
three-valued	B-Language
logic	I-Language
(	O
also	O
trinary	B-Language
logic	I-Language
,	O
trivalent	O
,	O
ternary	O
,	O
or	O
trilean	O
,	O
sometimes	O
abbreviated	O
3VL	B-Language
)	O
is	O
any	O
of	O
several	O
many-valued	O
logic	O
systems	O
in	O
which	O
there	O
are	O
three	O
truth	O
values	O
indicating	O
true	O
,	O
false	O
and	O
some	O
third	O
value	O
.	O
</s>
<s>
The	O
conceptual	O
form	O
and	O
basic	O
ideas	O
of	O
three-valued	B-Language
logic	I-Language
were	O
initially	O
published	O
by	O
Jan	O
Łukasiewicz	O
and	O
Clarence	O
Irving	O
Lewis	O
.	O
</s>
<s>
As	O
with	O
bivalent	O
logic	O
,	O
truth	O
values	O
in	O
ternary	B-Language
logic	I-Language
may	O
be	O
represented	O
numerically	O
using	O
various	O
representations	O
of	O
the	O
ternary	B-Algorithm
numeral	I-Algorithm
system	I-Algorithm
.	O
</s>
<s>
in	O
balanced	B-Algorithm
ternary	I-Algorithm
,	O
each	O
digit	O
has	O
one	O
of	O
3	O
values	O
:	O
−1	O
,	O
0	O
,	O
or	O
+1	O
;	O
these	O
values	O
may	O
also	O
be	O
simplified	O
to	O
−	O
,	O
0	O
,	O
+	O
,	O
respectively	O
;	O
</s>
<s>
in	O
the	O
ternary	B-Algorithm
numeral	I-Algorithm
system	I-Algorithm
,	O
each	O
digit	O
is	O
a	O
trit	B-Algorithm
(	O
trinary	B-Algorithm
digit	O
)	O
having	O
a	O
value	O
of	O
:	O
0	O
,	O
1	O
,	O
or	O
2	O
;	O
</s>
<s>
in	O
the	O
skew	B-Application
binary	I-Application
number	I-Application
system	I-Application
,	O
only	O
the	O
least-significant	O
non-zero	O
digit	O
can	O
have	O
a	O
value	O
of	O
2	O
,	O
and	O
the	O
remaining	O
digits	O
have	O
a	O
value	O
of	O
0	O
or	O
1	O
;	O
</s>
<s>
Inside	O
a	O
ternary	B-Device
computer	I-Device
,	O
ternary	O
values	O
are	O
represented	O
by	O
ternary	B-Protocol
signals	I-Protocol
.	O
</s>
<s>
Ternary	O
predicate	O
logics	O
exist	O
as	O
well	O
;	O
these	O
may	O
have	O
readings	O
of	O
the	O
quantifier	B-Language
different	O
from	O
classical	O
(	O
binary	O
)	O
predicate	O
logic	O
and	O
may	O
include	O
alternative	O
quantifiers	B-Language
as	O
well	O
.	O
</s>
<s>
Boolean	O
logic	O
allows	O
22	O
=	O
4	O
unary	O
operators	O
,	O
the	O
addition	O
of	O
a	O
third	O
value	O
in	O
ternary	B-Language
logic	I-Language
leads	O
to	O
a	O
total	O
of	O
33	O
=	O
27	O
distinct	O
operators	O
on	O
a	O
single	O
input	O
value	O
.	O
</s>
<s>
Similarly	O
,	O
where	O
Boolean	O
logic	O
has	O
22×2	O
=	O
16	O
distinct	O
binary	O
operators	O
(	O
operators	O
with	O
2	O
inputs	O
)	O
possible	O
,	O
ternary	B-Language
logic	I-Language
has	O
33×3	O
=	O
19,683	O
such	O
operators	O
.	O
</s>
<s>
Where	O
we	O
can	O
easily	O
name	O
a	O
significant	O
fraction	O
of	O
the	O
Boolean	O
operators	O
(	O
NOT	O
,	O
AND	O
,	O
NAND	O
,	O
OR	O
,	O
NOR	O
,	O
XOR	B-Application
,	O
XNOR	O
,	O
equivalence	O
,	O
implication	O
)	O
,	O
it	O
is	O
unreasonable	O
to	O
attempt	O
to	O
name	O
all	O
but	O
a	O
small	O
fraction	O
of	O
the	O
possible	O
ternary	O
operators	O
.	O
</s>
<s>
balanced	B-Algorithm
ternary	I-Algorithm
values	O
,	O
are	O
assigned	O
to	O
false	O
,	O
unknown	O
and	O
true	O
such	O
that	O
false	O
is	O
less	O
than	O
unknown	O
and	O
unknown	O
is	O
less	O
than	O
true	O
,	O
then	O
A	O
AND	O
B	O
AND	O
C	O
...	O
=	O
MIN( A	O
,	O
B	O
,	O
C	O
...	O
)	O
and	O
A	O
OR	O
B	O
OR	O
C	O
...	O
=	O
MAX( A	O
,	O
B	O
,	O
C	O
...	O
)	O
.	O
</s>
<s>
M	O
is	O
read	O
as	O
"	O
it	O
is	O
not	O
false	O
that	O
...	O
"	O
or	O
in	O
the	O
(	O
unsuccessful	O
)	O
Tarski	O
–	O
Łukasiewicz	O
attempt	O
to	O
axiomatize	O
modal	O
logic	O
using	O
a	O
three-valued	B-Language
logic	I-Language
,	O
"	O
it	O
is	O
possible	O
that	O
...	O
"	O
L	O
is	O
read	O
"	O
it	O
is	O
true	O
that	O
...	O
"	O
or	O
"	O
it	O
is	O
necessary	O
that	O
...	O
"	O
Finally	O
I	O
is	O
read	O
"	O
it	O
is	O
unknown	O
that	O
...	O
"	O
or	O
"	O
it	O
is	O
contingent	O
that	O
...	O
"	O
</s>
<s>
The	O
logic	O
of	O
here	O
and	O
there	O
(	O
HT	O
,	O
also	O
referred	O
as	O
Smetanov	O
logic	O
SmT	O
or	O
as	O
Gödel	B-Language
G3	O
logic	O
)	O
,	O
introduced	O
by	O
Heyting	O
in	O
1930	O
as	O
a	O
model	O
for	O
studying	O
intuitionistic	O
logic	O
,	O
is	O
a	O
three-valued	O
intermediate	O
logic	O
where	O
the	O
third	O
truth	O
value	O
NF	O
(	O
not	O
false	O
)	O
has	O
the	O
semantics	O
of	O
a	O
proposition	O
that	O
can	O
be	O
intuitionistically	O
proven	O
to	O
not	O
be	O
false	O
,	O
but	O
does	O
not	O
have	O
an	O
intuitionistic	O
proof	O
of	O
correctness	O
.	O
</s>
<s>
Some	O
3VL	B-Language
modular	O
algebras	O
have	O
been	O
introduced	O
more	O
recently	O
,	O
motivated	O
by	O
circuit	O
problems	O
rather	O
than	O
philosophical	O
issues	O
:	O
</s>
<s>
The	O
database	O
structural	O
query	O
language	O
SQL	B-Language
implements	O
ternary	B-Language
logic	I-Language
as	O
a	O
means	O
of	O
handling	O
comparisons	O
with	O
NULL	B-Language
field	O
content	O
.	O
</s>
<s>
NULL	B-Language
was	O
originally	O
intended	O
to	O
be	O
used	O
as	O
a	O
sentinel	B-Data_Structure
value	I-Data_Structure
in	O
SQL	B-Language
to	O
represent	O
missing	O
data	O
in	O
a	O
database	O
,	O
i.e.	O
</s>
<s>
SQL	B-Language
uses	O
a	O
common	O
fragment	O
of	O
the	O
Kleene	O
K3	O
logic	O
,	O
restricted	O
to	O
AND	O
,	O
OR	O
,	O
and	O
NOT	O
tables	O
.	O
</s>
<s>
In	O
SQL	B-Language
,	O
the	O
intermediate	O
value	O
is	O
intended	O
to	O
be	O
interpreted	O
as	O
UNKNOWN	O
.	O
</s>
<s>
Explicit	O
comparisons	O
with	O
NULL	B-Language
,	O
including	O
that	O
of	O
another	O
NULL	B-Language
yields	O
UNKNOWN	O
.	O
</s>
<s>
UNION	O
or	O
INTERSECT	O
,	O
where	O
NULLs	B-Language
are	O
treated	O
as	O
equal	O
with	O
each	O
other	O
.	O
</s>
<s>
Critics	O
assert	O
that	O
this	O
inconsistency	O
deprives	O
SQL	B-Language
of	O
intuitive	O
semantics	O
in	O
its	O
treatment	O
of	O
NULLs	B-Language
.	O
</s>
<s>
The	O
SQL	B-Language
standard	O
defines	O
an	O
optional	O
feature	O
called	O
F571	O
,	O
which	O
adds	O
some	O
unary	O
operators	O
,	O
among	O
which	O
is	O
IS	O
UNKNOWN	O
corresponding	O
to	O
the	O
Łukasiewicz	O
I	O
in	O
this	O
article	O
.	O
</s>
<s>
The	O
addition	O
of	O
IS	O
UNKNOWN	O
to	O
the	O
other	O
operators	O
of	O
SQL	B-Language
's	O
three-valued	B-Language
logic	I-Language
makes	O
the	O
SQL	B-Language
three-valued	B-Language
logic	I-Language
functionally	O
complete	O
,	O
meaning	O
its	O
logical	O
operators	O
can	O
express	O
(	O
in	O
combination	O
)	O
any	O
conceivable	O
three-valued	O
logical	O
function	O
.	O
</s>
