# NOT RUN {
# Crisp-set case
# --------------
is.inus(c("A", "A + B", "A + a*B", "A + a", "A*a"))
is.inus("F + f*G")
is.inus("F*G + f*H + G*H")
is.inus("F*G + f*g + H*F + H*G")
# Multi-value case
# ----------------
mvdata <- mvtt(setNames(allCombs(c(2, 3, 2)) -1, c("C", "F", "V")))
is.inus("C=1 + F=2*V=0", mvdata)
is.inus("C=1 + F=2*V=0", list(C=0:1, F=0:2, V=0:1))
# When x is NULL, is.inus is applied to full.tt("C=1 + F=2*V=0"), which has only
# one single row. That row is then interpreted to be the only possible configuration,
# in which case C=1 + F=2*V=0 is tautologous and, hence, non-minimal.
is.inus("C=1 + F=2*V=0")
is.inus("C=1 + C=0*C=2", mvtt(d.pban)) # contradictory
is.inus("C=0 + C=1 + C=2", mvtt(d.pban)) # tautologous
# Fuzzy-set case
# --------------
fsdata <- fstt(d.jobsecurity)
conds <- csf(cna(fsdata, con = 0.85, cov = 0.85))$condition
conds <- cna:::lhs(conds)
is.inus(conds, fsdata)
is.inus(c("S + s", "S + s*R", "S*s"), fsdata)
# }
Run the code above in your browser using DataLab