Learn R Programming

QCA (version 1.1-2)

solveChart: Eliminate Redundant Prime Implicants

Description

This function reduces the complete union of prime implicants to a minimal union by eliminating redundant prime implicants.

Usage

solveChart(chart, row.dom = FALSE, all.sol = FALSE)

Arguments

chart
A prime implicant chart.
row.dom
Logical, apply row dominance to eliminate dominated inessential prime implicants.
all.sol
Logical, derive all possible (non-overlapping) solutions, irrespective of complexity.

Value

  • A matrix containing in its columns the row index values from the prime implicant chart that form solutions according to the values specified by the user in the function's arguments.

Details

This function solves prime implicant charts. Prime implicant charts have the prime implicants listed on the rows and the truth table configurations from which they have been derived listed on the columns (Quine 1952; McCluskey 1956). Each configuration must be covered at least once by at least one prime implicant.

References

McCluskey, Edward J. 1956. Minimization of Boolean Functions. Bell Systems Technical Journal 35 (6):1417-44. Quine, Willard V. 1952. The Problem of Simplifying Truth Functions. American Mathematical Monthly 59 (8):521-31.

Examples

Run this code
# simple PI chart, formatted using internal function prettyTable()
PI <- c("A", "B", "c", "D") 
CO <- c("AbCD", "AbCd", "aBcd", "aBCD") 
chart <- demoChart(PI, CO)
prettyTable(chart)

# solution:
# first or third PI: A + c
solveChart(chart)

# all non-overlapping solutions: 
# first or third PI: A + c
# second or third or fourth PI: B + c + D
solveChart(chart, all.sol = TRUE)

# a more complex example
PI <- c("AB", "BC", "Ac", "aC", "abd", "bcd")
CO <- c("ABCD", "ABCd", "ABcD", "ABcd", "AbcD", "Abcd",
        "aBCD", "aBCd", "abCD", "abCd", "abcd")
chart <- demoChart(PI, CO)
prettyTable(chart)

# AB + Ac + aC + abd
# AB + Ac + aC + bcd
# BC + Ac + aC + abd
# BC + Ac + aC + bcd
solveChart(chart)

Run the code above in your browser using DataLab