<?xml version="1.0" encoding="ISO-8859-1" ?>
<?xml-stylesheet type="text/css" href="http://www.getwiki.net/styles/plug.css" ?>
<getwiki version="2.0" xml:lang="en">
  <page>
    <title>Logical_NAND</title>
    <revision>
      <timestamp>2007-04-07T18:54:55Z</timestamp>
      <contributor>
        <username>Jon Awbrey</username>
      </contributor>
      <comment>make cols</comment>
      <text>&lt;!--  via Wikinfo: 
      last updated: 20061129171610
      updated by: Jon Awbrey
      update comment: ndash
//--&gt;
&lt;!--  via Wikipedia: Logical NAND
      Revision as of 20:36, 11 September 2006 by Santiago Saint James
//--&gt;

'''Logical NAND''', for '''Not And''', sometimes denoted by a symbol &quot;|&quot; or &quot;&amp;#8593;&quot; called the Sheffer stroke, is a [[logical operation]] that is equivalent to the [[negation]] of the [[logical conjunction|conjunction]] operation, expressed in ordinary language as &quot;not both&quot;.  It is also called the '''alternative denial''', since it says in effect that at least one of its operands is false.  In [[boolean algebra]] and [[digital electronics]] it is known as the ''NAND'' (&quot;not and&quot;) operation.  It is one of several [[sole sufficient operator]]s that can be used to express all of the [[boolean function]]s that are the subject matter of [[propositional logic]].  Along with the [[logical NNOR]], it is one of the two [[functional completeness|functionally complete]] binary operators of propositional logic.

The name '''Sheffer stroke''' refers to [[Henry M. Sheffer]], who proved that all of the usual operators of propositional logic ([[negation|not]], [[logical conjunction|and]], [[logical disjunction|or]], [[logical implication|implies]], and so on), could be expressed in terms of it (Sheffer 1913).  [[Charles Sanders Peirce]] (1880) had discovered this fact more than 30 years earlier, but never published his finding.  Peirce also observed that all boolean operators could be defined in terms of the [[logical NNOR|NNOR]] operator, the dual of NAND.

==Definition==

The '''NAND operation''' is a [[logical operation]] on two [[logical value]]s, typically the values of two [[proposition]]s, that produces a value of ''false'' if and only if both of its operands are true.  In other words, it produces a value of ''true'' if and only if at least one of its operands is false.

The [[truth table]] of '''p NAND q''' (also written as '''p | q''' or '''p &amp;#8593; q''') is as follows:

{| align=&quot;center&quot; border=&quot;1&quot; cellpadding=&quot;8&quot; cellspacing=&quot;0&quot; style=&quot;background:lightcyan; font-weight:bold; text-align:center; width:45%&quot;
|+ '''Logical NAND'''
|- style=&quot;background:paleturquoise&quot;
! style=&quot;width:15%&quot; | p
! style=&quot;width:15%&quot; | q
! style=&quot;width:15%&quot; | p &amp;#8593; q
|-
| F || F || T
|-
| F || T || T
|-
| T || F || T
|-
| T || T || F
|}
&lt;br&gt;

One way of expressing ''p'' NAND ''q'' is a &lt;math&gt;\overline{p \cdot q}&lt;/math&gt;, where the symbol &lt;math&gt;\cdot&lt;/math&gt; signifies ''AND'' and the line over the expression signifies ''not'', the logical negation of that expression.

NAND is not used in everyday sentences because it exhibits an inherent inversion, which makes it confusing like a [[double negative]]. Here's an example of a sentence using the NAND operator:
:''We will surely die if we have food '''nand''' water.''

