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!
=== Reduction by use of the map method (Veitch, Karnaugh) === Veitch improved the notion of [[Venn diagram]]s by converting the circles to abutting squares, and Karnaugh simplified the Veitch diagram by converting the minterms, written in their literal-form (e.g. ~abc~d) into numbers.<ref>Wickes 1967:36ff. Wickes offers a good example of 8 of the 2 x 4 (3-variable maps) and 16 of the 4 x 4 (4-variable) maps. As an arbitrary 3-variable map could represent any one of 2<sup>8</sup>=256 2x4 maps, and an arbitrary 4-variable map could represent any one of 2<sup>16</sup> = 65,536 different formula-evaluations, writing down every one is infeasible.</ref> The method proceeds as follows: ==== Produce the formula's truth table ==== Produce the formula's truth table. Number its rows using the binary-equivalents of the variables (usually just sequentially 0 through n-1) for n variables. : ''Technically, the [[propositional function]] has been reduced to its (unminimized) conjunctive normal form: each row has its minterm expression and these can be OR'd to produce the formula in its (unminimized) conjunctive normal form.'' Example: ((c & d) ∨ (p & ~(c & (~d)))) = q in conjunctive normal form is: ::: ( (~p & d & c ) ∨ (p & d & c) ∨ (p & d & ~c) ∨ (p & ~d & ~c) ) = q However, this formula be reduced both in the number of terms (from 4 to 3) and in the total count of its literals (12 to 6). {| |- style="font-size:9pt;font-weight:bold" align="center" !style="background-color:#F2F2F2" width="25.5" Height="24" | row ! Minterms ! width="21" | p ! width="21" | d ! width="21" | c ! width="10.5" | ( ! width="10.5" | ( ! width="10.5" | c ! width="10.5" | & ! width="10.5" | d ! width="10.5" | ) !style="background-color:#FDE9D9" width="10.5" | ∨ ! width="10.5" | ( ! width="10.5" | p ! width="10.5" | & ! width="10.5" | ~ ! width="10.5" | ( ! width="10.5" | ( ! width="10.5" | c ! width="10.5" | & ! width="10.5" | ~ ! width="10.5" | ( ! width="10.5" | d ! width="10.5" | ) ! width="10.5" | ) ! width="10.5" | ) ! width="10.5" | ) ! width="10.5" | ) ! {{Active}} minterms ! Formula in conjunctive normal form |- style="font-size:9pt" |style="background-color:#F2F2F2;font-weight:bold" Height="12" align="center" valign="bottom" | 0 | align="center" valign="bottom" | ( ~p & ~d & ~c ) | align="center" valign="bottom" | 0 | align="center" valign="bottom" | 0 | align="center" valign="bottom" | 0 | align="center" valign="bottom" | | align="center" valign="bottom" | | align="center" valign="bottom" | 0 |style="background-color:#DBE5F1" align="center" valign="bottom" | 0 | align="center" valign="bottom" | 0 | align="center" valign="bottom" | |style="background-color:#FDE9D9" align="center" valign="bottom" | 0 | align="center" valign="bottom" | | align="center" valign="bottom" | 0 |style="background-color:#DBE5F1" align="center" valign="bottom" | 0 |style="background-color:#EAF1DD" align="center" valign="bottom" | 1 | align="center" valign="bottom" | | align="center" valign="bottom" | | align="center" valign="bottom" | 0 |style="background-color:#DBE5F1" align="center" valign="bottom" | 0 |style="background-color:#EAF1DD" align="center" valign="bottom" | 1 | align="center" valign="bottom" | | align="center" valign="bottom" | 0 | align="center" valign="bottom" | | align="center" valign="bottom" | | align="center" valign="bottom" | | align="center" valign="bottom" | | align="center" valign="bottom" | | valign="bottom" | | valign="bottom" | |- style="font-size:9pt" |style="background-color:#F2F2F2;font-weight:bold" Height="12" align="center" valign="bottom" | 1 | align="center" valign="bottom" | ( ~p & ~d & c) | align="center" valign="bottom" | 0 | align="center" valign="bottom" | 0 | align="center" valign="bottom" | 1 | align="center" valign="bottom" | | align="center" valign="bottom" | | align="center" valign="bottom" | 1 |style="background-color:#DBE5F1" align="center" valign="bottom" | 0 | align="center" valign="bottom" | 0 | align="center" valign="bottom" | |style="background-color:#FDE9D9" align="center" valign="bottom" | 0 | align="center" valign="bottom" | | align="center" valign="bottom" | 0 |style="background-color:#DBE5F1" align="center" valign="bottom" | 0 |style="background-color:#EAF1DD" align="center" valign="bottom" | 0 | align="center" valign="bottom" | | align="center" valign="bottom" | | align="center" valign="bottom" | 1 |style="background-color:#DBE5F1" align="center" valign="bottom" | 1 |style="background-color:#EAF1DD" align="center" valign="bottom" | 1 | align="center" valign="bottom" | | align="center" valign="bottom" | 0 | align="center" valign="bottom" | | align="center" valign="bottom" | | align="center" valign="bottom" | | align="center" valign="bottom" | | align="center" valign="bottom" | | valign="bottom" | | valign="bottom" | |- style="font-size:9pt" |style="background-color:#F2F2F2;font-weight:bold" Height="12" align="center" valign="bottom" | 2 | align="center" valign="bottom" | ( ~p & d & ~c ) | align="center" valign="bottom" | 0 | align="center" valign="bottom" | 1 | align="center" valign="bottom" | 0 | align="center" valign="bottom" | | align="center" valign="bottom" | | align="center" valign="bottom" | 0 |style="background-color:#DBE5F1" align="center" valign="bottom" | 0 | align="center" valign="bottom" | 1 | align="center" valign="bottom" | |style="background-color:#FDE9D9" align="center" valign="bottom" | 0 | align="center" valign="bottom" | | align="center" valign="bottom" | 0 |style="background-color:#DBE5F1" align="center" valign="bottom" | 0 |style="background-color:#EAF1DD" align="center" valign="bottom" | 1 | align="center" valign="bottom" | | align="center" valign="bottom" | | align="center" valign="bottom" | 0 |style="background-color:#DBE5F1" align="center" valign="bottom" | 0 |style="background-color:#EAF1DD" align="center" valign="bottom" | 0 | align="center" valign="bottom" | | align="center" valign="bottom" | 1 | align="center" valign="bottom" | | align="center" valign="bottom" | | align="center" valign="bottom" | | align="center" valign="bottom" | | align="center" valign="bottom" | | valign="bottom" | | valign="bottom" | |- style="font-size:9pt" |style="background-color:#F2F2F2;font-weight:bold" Height="12" align="center" valign="bottom" | 3 | align="center" valign="bottom" | ( ~p & d & c ) | align="center" valign="bottom" | 0 | align="center" valign="bottom" | 1 | align="center" valign="bottom" | 1 | align="center" valign="bottom" | | align="center" valign="bottom" | | align="center" valign="bottom" | 1 |style="background-color:#DBE5F1" align="center" valign="bottom" | 1 | align="center" valign="bottom" | 1 | align="center" valign="bottom" | |style="background-color:#FCD5B4" align="center" valign="bottom" | 1 | align="center" valign="bottom" | | align="center" valign="bottom" | 0 |style="background-color:#DBE5F1" align="center" valign="bottom" | 0 |style="background-color:#EAF1DD" align="center" valign="bottom" | 1 | align="center" valign="bottom" | | align="center" valign="bottom" | | align="center" valign="bottom" | 1 |style="background-color:#DBE5F1" align="center" valign="bottom" | 0 |style="background-color:#EAF1DD" align="center" valign="bottom" | 0 | align="center" valign="bottom" | | align="center" valign="bottom" | 1 | align="center" valign="bottom" | | align="center" valign="bottom" | | align="center" valign="bottom" | | align="center" valign="bottom" | | align="center" valign="bottom" | |style="background-color:#FCD5B4" align="center" | (~p & d & c) | valign="bottom" | |- style="font-size:9pt" |style="background-color:#F2F2F2;font-weight:bold" Height="12" align="center" valign="bottom" | 4 | align="center" valign="bottom" | ( p & ~d & ~c ) | align="center" valign="bottom" | 1 | align="center" valign="bottom" | 0 | align="center" valign="bottom" | 0 | align="center" valign="bottom" | | align="center" valign="bottom" | | align="center" valign="bottom" | 0 |style="background-color:#DBE5F1" align="center" valign="bottom" | 0 | align="center" valign="bottom" | 0 | align="center" valign="bottom" | |style="background-color:#FCD5B4" align="center" valign="bottom" | 1 | align="center" valign="bottom" | | align="center" valign="bottom" | 1 |style="background-color:#DBE5F1" align="center" valign="bottom" | 1 |style="background-color:#EAF1DD" align="center" valign="bottom" | 1 | align="center" valign="bottom" | | align="center" valign="bottom" | | align="center" valign="bottom" | 0 |style="background-color:#DBE5F1" align="center" valign="bottom" | 0 |style="background-color:#EAF1DD" align="center" valign="bottom" | 1 | align="center" valign="bottom" | | align="center" valign="bottom" | 0 | align="center" valign="bottom" | | align="center" valign="bottom" | | align="center" valign="bottom" | | align="center" valign="bottom" | | align="center" valign="bottom" | |style="background-color:#FCD5B4" align="center" | (~p & d & c) | valign="bottom" | |- style="font-size:9pt" |style="background-color:#F2F2F2;font-weight:bold" Height="12" align="center" valign="bottom" | 5 | align="center" valign="bottom" | ( p & ~d & c ) | align="center" valign="bottom" | 1 | align="center" valign="bottom" | 0 | align="center" valign="bottom" | 1 | align="center" valign="bottom" | | align="center" valign="bottom" | | align="center" valign="bottom" | 1 |style="background-color:#DBE5F1" align="center" valign="bottom" | 0 | align="center" valign="bottom" | 0 | align="center" valign="bottom" | |style="background-color:#FDE9D9" align="center" valign="bottom" | 0 | align="center" valign="bottom" | | align="center" valign="bottom" | 1 |style="background-color:#DBE5F1" align="center" valign="bottom" | 0 |style="background-color:#EAF1DD" align="center" valign="bottom" | 0 | align="center" valign="bottom" | | align="center" valign="bottom" | | align="center" valign="bottom" | 1 |style="background-color:#DBE5F1" align="center" valign="bottom" | 1 |style="background-color:#EAF1DD" align="center" valign="bottom" | 1 | align="center" valign="bottom" | | align="center" valign="bottom" | 0 | align="center" valign="bottom" | | align="center" valign="bottom" | | align="center" valign="bottom" | | align="center" valign="bottom" | | align="center" valign="bottom" | | align="center" | | valign="bottom" | |- style="font-size:9pt" |style="background-color:#F2F2F2;font-weight:bold" Height="12" align="center" valign="bottom" | 6 | align="center" valign="bottom" | ( p & d & ~c ) | align="center" valign="bottom" | 1 | align="center" valign="bottom" | 1 | align="center" valign="bottom" | 0 | align="center" valign="bottom" | | align="center" valign="bottom" | | align="center" valign="bottom" | 0 |style="background-color:#DBE5F1" align="center" valign="bottom" | 0 | align="center" valign="bottom" | 1 | align="center" valign="bottom" | |style="background-color:#FCD5B4" align="center" valign="bottom" | 1 | align="center" valign="bottom" | | align="center" valign="bottom" | 1 |style="background-color:#DBE5F1" align="center" valign="bottom" | 1 |style="background-color:#EAF1DD" align="center" valign="bottom" | 1 | align="center" valign="bottom" | | align="center" valign="bottom" | | align="center" valign="bottom" | 0 |style="background-color:#DBE5F1" align="center" valign="bottom" | 0 |style="background-color:#EAF1DD" align="center" valign="bottom" | 0 | align="center" valign="bottom" | | align="center" valign="bottom" | 1 | align="center" valign="bottom" | | align="center" valign="bottom" | | align="center" valign="bottom" | | align="center" valign="bottom" | | align="center" valign="bottom" | |style="background-color:#FCD5B4" align="center" | (p & d & ~c) | valign="bottom" | |- style="font-size:9pt" |style="background-color:#F2F2F2;font-weight:bold" Height="12" align="center" valign="bottom" | 7 | align="center" valign="bottom" | ( p & d & c ) | align="center" valign="bottom" | 1 | align="center" valign="bottom" | 1 | align="center" valign="bottom" | 1 | align="center" valign="bottom" | | align="center" valign="bottom" | | align="center" valign="bottom" | 0 |style="background-color:#DBE5F1" align="center" valign="bottom" | 1 | align="center" valign="bottom" | 1 | align="center" valign="bottom" | |style="background-color:#FCD5B4" align="center" valign="bottom" | 1 | align="center" valign="bottom" | | align="center" valign="bottom" | 1 |style="background-color:#DBE5F1" align="center" valign="bottom" | 1 |style="background-color:#EAF1DD" align="center" valign="bottom" | 1 | align="center" valign="bottom" | | align="center" valign="bottom" | | align="center" valign="bottom" | 1 |style="background-color:#DBE5F1" align="center" valign="bottom" | 0 |style="background-color:#EAF1DD" align="center" valign="bottom" | 0 | align="center" valign="bottom" | | align="center" valign="bottom" | 1 | align="center" valign="bottom" | | align="center" valign="bottom" | | align="center" valign="bottom" | | align="center" valign="bottom" | | align="center" valign="bottom" | |style="background-color:#FCD5B4" align="center" | ( p & d & c ) | valign="bottom" | |- style="font-size:9pt" | Height="16.5" valign="bottom" | | align="center" valign="bottom" | | valign="bottom" | | valign="bottom" | | valign="bottom" | | valign="bottom" | | valign="bottom" | | valign="bottom" | | valign="bottom" | | valign="bottom" | | valign="bottom" | |style="background-color:#FFA7A9;font-weight:bold" align="center" | q | valign="bottom" | | valign="bottom" | | valign="bottom" | | valign="bottom" | | valign="bottom" | | valign="bottom" | | valign="bottom" | | valign="bottom" | | valign="bottom" | | valign="bottom" | | valign="bottom" | | valign="bottom" | | valign="bottom" | | valign="bottom" | | valign="bottom" | | valign="bottom" | | valign="bottom" | |style="background-color:#FFA7A9" align="center" | = (~p&d&c) ∨ (~p&d&c) ∨ (p&d&~c ) ∨ (p&d&c ) |} ==== Create the formula's Karnaugh map ==== [[File:Propositional formula maps 2.png|400px|thumb|right| Steps in the reduction using a Karnaugh map. The final result is the OR (logical "sum") of the three reduced terms.]] Use the values of the formula (e.g. "p") found by the truth-table method and place them in their into their respective (associated) Karnaugh squares (these are numbered per the Gray code convention). If values of "d" for "don't care" appear in the table, this adds flexibility during the reduction phase. ==== Reduce minterms ==== Minterms of adjacent (abutting) 1-squares (T-squares) can be reduced with respect to the number of their [[literal (mathematical logic)|literal]]s, and the number terms also will be reduced in the process. Two abutting squares (2 x 1 horizontal or 1 x 2 vertical, even the edges represent abutting squares) lose one literal, four squares in a 4 x 1 rectangle (horizontal or vertical) or 2 x 2 square (even the four corners represent abutting squares) lose two literals, eight squares in a rectangle lose 3 literals, etc. (One seeks out the largest square or rectangles and ignores the smaller squares or rectangles contained totally within it. ) This process continues until all abutting squares are accounted for, at which point the propositional formula is minimized. For example, squares #3 and #7 abut. These two abutting squares can lose one literal (e.g. "p" from squares #3 and #7), four squares in a rectangle or square lose two literals, eight squares in a rectangle lose 3 literals, etc. (One seeks out the largest square or rectangles.) This process continues until all abutting squares are accounted for, at which point the propositional formula is said to be minimized. Example: The map method usually is done by inspection. The following example expands the algebraic method to show the "trick" behind the combining of terms on a Karnaugh map: : Minterms #3 and #7 abut, #7 and #6 abut, and #4 and #6 abut (because the table's edges wrap around). So each of these pairs can be reduced. Observe that by the Idempotency law (A ∨ A) = A, we can create more terms. Then by association and distributive laws the variables to disappear can be paired, and then "disappeared" with the Law of contradiction (x & ~x)=0. The following uses brackets [ and ] only to keep track of the terms; they have no special significance: * Put the formula in conjunctive normal form with the formula to be reduced: ::: '''q = ( (~p & d & c ) ∨ (p & d & c) ∨ (p & d & ~c) ∨ (p & ~d & ~c) )''' = ( #3 ∨ #7 ∨ #6 ∨ #4 ) * Idempotency (absorption) [ A ∨ A) = A: ::: ( #3 ∨ [ #7 ∨ #7 ] ∨ [ #6 ∨ #6 ] ∨ #4 ) * Associative law (x ∨ (y ∨ z)) = ( (x ∨ y) ∨ z ) ::: ( [ #3 ∨ #7 ] ∨ [ #7 ∨ #6 ] ∨ [ #6 ∨ #4] ) ::: '''[''' (~p & d & c ) ∨ (p & d & c) ''']''' ∨ '''[''' (p & d & c) ∨ (p & d & ~c) ''']''' ∨ '''[''' (p & d & ~c) ∨ (p & ~d & ~c) ''']'''. * Distributive law ( x & (y ∨ z) ) = ( (x & y) ∨ (x & z) ) : ::: ( [ (d & c) ∨ (~p & p) ] ∨ [ (p & d) ∨ (~c & c) ] ∨ [ (p & ~c) ∨ (c & ~c) ] ) * Commutative law and law of contradiction (x & ~x) = (~x & x) = 0: ::: ( [ (d & c) ∨ (0) ] ∨ [ (p & d) ∨ (0) ] ∨ [ (p & ~c) ∨ (0) ] ) * Law of identity ( x ∨ 0 ) = x leading to the reduced form of the formula: ::: '''q = ( (d & c) ∨ (p & d) ∨ (p & ~c) )''' ==== Verify reduction with a truth table ==== {| |- style="font-size:9pt;font-weight:bold" align="center" |style="background-color:#F2F2F2" width="25.5" Height="12" | row ! Minterms ! width="21" | p ! width="21" | d ! width="21" | c ! width="10.5" | ( ! width="10.5" | ( ! width="10.5" | d !style="background-color:#DBE5F1" width="10.5" | & ! width="10.5" | c ! width="10.5" | ) !style="background-color:#FDE9D9" width="10.5" | ∨ ! width="10.5" | ( ! width="10.5" | p !style="background-color:#DBE5F1" width="10.5" | & ! width="10.5" | d ! width="10.5" | ) !style="background-color:#FDE9D9" width="10.5" | ∨ ! width="10.5" | ( ! width="10.5" | p !style="background-color:#DBE5F1" width="10.5" | & !style="background-color:#EAF1DD" width="10.5" | ~ ! width="10.5" | ( ! width="10.5" | c ! width="10.5" | ) ! width="10.5" | ) |- style="font-size:9pt" align="center" |style="background-color:#F2F2F2;font-weight:bold" Height="12" | 0 | ( ~p & ~d & ~c ) | 0 | 0 | 0 | | | 0 |style="background-color:#DBE5F1" | 0 | 0 | |style="background-color:#FDE9D9" | 0 | | 0 |style="background-color:#DBE5F1" | 0 | 0 | |style="background-color:#FDE9D9" | 0 | | 0 |style="background-color:#DBE5F1" | 0 |style="background-color:#EAF1DD" | 1 | | 0 | | |- style="font-size:9pt" align="center" |style="background-color:#F2F2F2;font-weight:bold" Height="12" | 1 | ( ~p & ~d & c) | 0 | 0 | 1 | | | 0 |style="background-color:#DBE5F1" | 0 | 1 | |style="background-color:#FDE9D9" | 0 | | 0 |style="background-color:#DBE5F1" | 0 | 0 | |style="background-color:#FDE9D9" | 0 | | 0 |style="background-color:#DBE5F1" | 0 |style="background-color:#EAF1DD" | 0 | | 1 | | |- style="font-size:9pt" align="center" |style="background-color:#F2F2F2;font-weight:bold" Height="12" | 2 | ( ~p & d & ~c ) | 0 | 1 | 0 | | | 1 |style="background-color:#DBE5F1" | 0 | 0 | |style="background-color:#FDE9D9" | 0 | | 0 |style="background-color:#DBE5F1" | 0 | 1 | |style="background-color:#FDE9D9" | 0 | | 0 |style="background-color:#DBE5F1" | 0 |style="background-color:#EAF1DD" | 1 | | 0 | | |- style="font-size:9pt" align="center" |style="background-color:#F2F2F2;font-weight:bold" Height="12" | 3 | ( ~p & d & c ) | 0 | 1 | 1 | | | 1 |style="background-color:#DBE5F1" | 1 | 1 | |style="background-color:#FDE9D9" | 1 | | 0 |style="background-color:#DBE5F1" | 0 | 1 | |style="background-color:#FAC090" | 1 | | 0 |style="background-color:#DBE5F1" | 0 |style="background-color:#EAF1DD" | 0 | | 1 | | |- style="font-size:9pt" align="center" |style="background-color:#F2F2F2;font-weight:bold" Height="12" | 4 | ( p & ~d & ~c ) | 1 | 0 | 0 | | | 0 |style="background-color:#DBE5F1" | 0 | 0 | |style="background-color:#FDE9D9" | 0 | | 1 |style="background-color:#DBE5F1" | 0 | 0 | |style="background-color:#FAC090" | 1 | | 1 |style="background-color:#DBE5F1" | 1 |style="background-color:#EAF1DD" | 1 | | 0 | | |- style="font-size:9pt" align="center" |style="background-color:#F2F2F2;font-weight:bold" Height="12" | 5 | ( p & ~d & c ) | 1 | 0 | 1 | | | 0 |style="background-color:#DBE5F1" | 0 | 1 | |style="background-color:#FDE9D9" | 0 | | 1 |style="background-color:#DBE5F1" | 0 | 0 | |style="background-color:#FDE9D9" | 0 | | 1 |style="background-color:#DBE5F1" | 0 |style="background-color:#EAF1DD" | 0 | | 1 | | |- style="font-size:9pt" align="center" |style="background-color:#F2F2F2;font-weight:bold" Height="12" | 6 | ( p & d & ~c ) | 1 | 1 | 0 | | | 1 |style="background-color:#DBE5F1" | 0 | 0 | |style="background-color:#FDE9D9" | 1 | | 1 |style="background-color:#DBE5F1" | 1 | 1 | |style="background-color:#FAC090" | 1 | | 1 |style="background-color:#DBE5F1" | 1 |style="background-color:#EAF1DD" | 1 | | 0 | | |- style="font-size:9pt" align="center" |style="background-color:#F2F2F2;font-weight:bold" Height="12" | 7 | ( p & d & c ) | 1 | 1 | 1 | | | 1 |style="background-color:#DBE5F1" | 1 | 1 | |style="background-color:#FDE9D9" | 1 | | 1 |style="background-color:#DBE5F1" | 1 | 1 | |style="background-color:#FAC090" | 1 | | 1 |style="background-color:#DBE5F1" | 0 |style="background-color:#EAF1DD" | 0 | | 1 | | |- style="font-size:9pt" | Height="12" valign="bottom" | | align="center" valign="bottom" | | valign="bottom" | | valign="bottom" | | valign="bottom" | | valign="bottom" | | valign="bottom" | | valign="bottom" | | valign="bottom" | | valign="bottom" | | valign="bottom" | | valign="bottom" | | valign="bottom" | | valign="bottom" | | valign="bottom" | | valign="bottom" | | valign="bottom" | |style="background-color:#FAC090;font-weight:bold" align="center" | q | valign="bottom" | | valign="bottom" | | valign="bottom" | | valign="bottom" | | valign="bottom" | | valign="bottom" | | valign="bottom" | | valign="bottom" | |}
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)