Пример #1
0
def test_extract_facts():
    a, b = symbols('a b', cls=Predicate)
    assert _extract_facts(a(x), x) == a
    assert _extract_facts(a(x), y) is None
    assert _extract_facts(~a(x), x) == ~a
    assert _extract_facts(~a(x), y) is None
    assert _extract_facts(a(x) | b(x), x) == a | b
    assert _extract_facts(a(x) | ~b(x), x) == a | ~b
    assert _extract_facts(a(x) & b(y), x) == a
    assert _extract_facts(a(x) & b(y), y) == b
    assert _extract_facts(a(x) | b(y), x) == None
    assert _extract_facts(~(a(x) | b(y)), x) == ~a
Пример #2
0
def test_extract_facts():
    a, b = symbols('a b', cls=Predicate)
    assert _extract_facts(a(x), x) == a
    assert _extract_facts(a(x), y) is None
    assert _extract_facts(~a(x), x) == ~a
    assert _extract_facts(~a(x), y) is None
    assert _extract_facts(a(x) | b(x), x) == a | b
    assert _extract_facts(a(x) | ~b(x), x) == a | ~b
    assert _extract_facts(a(x) & b(y), x) == a
    assert _extract_facts(a(x) & b(y), y) == b
    assert _extract_facts(a(x) | b(y), x) == None
    assert _extract_facts(~(a(x) | b(y)), x) == ~a
Пример #3
0
def test_extract_facts():
    a, b = symbols('a b', cls=Predicate)
    x, y = symbols('x y')
    assert _extract_facts(a(x), x)  == a
    assert _extract_facts(a(x), y)  == None
    assert _extract_facts(~a(x), x) == ~a
    assert _extract_facts(~a(x), y) == None
    assert _extract_facts(a(x) | b(x), x) == a | b
    assert _extract_facts(a(x) | ~b(x), x) == a | ~b
def test_extract_facts():
    a, b = symbols('a b', cls=Predicate)
    x, y = symbols('x y')
    assert _extract_facts(a(x), x)  == a
    assert _extract_facts(a(x), y)  == None
    assert _extract_facts(~a(x), x) == ~a
    assert _extract_facts(~a(x), y) == None
    assert _extract_facts(a(x) | b(x), x) == a | b
    assert _extract_facts(a(x) | ~b(x), x) == a | ~b