Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Propositional formula
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== CASE connective: IF ... THEN ... ELSE ... === The IF ... THEN ... ELSE ... connective appears as the simplest form of CASE operator of [[recursion theory]] and [[computation theory]] and is the connective responsible for conditional goto's (jumps, branches). From this one connective all other connectives can be constructed (see more below). Although " IF c THEN b ELSE a " sounds like an implication it is, in its most reduced form, a switch that makes a decision and offers as outcome only one of two alternatives "a" or "b" (hence the name [[switch statement]] in the [[C (programming language)|C]] programming language).<ref>A careful look at its Karnaugh map shows that IF...THEN...ELSE can also be expressed, in a rather round-about way, in terms of two exclusive-ORs: ( (b AND (c XOR a)) OR (a AND (c XOR b)) ) = d.</ref> The following three propositions are equivalent (as indicated by the logical equivalence sign ≡ ): # ( IF 'counter is zero' THEN 'go to instruction ''b'' ' ELSE 'go to instruction ''a'' ') ≡ # ( (c → b) & (~c → a) ) ≡ ( ( IF 'counter is zero' THEN 'go to instruction ''b'' ' ) AND ( IF 'It is NOT the case that counter is zero' THEN 'go to instruction ''a'' ) " ≡ # ( (c & b) ∨ (~c & a) ) ≡ " ( 'Counter is zero' AND 'go to instruction ''b'' ) OR ( 'It is NOT the case that 'counter is zero' AND 'go to instruction ''a'' ) " Thus IF ... THEN ... ELSE—unlike implication—does not evaluate to an ambiguous "TRUTH" when the first proposition is false i.e. c = F in (c → b). For example, most people would reject the following compound proposition as a nonsensical ''non sequitur'' because the second sentence is ''not connected in meaning'' to the first.<ref>Robbin p. 3.</ref> : Example: The proposition " IF 'Winston Churchill was Chinese' THEN 'The sun rises in the east' " evaluates as a TRUTH given that 'Winston Churchill was Chinese' is a FALSEHOOD and 'The sun rises in the east' evaluates as a TRUTH. In recognition of this problem, the sign → of formal implication in the propositional calculus is called [[material conditional|material implication]] to distinguish it from the everyday, intuitive implication.{{efn|Rosenbloom discusses this problem of implication at some length. Most philosophers and mathematicians just accept the material definition as given above. But some do not, including the [[Intuitionism|intuitionists]]; they consider it a form of the law of excluded middle misapplied.{{sfn|Rosenbloom|1950|pp=30 and 54ff}}}} The use of the IF ... THEN ... ELSE construction avoids controversy because it offers a completely deterministic choice between two stated alternatives; it offers two "objects" (the two alternatives b and a), and it ''selects'' between them exhaustively and unambiguously.<ref>Indeed, exhaustive selection between alternatives -- '''mutual exclusion''' -- is required by the definition that Kleene gives the CASE operator (Kleene 1952229)</ref> In the truth table below, d1 is the formula: ( (IF c THEN b) AND (IF NOT-c THEN a) ). Its fully reduced form d2 is the formula: ( (c AND b) OR (NOT-c AND a). The two formulas are equivalent as shown by the columns "=d1" and "=d2". Electrical engineers call the fully reduced formula the AND-OR-SELECT operator. The CASE (or SWITCH) operator is an extension of the same idea to ''n'' possible, but mutually exclusive outcomes. Electrical engineers call the CASE operator a [[multiplexer]]. {| |- style="font-size:9pt" align="center" | width="27.75" Height="12" | | width="20.25" | | width="18.75" | | width="18.75" | | width="6.75" | | width="12.75" | | width="12.75" | | width="12.75" | | width="16.5" | | width="12.75" | | width="12.75" | |style="background-color:#FDE9D9" width="17.25" | d1 | width="12.75" | | width="12.75" | | width="12.75" | | width="12.75" | | width="12.75" | | width="18" | | width="12.75" | | width="12.75" | | width="12.75" | | width="24.75" | | width="5.25" | | width="12.75" | | width="12.75" | | width="12.75" | | width="12.75" | | width="12.75" | | width="12.75" | |style="background-color:#FDE9D9" width="15.75" | d2 | width="12.75" | | width="12.75" | | width="12.75" | | width="12.75" | | width="12.75" | | width="12.75" | | width="12.75" | | width="12.75" | | width="12.75" | | width="27" | |- style="font-size:9pt;font-weight:bold" align="center" !style="background-color:#F2F2F2" Height="12" | row ! c ! b ! a |style="background-color:#A5A5A5" | | ( | ( | c | → | b | ) |style="background-color:#FDE9D9" | & | ( |style="background-color:#EAF1DD" | ~ | ( | c | ) | → | a | ) | ) |style="background-color:#FDE9D9" | =d1 |style="background-color:#A5A5A5" | | ( | ( | c |style="background-color:#DBEEF3" | & | b | ) |style="background-color:#FDE9D9" | ∨ | ( |style="background-color:#EAF1DD" | ~ | ( | c | ) |style="background-color:#DBE5F1" | & | a | ) | ) |style="background-color:#FDE9D9" | =d2 |- style="font-size:9pt" align="center" |style="background-color:#F2F2F2" Height="12" | 0 | 0 | 0 |style="background-color:#C5D9F1" | 0 |style="background-color:#A5A5A5" | | | | 0 | 1 | 0 | |style="background-color:#B8CCE4" | 0 | | 1 | | 0 | |style="background-color:#B8CCE4" | 0 |style="background-color:#B8CCE4" | 0 | | |style="background-color:#B8CCE4" | 0 |style="background-color:#A5A5A5" | | | | 0 | 0 | 0 | |style="background-color:#B8CCE4" | 0 | | 1 | | 0 | |style="background-color:#B8CCE4" | 0 |style="background-color:#B8CCE4" | 0 | | |style="background-color:#B8CCE4" | 0 |- style="font-size:9pt" align="center" |style="background-color:#F2F2F2" Height="12" | 1 | 0 | 0 |style="background-color:#C5D9F1" | 1 |style="background-color:#A5A5A5" | | | | 0 | 1 | 0 | |style="background-color:#B8CCE4" | 1 | | 1 | | 0 | |style="background-color:#B8CCE4" | 1 |style="background-color:#B8CCE4" | 1 | | |style="background-color:#B8CCE4" | 1 |style="background-color:#A5A5A5" | | | | 0 | 0 | 0 | |style="background-color:#B8CCE4" | 1 | | 1 | | 0 | |style="background-color:#B8CCE4" | 1 |style="background-color:#B8CCE4" | 1 | | |style="background-color:#B8CCE4" | 1 |- style="font-size:9pt" align="center" |style="background-color:#F2F2F2" Height="12" | 2 | 0 | 1 |style="background-color:#C5D9F1" | 0 |style="background-color:#A5A5A5" | | | | 0 | 1 | 1 | |style="background-color:#B8CCE4" | 0 | | 1 | | 0 | |style="background-color:#B8CCE4" | 0 |style="background-color:#B8CCE4" | 0 | | |style="background-color:#B8CCE4" | 0 |style="background-color:#A5A5A5" | | | | 0 | 0 | 1 | |style="background-color:#B8CCE4" | 0 | | 1 | | 0 | |style="background-color:#B8CCE4" | 0 |style="background-color:#B8CCE4" | 0 | | |style="background-color:#B8CCE4" | 0 |- style="font-size:9pt" align="center" |style="background-color:#F2F2F2" Height="12" | 3 | 0 | 1 |style="background-color:#C5D9F1" | 1 |style="background-color:#A5A5A5" | | | | 0 | 1 | 1 | |style="background-color:#B8CCE4" | 1 | | 1 | | 0 | |style="background-color:#B8CCE4" | 1 |style="background-color:#B8CCE4" | 1 | | |style="background-color:#B8CCE4" | 1 |style="background-color:#A5A5A5" | | | | 0 | 0 | 1 | |style="background-color:#B8CCE4" | 1 | | 1 | | 0 | |style="background-color:#B8CCE4" | 1 |style="background-color:#B8CCE4" | 1 | | |style="background-color:#B8CCE4" | 1 |- style="font-size:9pt" align="center" |style="background-color:#F2F2F2" Height="12" | 4 | 1 |style="background-color:#DBEEF3" | 0 | 0 |style="background-color:#A5A5A5" | | | | 1 |style="background-color:#DBEEF3" | 0 |style="background-color:#DBEEF3" | 0 | |style="background-color:#DBEEF3" | 0 | | 0 | | 1 | | 1 | 0 | | |style="background-color:#DBEEF3" | 0 |style="background-color:#A5A5A5" | | | | 1 |style="background-color:#DBEEF3" | 0 |style="background-color:#DBEEF3" | 0 | |style="background-color:#DBEEF3" | 0 | | 0 | | 1 | | 0 | 0 | | |style="background-color:#DBEEF3" | 0 |- style="font-size:9pt" align="center" |style="background-color:#F2F2F2" Height="12" | 5 | 1 |style="background-color:#DBEEF3" | 0 | 1 |style="background-color:#A5A5A5" | | | | 1 |style="background-color:#DBEEF3" | 0 |style="background-color:#DBEEF3" | 0 | |style="background-color:#DBEEF3" | 0 | | 0 | | 1 | | 1 | 1 | | |style="background-color:#DBEEF3" | 0 |style="background-color:#A5A5A5" | | | | 1 |style="background-color:#DBEEF3" | 0 |style="background-color:#DBEEF3" | 0 | |style="background-color:#DBEEF3" | 0 | | 0 | | 1 | | 0 | 1 | | |style="background-color:#DBEEF3" | 0 |- style="font-size:9pt" align="center" |style="background-color:#F2F2F2" Height="12" | 6 | 1 |style="background-color:#DBEEF3" | 1 | 0 |style="background-color:#A5A5A5" | | | | 1 |style="background-color:#DBEEF3" | 1 |style="background-color:#DBEEF3" | 1 | |style="background-color:#DBEEF3" | 1 | | 0 | | 1 | | 1 | 0 | | |style="background-color:#DBEEF3" | 1 |style="background-color:#A5A5A5" | | | | 1 |style="background-color:#DBEEF3" | 1 |style="background-color:#DBEEF3" | 1 | |style="background-color:#DBEEF3" | 1 | | 0 | | 1 | | 0 | 0 | | |style="background-color:#DBEEF3" | 1 |- style="font-size:9pt" align="center" |style="background-color:#F2F2F2" Height="12" | 7 | 1 |style="background-color:#DBEEF3" | 1 | 1 |style="background-color:#A5A5A5" | | | | 1 |style="background-color:#DBEEF3" | 1 |style="background-color:#DBEEF3" | 1 | |style="background-color:#DBEEF3" | 1 | | 0 | | 1 | | 1 | 1 | | |style="background-color:#DBEEF3" | 1 |style="background-color:#A5A5A5" | | | | 1 |style="background-color:#DBEEF3" | 1 |style="background-color:#DBEEF3" | 1 | |style="background-color:#DBEEF3" | 1 | | 0 | | 1 | | 0 | 1 | | |style="background-color:#DBEEF3" | 1 |}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)