<br>
In [[wp:logic|logic]], a '''three-valued logic''' (also '''trivalent''', '''ternary''', or  '''trinary logic''', sometimes abbreviated '''3VL''') is any of several [[wp:many-valued logic|many-valued logic]] systems in which there are three [[wp:truth value|truth value]]s indicating ''true'', ''false'' and some indeterminate third value.  

This is contrasted with the more commonly known [[wp:Principle of bivalence|bivalent]] logics (such as classical sentential or [[wp:boolean logic|boolean logic]]) which provide only for ''true'' and ''false''. 

Conceptual form and basic ideas were initially created by [[wp:Jan Łukasiewicz|Łukasiewicz]], [[wp:C. I. Lewis|Lewis]]  and [[wp:Sulski|Sulski]]. 

These were then re-formulated by [[wp:Grigore Moisil|Grigore Moisil]] in an axiomatic algebraic form, and also extended to ''n''-valued logics in 1945.
{|
|+'''Example ''Ternary Logic Operators'' in ''Truth Tables'':'''
|-
|
{| class=wikitable
|+''not'' a
|-
! colspan=2 | &not;
|-
| True || False
|-
| Maybe || Maybe
|-
| False || True
|}
||
{| class=wikitable
|+a ''and'' b
|-
! &and;
| True || Maybe || False
|-
| True || True || Maybe || False
|-
| Maybe || Maybe || Maybe || False
|-
| False || False || False || False
|}
||
{| class=wikitable
|-
|+a ''or'' b
|-
! &or;
| True || Maybe || False
|-
| True || True || True || True
|-
| Maybe || True || Maybe || Maybe
|-
| False || True || Maybe || False
|}
|-
||
{| class=wikitable
|-
|+''if'' a ''then'' b
|-
! ⊃
| True || Maybe || False
|-
| True || True || Maybe || False
|-
| Maybe || True || Maybe || Maybe
|-
| False || True || True || True
|}
||
{| class=wikitable
|-
|+a ''is equivalent to'' b
|-
! ≡
| True || Maybe || False
|-
| True || True || Maybe || False
|-
| Maybe || Maybe || Maybe || Maybe
|-
| False || False || Maybe || True
|}
|}


;Task:
* Define a new type that emulates ''ternary logic'' by storing data '''trits'''.
* Given all the binary logic operators of the original programming language, reimplement these operators for the new ''Ternary logic'' type '''trit'''.
* Generate a sampling of results using '''trit''' variables.
* [[wp:Kudos|Kudos]] for actually thinking up a test case algorithm where ''ternary logic'' is intrinsically useful, optimises the test case algorithm and is preferable to binary logic.

<br>
Note: &nbsp; '''[[wp:Setun|Setun]]''' &nbsp; (Сетунь) was a &nbsp; [[wp:balanced ternary|balanced ternary]] &nbsp; computer developed in 1958 at &nbsp; [[wp:Moscow State University|Moscow State University]]. &nbsp; The device was built under the lead of &nbsp; [[wp:Sergei Sobolev|Sergei Sobolev]] &nbsp; and &nbsp; [[wp:Nikolay Brusentsov|Nikolay Brusentsov]]. &nbsp; It was the only modern &nbsp; [[wp:ternary computer|ternary computer]], &nbsp; using three-valued [[wp:ternary logic|ternary logic]]
<br><br>

