Example #1
0
    def test_get_conjuncts_and_op(self):
        a, b = Signal("a"), Signal("b")
        conjunction_expr = BinOp("*", a, b)
        conjuncts = _get_conjuncts(conjunction_expr)

        assert len(conjuncts) == 2
        assert a in conjuncts
        assert b in conjuncts
Example #2
0
    def test_get_conjuncts_and_op(self):
        a, b = Signal('a'), Signal('b')
        conjunction_expr = BinOp('*', a, b)
        conjuncts = _get_conjuncts(conjunction_expr)

        assert len(conjuncts) == 2
        assert a in conjuncts
        assert b in conjuncts
Example #3
0
    def test_get_conjuncts_recursion(self):
        a, b, c = Signal("a"), Signal("b"), Signal("c")
        conjunction_expr = BinOp("*", a, BinOp("*", b, c))
        conjuncts = _get_conjuncts(conjunction_expr)

        assert len(conjuncts) == 3
Example #4
0
    def test_get_conjuncts_no_conjuncts(self):
        a, b = Signal("a"), Signal("b")
        conjunction_expr = BinOp("+", a, b)
        conjuncts = _get_conjuncts(conjunction_expr)

        assert conjuncts == [conjunction_expr], str(conjunction_expr)
Example #5
0
    def test_get_conjuncts_recursion(self):
        a, b, c = Signal('a'), Signal('b'), Signal('c')
        conjunction_expr = BinOp('*', a, BinOp('*', b, c))
        conjuncts = _get_conjuncts(conjunction_expr)

        assert len(conjuncts) == 3
Example #6
0
    def test_get_conjuncts_no_conjuncts(self):
        a, b = Signal('a'), Signal('b')
        conjunction_expr = BinOp('+', a, b)
        conjuncts = _get_conjuncts(conjunction_expr)

        assert conjuncts == [conjunction_expr], str(conjunction_expr)