Function to negate a SOP expression.
negate(expression, snames = "", noflevels = NULL, use.tilde = FALSE)
expression |
A string representing a SOP expresson, or a minimization
object of class "qca" . |
|||
snames |
A string containing the sets' names, separated by commas. | |||
noflevels |
Numerical vector containing the number of levels for each set. | |||
use.tilde |
Logical, use tilde for negation with bivalent variables. |
In Boolean algebra, there are two transformation rules named after the British mathematician Augustus De Morgan. These rules state that:
1. The complement of the union of two sets is the intersection of their complements.
2. The complement of the intersection of two sets is the union of their complements.
In "normal" language, these would be written as:
1. not (A and B) = (not A) or (not B)
2. not (A or B) = (not A) and (not B)
Based on these two laws, any Boolean expression written in disjunctive normal form can be transformed into its negation.
It is also possible to negate all models and solutions from the result of a
Boolean minimization from function minimize()
.
The resulting object, of class "qca"
, is automatically recognised by this
function.
In a SOP expression, the products should normally be split by using a star
*
sign, otherwise the sets' names will be considered the individual
letters in alphabetical order, unless they are specified via snames
.
To negate multilevel expressions, the argument noflevels
is required.
It is entirely possible to obtain multiple negations of a single expression, since the
result of the negation is passed to function simplify()
.
Ragin, Charles C. 1987. The Comparative Method: Moving beyond Qualitative and Quantitative Strategies. Berkeley: University of California Press.
# example from Ragin (1987, p.99) negate("AC + B~C", snames = "A, B, C")N1: ~AC + ~B~C# with different intersection operators negate("AB*EF + ~CD*EF")N1: ~EF + ~AB*CD# using an object of class "qca" produced with minimize() cLC <- minimize(LC, outcome = "SURV", include = "?") negate(cLC)M1: DEV*urb*LIT*STB + DEV*LIT*IND*STB N1: dev + lit + stb + URB*ind# parsimonious solution pLC <- minimize(LC, outcome = "SURV", include = "?") negate(pLC)M1: DEV*STB N1: dev + stb