# three variables with two levels (values) each
noflevels <- c(2, 2, 2)
# second row of the implicant matrix corresponding
# to the first value of the rightmost variable
getRow(noflevels = noflevels + 1, row.no = 2) - 1
# row numbers of the implicant matrix which
# correspond to subsets of this value
(rows <- findSubsets(noflevels = noflevels + 1, 2))
# corresponding matrix representation of these rows
getRow(noflevels = noflevels + 1, row.no = rows) - 1
# stopping at row 20
getRow(noflevels = noflevels + 1,
row.no = findSubsets(noflevels + 1, 2, 20)) - 1
# reconstruct configurations from prime implicants;
# example of "developed formula" from Quine (1952, p. 524)
x <- data.frame(createMatrix(rep(3, 4)), row.names = 1:81)
x[x[,1] == 0 & x[,2] == 0 & x[,3] == 2 & x[,4] == 1,]
x[x[,1] == 2 & x[,2] == 2 & x[,3] == 2 & x[,4] == 0,]
levels <- rep(3, 4)
rows <- c(8, 79)
imp <- getRow(levels, findSubsets(levels, rows)) - 1
imp
Run the code above in your browser using DataLab