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

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

src/s/y/sympy-0.7.5/sympy/logic/algorithms/dpll.py   sympy(Download)
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:
            if not found_pos and sym in disjuncts(c):
                found_pos = True
            if not found_neg and Not(sym) in disjuncts(c):
    for clause in clauses:
        num_not_in_model = 0
        for literal in disjuncts(clause):
            sym = literal_symbol(literal)
            if sym not in model:

src/s/y/sympy-0.7.5/sympy/integrals/transforms.py   sympy(Download)
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()[0]).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[2] != False]
    conds.sort(key=lambda x: (x[0] - x[1], count_ops(x[2])))
            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[1] != False and x[0] != -oo]
    if not conds2:

src/s/y/sympy-HEAD/sympy/logic/algorithms/dpll.py   sympy(Download)
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:
            if not found_pos and sym in disjuncts(c):
                found_pos = True
            if not found_neg and Not(sym) in disjuncts(c):
    for clause in clauses:
        num_not_in_model = 0
        for literal in disjuncts(clause):
            sym = literal_symbol(literal)
            if sym not in model:

src/s/y/sympy-HEAD/sympy/integrals/transforms.py   sympy(Download)
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()[0]).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[2] is not False]
    conds.sort(key=lambda x: (x[0] - x[1], count_ops(x[2])))
            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[1] is not False and x[0] != -oo]
    if not conds2:

src/s/y/sympy-polys-HEAD/sympy/assumptions/ask.py   sympy-polys(Download)
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)])

src/s/y/sympy-polys-HEAD/sympy/logic/algorithms/dpll.py   sympy-polys(Download)
"""
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 not found_pos and sym in disjuncts(c): found_pos = True
            if not found_neg and Not(sym) in disjuncts(c): found_neg = True
        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:

src/s/y/sympy-0.7.5/sympy/logic/tests/test_boolalg.py   sympy(Download)
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])

src/s/y/sympy-HEAD/sympy/logic/tests/test_boolalg.py   sympy(Download)
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])

src/s/y/sympy-polys-HEAD/sympy/logic/tests/test_boolalg.py   sympy-polys(Download)
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]