Expressed in terms of NAND, the usual operators of propositional logic are:
&lt;table&gt;
  &lt;tr&gt;
    &lt;td&gt;&quot;not ''p''&quot; is equivalent to &quot;''p'' NAND ''p''&quot;&lt;/td&gt;
    &lt;td&gt;&lt;math&gt;\overline{p} \equiv \overline{p \cdot p}&lt;/math&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;&quot;''p'' and ''q''&quot; is equivalent to &quot;(''p'' NAND ''q'') NAND (''p'' NAND ''q'')&quot;&lt;/td&gt;
    &lt;td&gt;&lt;math&gt;p \cdot q \equiv \overline{\overline{(p \cdot q)} \cdot \overline{(p \cdot q)}}&lt;/math&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;&quot;''p'' or ''q''&quot; is equivalent to &quot;(''p'' NAND ''p'') NAND (''q'' NAND ''q'')&quot;&lt;/td&gt;
    &lt;td&gt;&lt;math&gt;p + q \equiv \overline{\overline{(p \cdot p)} \cdot \overline{(q \cdot q)}}&lt;/math&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;&quot;''p'' implies ''q''&quot; is equivalent to &quot;(''p'' NAND ''q'') NAND ''p''&quot;&lt;/td&gt;
    &lt;td&gt;&lt;math&gt;p \rightarrow q \equiv \overline{\overline{(p \cdot q)} \cdot p}&lt;/math&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;

This leads to an alternative axiom system for [[Boolean algebra]]s, requiring but one operation.

[[Image:NandFullAdder.png|thumb|right|300px|NAND [[Full Adder]]]]

Digital systems employing certain logic circuits take advantage of this property. In complicated logical expressions, normally written in terms of other logic functions such as [[logical conjunction|AND]], [[logical disjunction|OR]], and [[negation|NOT]], writing these in terms of NAND saves on cost, because implementing such circuits using NAND gate yields a more compact result than the alternatives.

The dual of NAND, the operator NOR, also suffices to express all Boolean operations.

==Sheffer stroke==
The Sheffer stroke &quot;|&quot; is equivalent to the negation of conjunction:
:&lt;math&gt; A | B = \neg (A \wedge B). &lt;/math&gt;

The following truth table semantically defines |:

{| class=&quot;wikitable&quot;
! &lt;math&gt;|&lt;/math&gt;
! F
! T
|-
! F
| T
| T
|-
! T
| T
| F
|}

The other logical operators can be defined in terms of '|', like so:
:&lt;math&gt; \neg A = A | A, &lt;/math&gt;
:&lt;math&gt; A \wedge B = (A | B) | (A | B), &lt;/math&gt;
:&lt;math&gt; A \vee B = (A | A) | (B | B), &lt;/math&gt;
:&lt;math&gt; A \rightarrow B = A | (B | B) = A | (A | B). &lt;/math&gt;

==Formal system based on the Sheffer stroke==
The following is an example of a formal system based entirely on the Sheffer stroke, yet having the functional expressiveness of the [[propositional logic]]:

===1. Symbols===
A B C D E F G ' &lt;br&gt;
( | )

The Sheffer stroke commutes but does not associate. Hence any formal system including the Sheffer stroke must also include a means of indicating grouping. We shall employ '(' and ')' to this effect.

