Did I find the right examples for you? yes no      Crawl my project      Python Jobs

# sympy.logic.boolalg.disjuncts

All Samples(43)  |  Call(34)  |  Derive(0)  |  Import(9)

```from sympy import default_sort_key
from sympy.core.compatibility import reduce
from sympy.logic.boolalg import Or, Not, conjuncts, disjuncts, to_cnf, \
to_int_repr, _find_predicates
from sympy.logic.inference import pl_true, literal_symbol
```
```        found_pos, found_neg = False, False
for c in unknown_clauses:
found_pos = True
```
```    for clause in clauses:
num_not_in_model = 0
for literal in disjuncts(clause):
sym = literal_symbol(literal)
if sym not in model:
```

```from sympy.integrals import integrate, Integral
from sympy.integrals.meijerint import _dummy
from sympy.logic.boolalg import to_cnf, conjuncts, disjuncts, Or, And
from sympy.simplify import simplify
from sympy.utilities import default_sort_key
```
```            b_ = -oo
aux_ = []
for d in disjuncts(c):
d_ = d.replace(
re, lambda x: x.as_real_imag()).subs(re(s), t)
```
```        return a, b, aux

conds = [process_conds(c) for c in disjuncts(cond)]
conds = [x for x in conds if x != False]
conds.sort(key=lambda x: (x - x, count_ops(x)))
```
```            a_ = oo
aux_ = []
for d in disjuncts(c):
m = d.match(abs(arg((s + w3)**p*q, w1)) < w2)
if not m:
```
```        return a, aux

conds = [process_conds(c) for c in disjuncts(cond)]
conds2 = [x for x in conds if x != False and x != -oo]
if not conds2:
```

```from sympy import Predicate
from sympy.core.compatibility import reduce
from sympy.logic.boolalg import Or, Not, conjuncts, disjuncts, to_cnf, \
to_int_repr
from sympy.logic.inference import pl_true, literal_symbol
```
```        found_pos, found_neg = False, False
for c in unknown_clauses:
found_pos = True
```
```    for clause in clauses:
num_not_in_model = 0
for literal in disjuncts(clause):
sym = literal_symbol(literal)
if sym not in model:
```

```from sympy.core.symbol import Dummy
from sympy.core.function import Function
from sympy.logic.boolalg import to_cnf, conjuncts, disjuncts, Or, And
from sympy.simplify import simplify
from sympy.core import S
```
```            b_ = -oo
aux_ = []
for d in disjuncts(c):
d_ = d.replace(
re, lambda x: x.as_real_imag()).subs(re(s), t)
```
```        return a, b, aux

conds = [process_conds(c) for c in disjuncts(cond)]
conds = [x for x in conds if x is not False]
conds.sort(key=lambda x: (x - x, count_ops(x)))
```
```            a_ = oo
aux_ = []
for d in disjuncts(c):
m = d.match(abs(arg((s + w3)**p*q, w1)) < w2)
if not m:
```
```        return a, aux

conds = [process_conds(c) for c in disjuncts(cond)]
conds2 = [x for x in conds if x is not False and x != -oo]
if not conds2:
```

```from sympy.assumptions import global_assumptions
from sympy.assumptions.assume import eliminate_assume
from sympy.logic.boolalg import to_cnf, conjuncts, disjuncts, \
And, Not
from sympy.logic.inference import literal_symbol
```
```                lit, pos = literal_symbol(sym), type(sym) is not Not
if pos:
out.update([known_facts_keys.index(str(l))+1 for l in disjuncts(lit)])
else:
out.update([-(known_facts_keys.index(str(l))+1) for l in disjuncts(lit)])
```

```"""
from sympy.core import Symbol
from sympy.logic.boolalg import Or, Not, conjuncts, disjuncts, to_cnf, \
to_int_repr
from sympy.logic.inference import pl_true, literal_symbol
```
```        found_pos, found_neg = False, False
for c in unknown_clauses:
if found_pos != found_neg: return sym, found_pos
```
```    for clause in clauses:
num_not_in_model = 0
for literal in disjuncts(clause):
sym = literal_symbol(literal)
if sym not in model:
```

```from sympy import (symbols, sympify, Dummy, simplify, Equality, S, Interval,
oo, EmptySet)
from sympy.logic.boolalg import (
And, Boolean, Equivalent, ITE, Implies, Nand, Nor, Not, Or, POSform,
SOPform, Xor, conjuncts, disjuncts, distribute_or_over_and,
```
```def test_disjuncts():
assert disjuncts(A | B | C) == set([A, B, C])
assert disjuncts((A | B) & C) == set([(A | B) & C])
assert disjuncts(A) == set([A])
assert disjuncts(True) == set([True])
```

```from sympy import symbols, sympify, Dummy, simplify
from sympy.logic.boolalg import (
And, Boolean, Equivalent, ITE, Implies, Nand, Nor, Not, Or, POSform,
SOPform, Xor, conjuncts, disjuncts, distribute_or_over_and,
distribute_and_over_or, eliminate_implications, is_cnf, is_dnf,
```
```def test_disjuncts():
assert disjuncts(A | B | C) == set([A, B, C])
assert disjuncts((A | B) & C) == set([(A | B) & C])
assert disjuncts(A) == set([A])
assert disjuncts(True) == set([True])
```

```from sympy.logic.boolalg import to_cnf, eliminate_implications, distribute_and_over_or, \
compile_rule, conjuncts, disjuncts, to_int_repr, fuzzy_not, Boolean
from sympy import symbols, And, Or, Xor, Not, Nand, Nor, Implies, Equivalent
from sympy.utilities.pytest import raises, XFAIL

```
```def test_disjuncts():
A, B, C = map(Boolean, symbols('ABC'))
assert set(disjuncts(A | B | C)) == set([A, B, C])
assert disjuncts((A | B) & C) == [(A | B) & C]
assert disjuncts(A) == [A]
assert disjuncts(True) == [True]
```