rreduce {cna}  R Documentation 
rreduce
eliminate redundancies from disjunctive normal forms (DNF), i.e. disjunctions of conjunctions of literals. If there are several minimal DNF, rreduce
selects one at random.
rreduce(cond, x = full.ct(cond), full = !missing(x), verbose = FALSE, maxiter = 1000, simplify2constant = TRUE)
cond 
A character string specifying a disjunctive normal form; can be either crispset or multivalue. 
x 
A

full 
Logical; if 
simplify2constant 
Logical; if 
verbose 
Logical; if TRUE, the reduction process will be traced in the console. 
maxiter 
Maximal number of iterations. 
rreduce
successively eliminates conjuncts and disjuncts from a DNF cond
as long as the result of condition(cond, x)
remains the same. The only required argument is cond
. If x
is not provided, redundancies are eliminated relative to full.ct(cond)
. If x
is provided and full = TRUE
, redundancies are eliminated relative to full.ct(x)
. If x
is provided and full = FALSE
, redundancies are eliminated relative to x
.
If there are more than one redundancyfree forms of cond
, rreduce
only returns a randomly chosen one.
Redundancyfree disjunctive normal form (DNF).
# Logical redundancies. cond1 < "A*b + a*B + A*C + B*C" rreduce(cond1) cond2 < "A*b + a*B + A*B + a*b" rreduce(cond2, simplify2constant = FALSE) # Any Boolean expressions. cond < "!(A*B*C)*!(a*b*c)" # or "A + B*!(D + e) <> C" x < selectCases(cond) cond < getCond(x) # Returns a DNF equivalent to cond, but with many redundancies. rreduce(cond) # Repeated execution results in different outputs