Detect which rules cause infeasibility. This methods tries to remove the minimum number of rules to make the system mathematically feasible. Note that this may not result in your desired system, because some rules may be more important to you than others. This can be mitigated by supplying weights for the rules. Default weight is 1.

detect_infeasible_rules(x, weight = numeric(), ...)

Arguments

x

validator object with rules

weight

optional named numeric with weights. Unnamed variables in the weight are given the default weight 1.

...

not used

Value

character with the names of the rules that are causing infeasibility.

Examples

rules <- validator( x > 0)

is_infeasible(rules)
#> [1] FALSE

rules <- validator( rule1 = x > 0
                  , rule2 = x < 0
                  )

is_infeasible(rules)
#> [1] TRUE

detect_infeasible_rules(rules)
#> [1] "rule1"
make_feasible(rules)
#> Dropping rule(s): "rule1"
#> Object of class 'validator' with 1 elements:
#>  rule2: x < 0
#> Rules are evaluated using locally defined options

# find out the conflict with this rule
is_contradicted_by(rules, "rule1")
#> [1] "rule2"