View source: R/detect_contradicting_if_rules.R
| detect_contradicting_if_rules | R Documentation |
Detect whether conditions in conditional if-rules may generate contradictions. Strictly speaking these rules do not make the rule set infeasible but rather make the if-condition unsatisfiable. Semantically speaking these rules are contradicting, because the writer of the rule set did not have the intention to make the condition forbidden.
detect_contradicting_if_rules(x, ..., verbose = interactive())
x |
A validator object. |
... |
Additional arguments passed to |
verbose |
Logical. If |
In general it detects (variations on) cases where:
if (A) B and if (A) !B, which probably is not intended, but logically equals !A.
if (A) B and if (B) !A, which probably is not intended but logically equals !A.
See examples for more details.
A list of contradictions found in the if clauses, or NULL if none are found.
Other feasibility:
detect_boundary_cat(),
detect_boundary_num(),
detect_infeasible_rules(),
is_contradicted_by(),
is_infeasible(),
make_feasible()
rules <- validator(
if (nace == "a") export == "y",
if (nace == "a") export == "n"
)
conflicts <- detect_contradicting_if_rules(rules, verbose=TRUE)
print(conflicts)
# this creates a implicit contradiction when income > 0
rules <- validator(
rule1 = if (income > 0) job == "yes",
rule2 = if (job == "yes") income == 0
)
conflicts <- detect_contradicting_if_rules(rules, verbose=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.