===2. Grammar===
The letters A, B, C, D, E, F and G are atoms. &lt;br&gt;
Any of these letters primed once or several times is also an atom (e.g. A', B&amp;#8242;&amp;#8242;, C&amp;#8242;&amp;#8242;&amp;#8242;, D&amp;#8242;&amp;#8242;&amp;#8242;&amp;#8242; are atoms). &lt;br&gt;

''Construction Rule I:'' An atom is a well-formed formula (''wff''). &lt;br&gt;

''Construction Rule II:'' If X and Y are wffs, then (X|Y) is a wff. &lt;br&gt;

''Closure Rule:'' Any formulae which cannot be constructed by means of the first two Construction Rules is not a wff.

The letters U, V, X, and Y are metavariables standing for wffs. 

A decision procedure for determining whether a formula is well-formed goes as follows: &quot;deconstruct&quot; the formula by applying the Construction Rules backwards, thereby breaking the formula into smaller subformulae. Then repeat this recursive deconstruction process to each of the subformulae. Eventually the formula should be reduced to its atoms, but if some subformula cannot be so reduced, then the formula is not a wff.

===3. Axiom===
The following ''wff''s are axiom schemata, which become axioms upon replacing all metavariables with ''wff''s.

''[[Frege's propositional calculus|THEN-1]]:'' (U|(U|(V|(U|U))))

===4. Inference rules===
''Substitution of equivalents''. Let the wff X contain one more instances of the subformula U. If U=V, then replacing one ore more instances of U in X by V does not alter the truth value of X. In particular, if X=Y is a theorem, this remains the case after any substitution of V for U.

''Commutativity:'' (X|Y) = (Y|X)&lt;br&gt;

''Duality:'' If strings of the forms X and (X|X) both show up in a theorem, then if these two strings are swapped wherever they appear in the theorem, then the result will also be a theorem.&lt;br&gt;

''Double Negation:'' ((X|X)|(X|X)) = X&lt;br&gt;

''Mimesis:'' (U|(X|X)) = (U|(U|X)) &lt;br&gt; 

''[[Frege's propositional calculus|THEN-3]]:''  (U|(U|(V|(V|X)))) = (V|(V|(U|(U|X))))

''MP-1:'' U, (U|(V|X)) |- V &lt;br&gt;

''MP-2:'' U, (U|(V|X)) |- X &lt;br&gt;

Note. The formula (U|(V|X)) has the interpretation U&amp;#8594;V&amp;#8743;X. [[Modus ponens]] is the special case of MP-1 and MP-2 when V and X are identical.

===Simplification===
Since the only connective of this logic is |, the symbol | could be discarded altogether, leaving only the parentheses to group the letters. A pair of parentheses must always enclose a pair of ''wff''s. Examples of theorems in this simplified notation are

: (A(A(B(B((AB)(AB)))))),

: (A(A((BB)(AA)))).

The resemblance to the syntax of [[LISP]] is evident.

The notation can be simplified further, by letting
: (U) := (UU)
: ((U)) &lt;math&gt;\equiv&lt;/math&gt; U
for any U.  This simplification causes the need to change some rules: (1) more than two letters are allowed within parentheses, (2) letters or wffs within parentheses are allowed to commute, (3) repeated letters or wffs within a same set of parentheses can be eliminated.  The result is a parenthetical version of the Peirce [[existential graph]]s.

==References==

* [[Charles Sanders Peirce|Peirce, C.S.]] (1880), &quot;A Boolean Algebra with One Constant&quot;, ''Collected Papers of Charles Sanders Peirce, Volume 4'', Charles Hartshorne and Paul Weiss (eds.), Harvard University Press, Cambridge, MA, 1931–1935.

* Sheffer, H.M. (1913), &quot;A Set of Five Independent Postulates for Boolean Algebras, with Application to Logical Constants&quot;, ''Transactions of the American Mathematical Society'' 14, 481–488.

==See also==

===Logical operators===

{|
|+ &amp;nbsp;
| valign=top |
* [[Exclusive disjunction]]
* [[Logical conjunction]]
* [[Logical disjunction]]
* [[Logical equality]]
| valign=top |
* [[Logical implication]]
* [[Logical NAND]]
* [[Logical NNOR]]
* [[Negation]]
|}

===Related topics===

{|
|+ &amp;nbsp;
| valign=top |
* [[Ampheck]]
* [[Boolean algebra]]
* [[Boolean domain]]
* [[Boolean function]]
| valign=top |
* [[Boolean logic]]
* [[Laws of Form]]
* [[Logic gate]]
* [[Logical graph]]
| valign=top |
* [[Peirce's law]]
* [[Propositional calculus]]
* [[Sole sufficient operator]]
* [[Zeroth order logic]]
|}

----

&lt;!--  NOTE TO EDITORS: 
Per the GNU Free Documentation License, please include the live link below to the adapted Wikinfo article:
//--&gt;

''Some content adapted from the [[Wikinfo]] article &quot;[http://getwiki.net/url.php?wikinfo=Logical_NAND Logical NAND]&quot; under the [[GNU Free Documentation License]].''

[[de:NAND-Gatter]]
[[he:NAND &amp;#1500;&amp;#1493;&amp;#1490;&amp;#1497;]]
[[nl:NAND-poort]]
[[no:Eksklusjon (logikk)]]
[[pl:NAND]]
[[tr:VEDE&amp;#286;&amp;#304;L kap&amp;#305;s&amp;#305;]]</text>
    </revision>
  </page>
</getwiki>
