Exemple #1
0
def test_find_conditions_with_subs():
    formula = Ite(a, Ite(LT(x, v1), v2, v3), Ite(b, v1, v2))
    variables = WMIVariables()
    w = Weights(formula, variables)
    subs = w._find_conditions(formula, {
        a: Symbol("cond_0"),
        y: Symbol("cond_1")
    })
    assert len(subs) == 4
Exemple #2
0
def test_find_conditions_count_no_conditions():
    formula = Times(v1, Plus(v2, v3))
    variables = WMIVariables()
    w = Weights(formula, variables)
    subs = w._find_conditions(formula, {})
    assert len(subs) == 0
Exemple #3
0
def test_find_conditions_count():
    formula = Ite(a, Ite(LT(x, v1), v2, v3), Ite(b, v1, v2))
    variables = WMIVariables()
    w = Weights(formula, variables)
    subs = w._find_conditions(formula, {})
    assert len(subs) == 3