Logic Reference Tables

The following describes a database containing information about logical functions.

From The Desk Of Matthew Kastor

On this Glorious Wednesday, October 23, 2013

Logical Reference Tables

The following describes a database containing information about logical functions.

Function numbers are used in the number column. Function numbers are generated by concatenating the results column of the truth table for the given function, with inputs arranged in ascending order when concatenated and taken as binary numbers (true = 1, false = 0). The least significant bit of the function number will be at the bottom right corner of the truth table. For example, the function number for AND is 0001 and it's truth table as described above appears as follows.

p q
Truth table for logical AND
0 0 0
0 1 0
1 0 0
1 1 1

Because the function numbers uniquely identify equivalent functions at the given arity, they can be a foreign key to the logical_expressions table. Using the number column will allow you to relate information between most tables.

The logic_symbols table is provided to allow looking up symbols, names, and html entities for a given name, symbol, or html entity. As each symbol is unique, the symbol column could be used as an index to this table.

Logic Symbols

This table lists logic symbols used in this database.

The logic_symbols table is provided to allow looking up symbols, names, and html entities for a given name, symbol, or html entity. As each symbol is unique, the symbol column could be used as an index to this table.

symbol html_code name number
logic_symbols
∧ conjunction 0001
⊥ contradiction 0000
↓ joint denial 1000
← converse implication 1011
↔ biconditional 1001
↚ converse nonimplication 0100
↮ exclusive disjunction 0110
¬ ¬ negation 10
↛ nonimplication 0010
∨ disjunction 0111
→ implication 1101
⊤ tautology 1111
↑ alternative denial 1110
= = identity 01

Logical Expressions

This table lists logical expressions. Unary functions take a single argument p. Binary functions take arguments p and q. Ternary functions take arguments p, q, and r. Each expression is to express unique functionality at the given arity. This ensures that each function number is unique and the column may be used as an index. The notes column is for notes about the expression, such as if it is in some standard form.

Because the function numbers uniquely identify equivalent functions at the given arity, they can be a foreign key to the logical_expressions table. Using the number column will allow you to relate information between most tables.

logical_expressions
expression number notes
0  
1  
00  
= 01  
¬ 10  
11  
0000  
0001  
0010  
p 0011  
0100  
q 0101  
0110  
0111  
1000  
1001  
¬q 1010  
1011  
¬p 1100  
1101  
1110  
1111  
(q → p) ∧ (¬q → r) 01000111  
(p ∧ q) ∨ (¬p ∧ r) 01010011  

Aliases

This table lists aliases for expressions. The name column is the alias and the number column is the logic expression number aliased.

aliases
name number
false 0
F 0
contradiction 0
Opq 0
true 1
T 1
tautology 1
Vpq 1
false 00
F 00
contradiction 00
Opq 00
identity 01
not 10
NOT 10
negation 10
true 11
T 11
tautology 11
Vpq 11
false 0000
F 0000
contradiction 0000
Opq 0000
AND 0001
conjunction 0001
Kpq 0001
material nonimplication 0010
nonimplication 0010
abdjunction 0010
Xp 0010
Lpq 0010
projection of p 0011
proposition p 0011
Ipq 0011
converse nonimplication 0100
converse material nonimplication 0100
Xq 0100
Mpq 0100
q 0101
projection of q 0101
proposition q 0101
Hpq 0101
XOR 0110
exclusive or 0110
exclusive disjunction 0110
Jpq 0110
OR 0111
disjunction 0111
Apq 0111
NOR 1000
joint denial 1000
Xpq 1000
XNOR 1001
exclusive NOR 1001
equality 1001
equals 1001
if and only if 1001
iff 1001
biconditional 1001
material biconditional 1001
material equivalence 1001
Epq 1001
Nq 1010
Gpq 1010
converse material implication 1011
converse implication 1011
XNq 1011
Bpq 1011
Np 1100
Fpq 1100
material implication 1101
material conditional 1101
material consequence 1101
implication 1101
implies 1101
conditional 1101
XNp 1101
Cpq 1101
NAND 1110
Dpq 1110
alternative denial 1110
true 1111
T 1111
tautology 1111
Vpq 1111
conditioned disjunction 01000111
then if else 01000111
conditioned disjunction 01010011
if then else 01010011

Prose

This table lists prose examples for logical functions. The prose column holds the prose example. The number column references the expression number.

prose number
prose
false 0
true 1
false 00
identify p 01
not p 10
true 11
false 0000
p and q 0001
p but not q 0010
p does not imply q 0010
if not q, follow p, else false 0010
identify p 0011
not p but q 0100
p is not implied by q 0100
if not p, follow q, else false 0100
identify q 0101
p or q but not both 0110
p or q 0111
neither p nor q 1000
p equals q 1001
not q 1010
p is implied by q 1011
either p, or not q 1011
not p 1100
p implies q 1101
either not p, or q 1101
either not p, or not q 1110
not p and q simultaneously 1110
true 1111
p if q, else r 01000111
if p, follow q, else r 01010011

JavaScript

JavaScript equvalents of logic expressions. The javascript column holds the javascript expression. The number column references the logic expression number. The notes column is for notes about the expression, such as if it is in some standard form.

javascript number notes
javascript
false 0  
true 1  
false 00  
p 01  
!p 10  
true 11  
false 0000  
p && q 0001  
p && !q 0010  
p 0011  
!p && q 0100  
q 0101  
(p || q) && (!(p && q)) 0110  
p || q 0111  
!(p || q) 1000  
!((p || q) && (!(p && q))) 1001  
!q 1010  
p || !q 1011  
!p 1100  
!p || q 1101  
!(p && q) 1110  
true 1111  
(!q || p) && (q || r) 01000111  
(p && q) || (!p && r) 01010011  

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.