checkContradiction
checkContradiction
checkContradiction Check for contradictions of the form x1 & ~x1 (x1 & !x1).
[hasContradiction, contradictions] = checkContradiction(varAnd, varNot) checks whether there is a contradiction where a variable appears in both varAnd and varNot, meaning it is simultaneously required and forbidden.
Arguments
varAnd(vector or cell array of vectors): AND variable numbers obtained fromgetVarNumsAndMultiplier.varNot(vector or cell array of vectors): NOT variable numbers obtained fromgetVarNumsAndMultiplier.
Returns
hasContradiction(logical): True if any contradictions exist.contradictions(vector of logicals): A vector indicating which elements yield a contradiction.
Notes
- This function is used in
removeContradictionsto eliminate contradicting terms, which helps speed up the simplification process by reducing the total number of terms.
See also removeContradictions, getVarNumsAndMultiplier