
I would like to know if all 16 possible functions that accept two boolean arguments have names in First-Order Logic. I know they have Haskell function names (e.g. \p -> \_ -> id p, \_ -> \_ -> const True), but I'm hoping there is a more general name that is recognised by anyone with a feel for logic, but not necessarily Haskell. I have listed all sixteen of these functions below using Haskell (named a to p) along with the name of those that I am aware of having a name as a comment. Thanks for any tips. {- p q | a b c d e f g h i j k l m n o p 0 0 | 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 1 | 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 1 0 | 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 1 1 | 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 -} a :: Bool -> Bool -> Bool a _ _ = False b :: Bool -> Bool -> Bool -- conjunction AND b False _ = False b _ q = q c :: Bool -> Bool -> Bool c False _ = False c _ q = not q d :: Bool -> Bool -> Bool d p _ = p e :: Bool -> Bool -> Bool e False q = q e _ _ = False f :: Bool -> Bool -> Bool f _ q = q g :: Bool -> Bool -> Bool -- exclusive disjunction XOR g False q = q g _ q = not q h :: Bool -> Bool -> Bool -- disjunction OR h False False = False h _ _ = True i :: Bool -> Bool -> Bool -- negation of disjunction NOR i False False = True i _ _ = False j :: Bool -> Bool -> Bool -- biconditional j False q = not q j _ q = q k :: Bool -> Bool -> Bool k _ q = not q l :: Bool -> Bool -> Bool l False q = not q l _ _ = True m :: Bool -> Bool -> Bool m p _ = not p n :: Bool -> Bool -> Bool -- implication n False _ = True n _ q = q o :: Bool -> Bool -> Bool -- negation of conjunction NAND o False _ = True o _ q = not q p :: Bool -> Bool -> Bool p _ _ = True -- Tony Morris http://tmorris.net/

On Tue, Jun 05, 2007 at 02:41:48PM +1000, Tony Morris wrote:
I would like to know if all 16 possible functions that accept two boolean arguments have names in First-Order Logic. I know they have Haskell function names (e.g. \p -> \_ -> id p, \_ -> \_ -> const True), but I'm hoping there is a more general name that is recognised by anyone with a feel for logic, but not necessarily Haskell.
There are way more than 16, if you count partial and lazy functions.
I have listed all sixteen of these functions below using Haskell (named a to p) along with the name of those that I am aware of having a name as a comment.
Thanks for any tips.
{-
p q | a b c d e f g h i j k l m n o p 0 0 | 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 1 | 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 1 0 | 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 1 1 | 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
-}
I see P/Q notation used a lot
c :: Bool -> Bool -> Bool c False _ = False c _ q = not q
P∧¬Q Also AND-NOT, commonly seen in electronics circles as it is the logic function performed by a single transistor Stefan

On Tue, 2007-06-05 at 14:41 +1000, Tony Morris wrote:
I would like to know if all 16 possible functions that accept two boolean arguments have names in First-Order Logic. I know they have Haskell function names (e.g. \p -> \_ -> id p, \_ -> \_ -> const True), but I'm hoping there is a more general name that is recognised by anyone with a feel for logic, but not necessarily Haskell.
I have listed all sixteen of these functions below using Haskell (named a to p) along with the name of those that I am aware of having a name as a comment.
Thanks for any tips.
{-
p q | a b c d e f g h i j k l m n o p 0 0 | 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 1 | 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 1 0 | 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 1 1 | 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
-}
The best I've been able to come up with is names and connective phrases for pronunciation for twelve. I suspect that not enough people have found a use for the others to warrant specific terms. In the table below I've listed the twelve with name, phrase and corresponding column of your table. I've expressed the phrases in the form "P <phrase> Q" to indicate (rough) pronunciation. Name Connective Table Column ---------------------------------------------------------------- Conjunction P and Q b Inclusive Disjunction P or Q h Exclusive Disjunction P exclusive or Q g Conditional P only if Q n Biconditional P if and only if Q j Sheffer Stroke P stroke (nand) Q o Sheffer Slash P slash (nor) Q i Inverse Conditional P if Q l Tautology True p Inconsistency False a Negative Conditional P but not Q c Negative Inverse Conditional Q but not P e As you can see from the table, Tautology and Inconsistency are rarely if ever used as connectives. I checked these in Carol Horn Greenstein, _Dictionary of Logical Terms and Symbols_, Van Nostrand Reinhold Company, 1978. -- Bill Wood

Hi,
On Tue, 2007-06-05 at 14:41 +1000, Tony Morris wrote:
I would like to know if all 16 possible functions that accept two boolean arguments have names in First-Order Logic. I know they have Haskell function names (e.g. \p -> \_ -> id p, \_ -> \_ -> const True), but I'm hoping there is a more general name that is recognised by anyone with a feel for logic, but not necessarily Haskell.
I have listed all sixteen of these functions below using Haskell (named a to p) along with the name of those that I am aware of having a name as a comment.
Thanks for any tips.
{-
p q | a b c d e f g h i j k l m n o p 0 0 | 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 1 | 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 1 0 | 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 1 1 | 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
-}
The best I've been able to come up with is names and connective phrases for pronunciation for twelve. I suspect that not enough people have found a use for the others to warrant specific terms.
In the table below I've listed the twelve with name, phrase and corresponding column of your table. I've expressed the phrases in the form "P <phrase> Q" to indicate (rough) pronunciation.
Name Connective Table Column ---------------------------------------------------------------- Conjunction P and Q b Inclusive Disjunction P or Q h Exclusive Disjunction P exclusive or Q g Conditional P only if Q n Biconditional P if and only if Q j Sheffer Stroke P stroke (nand) Q o Sheffer Slash P slash (nor) Q i Inverse Conditional P if Q l Tautology True p Inconsistency False a Negative Conditional P but not Q c Negative Inverse Conditional Q but not P e
As you can see from the table, Tautology and Inconsistency are rarely if ever used as connectives.
I checked these in Carol Horn Greenstein, _Dictionary of Logical Terms and Symbols_, Van Nostrand Reinhold Company, 1978. There is also a list already in Ludwig Wittgenstein, Tractatus Logico-Philosophicus, 5.101, which I think is the 'locus classicus' :-)
Ciao, Leif
-- Bill Wood
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

On Tue, 05 Jun 2007, at 00:41, Tony Morris wrote:
I would like to know if all 16 possible functions that accept two boolean arguments have names in First-Order Logic. I know they have Haskell function names (e.g. \p -> \_ -> id p, \_ -> \_ -> const True), but I'm hoping there is a more general name that is recognised by anyone with a feel for logic, but not necessarily Haskell.
I have listed all sixteen of these functions below using Haskell (named a to p) along with the name of those that I am aware of having a name as a comment.
Thanks for any tips.
{-
p q | a b c d e f g h i j k l m n o p 0 0 | 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 1 | 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 1 0 | 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 1 1 | 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
-}
Common Lisp has names for them. See: http://www.cs.cmu.edu/Groups/AI/html/cltl/clm/ node131.html#SECTION001670000000000000000 and then search for (boole boole-and x y) == (logand x y) and look at the table just before that. ---Frank
participants (5)
-
Bill Wood
-
Frank Seaton Taylor
-
Leif Frenzel
-
Stefan O'Rear
-
Tony Morris