← suite examples

sympy-ask

suite examples · 2026-10-13 17:20:46 · CAS sympy 1.14.0, mode fork · machine pi5 · dialect sympy · case set df65d778fc5c

By category

categorynsolvedwrongdeclined correctlyno verdicttimeoutunsupported
branch-cuts5101300
conventions2000200
log-exp2200000
parity5201200
primes2001100
radicals6201300
sign5001400
trig2000200
total297051700

Setup (run once per start, not counted in the per-query times)

measured setup time: 0.409 s

setup — not timed
from sympy import *
import sympy

SympyVersion = sympy.__version__
# warm-up: a fixed generic expression, never case content
W = Symbol('W')
Warmup = ask(Q.positive(W**2 + 1), Q.real(W))
# every query then runs in its own forked process, starting from this state:
# the expression caches are dropped (imported and lazily loaded modules stay)
sympy.core.cache.clear_cache()
sympysympy.__version__→1.14.0
warm-upask(Q.positive(W**2 + 1), Q.real(W))→True

Cases

casecategoryoutcomequery (as sent)answersteps (from the trace)sdetail
demo-atan2-01 truebranch-cutsno verdictQ.real(x) ∧ Q.real(y) ∧ Q.positive(x) ⊢ Eq(atan2(y, x), atan((y/x)))nulldifference → -atan(y/x) + atan2(y, x) · ask → None0.141null
code
setup — not timed
from sympy import *
import sympy

SympyVersion = sympy.__version__
# warm-up: a fixed generic expression, never case content
W = Symbol('W')
Warmup = ask(Q.positive(W**2 + 1), Q.real(W))
# every query then runs in its own forked process, starting from this state:
# the expression caches are dropped (imported and lazily loaded modules stay)
sympy.core.cache.clear_cache()
x = Symbol('x', real=True)
y = Symbol('y', real=True)
Assum = And(Q.real(x), Q.real(y), Q.positive(x))
Residual = atan2(y, x) - atan(y / x)
# not Q.eq: in SymPy 1.14 ask(Q.eq(x**2, x), Q.real(x)) is wrongly False
Answer = ask(Q.zero(Residual), Assum)
print(Residual, Answer, sep='\n')
differenceatan2(y, x) - atan(y / x)→-atan(y/x) + atan2(y, x)
askQ.zero(Residual)→None
answernull
demo-atan2-02 falsebranch-cutsno verdictQ.real(x) ∧ Q.real(y) ∧ Q.negative(x) ∧ Q.positive(y) ⊢ Eq(atan2(y, x), atan((y/x)))nulldifference → -atan(y/x) + atan2(y, x) · ask → None0.112null
code
setup — not timed
from sympy import *
import sympy

SympyVersion = sympy.__version__
# warm-up: a fixed generic expression, never case content
W = Symbol('W')
Warmup = ask(Q.positive(W**2 + 1), Q.real(W))
# every query then runs in its own forked process, starting from this state:
# the expression caches are dropped (imported and lazily loaded modules stay)
sympy.core.cache.clear_cache()
x = Symbol('x', real=True)
y = Symbol('y', real=True)
Assum = And(Q.real(x), Q.real(y), Q.negative(x), Q.positive(y))
Residual = atan2(y, x) - atan(y / x)
# not Q.eq: in SymPy 1.14 ask(Q.eq(x**2, x), Q.real(x)) is wrongly False
Answer = ask(Q.zero(Residual), Assum)
print(Residual, Answer, sep='\n')
differenceatan2(y, x) - atan(y / x)→-atan(y/x) + atan2(y, x)
askQ.zero(Residual)→None
answernull
demo-log-01 truebranch-cutsno verdictQ.real(x) ∧ Q.real(y) ∧ Q.positive(x) ∧ Q.positive(y) ⊢ Eq(log((x*y)), (log(x) + log(y)))nulldifference → -log(x) - log(y) + log(x*y) · ask → None0.148null
code
setup — not timed
from sympy import *
import sympy

SympyVersion = sympy.__version__
# warm-up: a fixed generic expression, never case content
W = Symbol('W')
Warmup = ask(Q.positive(W**2 + 1), Q.real(W))
# every query then runs in its own forked process, starting from this state:
# the expression caches are dropped (imported and lazily loaded modules stay)
sympy.core.cache.clear_cache()
x = Symbol('x', real=True)
y = Symbol('y', real=True)
Assum = And(Q.real(x), Q.real(y), Q.positive(x), Q.positive(y))
Residual = log(x * y) - (log(x) + log(y))
# not Q.eq: in SymPy 1.14 ask(Q.eq(x**2, x), Q.real(x)) is wrongly False
Answer = ask(Q.zero(Residual), Assum)
print(Residual, Answer, sep='\n')
differencelog(x * y) - (log(x) + log(y))→-log(x) - log(y) + log(x*y)
askQ.zero(Residual)→None
answernull
demo-log-02 contingentbranch-cutsdeclined correctlyQ.complex(z) ∧ Q.complex(w) ∧ (~Q.zero(z)) ∧ (~Q.zero(w)) ⊢ Eq(log((z*w)), (log(z) + log(w)))nulldifference → -log(w) - log(z) + log(w*z) · ask → None0.136null (correct: contingent)
code
setup — not timed
from sympy import *
import sympy

SympyVersion = sympy.__version__
# warm-up: a fixed generic expression, never case content
W = Symbol('W')
Warmup = ask(Q.positive(W**2 + 1), Q.real(W))
# every query then runs in its own forked process, starting from this state:
# the expression caches are dropped (imported and lazily loaded modules stay)
sympy.core.cache.clear_cache()
z = Symbol('z', complex=True)
w = Symbol('w', complex=True)
Assum = And(Q.complex(z), Q.complex(w), ~Q.zero(z), ~Q.zero(w))
Residual = log(z * w) - (log(z) + log(w))
# not Q.eq: in SymPy 1.14 ask(Q.eq(x**2, x), Q.real(x)) is wrongly False
Answer = ask(Q.zero(Residual), Assum)
print(Residual, Answer, sep='\n')
differencelog(z * w) - (log(z) + log(w))→-log(w) - log(z) + log(w*z)
askQ.zero(Residual)→None
answernull
demo-log-03 falsebranch-cutssolvedQ.real(x) ∧ Q.negative(x) ⊢ Eq(log(x), log((-x)))falsedifference → -log(-x) + log(x) · ask → False0.133false
code
setup — not timed
from sympy import *
import sympy

SympyVersion = sympy.__version__
# warm-up: a fixed generic expression, never case content
W = Symbol('W')
Warmup = ask(Q.positive(W**2 + 1), Q.real(W))
# every query then runs in its own forked process, starting from this state:
# the expression caches are dropped (imported and lazily loaded modules stay)
sympy.core.cache.clear_cache()
x = Symbol('x', real=True)
Assum = And(Q.real(x), Q.negative(x))
Residual = log(x) - log(-x)
# not Q.eq: in SymPy 1.14 ask(Q.eq(x**2, x), Q.real(x)) is wrongly False
Answer = ask(Q.zero(Residual), Assum)
print(Residual, Answer, sep='\n')
differencelog(x) - log(-x)→-log(-x) + log(x)
askQ.zero(Residual)→False
answerfalse
demo-acot-01 trueconventionsno verdictQ.real(x) ∧ Q.positive(x) ⊢ Eq(acot(x), atan((1/x)))nulldifference → acot(x) - atan(1/x) · ask → None0.078null
code
setup — not timed
from sympy import *
import sympy

SympyVersion = sympy.__version__
# warm-up: a fixed generic expression, never case content
W = Symbol('W')
Warmup = ask(Q.positive(W**2 + 1), Q.real(W))
# every query then runs in its own forked process, starting from this state:
# the expression caches are dropped (imported and lazily loaded modules stay)
sympy.core.cache.clear_cache()
x = Symbol('x', real=True)
Assum = And(Q.real(x), Q.positive(x))
Residual = acot(x) - atan(1 / x)
# not Q.eq: in SymPy 1.14 ask(Q.eq(x**2, x), Q.real(x)) is wrongly False
Answer = ask(Q.zero(Residual), Assum)
print(Residual, Answer, sep='\n')
differenceacot(x) - atan(1 / x)→acot(x) - atan(1/x)
askQ.zero(Residual)→None
answernull
demo-heaviside-01 trueconventionsno verdictQ.real(x) ∧ (~Q.zero(x)) ⊢ Eq((Heaviside(x) + Heaviside((-x))), 1)nulldifference → Heaviside(-x) + Heaviside(x) - 1 · ask → None0.048null
code
setup — not timed
from sympy import *
import sympy

SympyVersion = sympy.__version__
# warm-up: a fixed generic expression, never case content
W = Symbol('W')
Warmup = ask(Q.positive(W**2 + 1), Q.real(W))
# every query then runs in its own forked process, starting from this state:
# the expression caches are dropped (imported and lazily loaded modules stay)
sympy.core.cache.clear_cache()
x = Symbol('x', real=True)
Assum = And(Q.real(x), ~Q.zero(x))
Residual = Heaviside(x) + Heaviside(-x) - 1
# not Q.eq: in SymPy 1.14 ask(Q.eq(x**2, x), Q.real(x)) is wrongly False
Answer = ask(Q.zero(Residual), Assum)
print(Residual, Answer, sep='\n')
differenceHeaviside(x) + Heaviside(-x) - 1→Heaviside(-x) + Heaviside(x) - 1
askQ.zero(Residual)→None
answernull
demo-eq-log-01 truelog-expsolvedQ.real(x) ∧ Q.positive(x) ⊢ Eq(log(exp(x)), x)truedifference → 0 · ask → True0.01true
code
setup — not timed
from sympy import *
import sympy

SympyVersion = sympy.__version__
# warm-up: a fixed generic expression, never case content
W = Symbol('W')
Warmup = ask(Q.positive(W**2 + 1), Q.real(W))
# every query then runs in its own forked process, starting from this state:
# the expression caches are dropped (imported and lazily loaded modules stay)
sympy.core.cache.clear_cache()
x = Symbol('x', real=True)
Assum = And(Q.real(x), Q.positive(x))
Residual = log(exp(x)) - x
# not Q.eq: in SymPy 1.14 ask(Q.eq(x**2, x), Q.real(x)) is wrongly False
Answer = ask(Q.zero(Residual), Assum)
print(Residual, Answer, sep='\n')
differencelog(exp(x)) - x→0
askQ.zero(Residual)→True
answertrue
demo-eq-pow-01 truelog-expsolvedQ.integer(n) ⊢ Eq(Pow((-1), (2*n)), 1)truedifference → 0 · ask → True0.009true
code
setup — not timed
from sympy import *
import sympy

SympyVersion = sympy.__version__
# warm-up: a fixed generic expression, never case content
W = Symbol('W')
Warmup = ask(Q.positive(W**2 + 1), Q.real(W))
# every query then runs in its own forked process, starting from this state:
# the expression caches are dropped (imported and lazily loaded modules stay)
sympy.core.cache.clear_cache()
n = Symbol('n', integer=True)
Assum = And(Q.integer(n))
Residual = Pow(-1, 2 * n) - 1
# not Q.eq: in SymPy 1.14 ask(Q.eq(x**2, x), Q.real(x)) is wrongly False
Answer = ask(Q.zero(Residual), Assum)
print(Residual, Answer, sep='\n')
differencePow(-1, 2 * n) - 1→0
askQ.zero(Residual)→True
answertrue
demo-parity-01 trueparityno verdictQ.integer(n) ∧ Q.odd(n) ⊢ Eq(Pow((-1), (n + 1)), 1)nulldifference → (-1)**(n + 1) - 1 · ask → None0.049null
code
setup — not timed
from sympy import *
import sympy

SympyVersion = sympy.__version__
# warm-up: a fixed generic expression, never case content
W = Symbol('W')
Warmup = ask(Q.positive(W**2 + 1), Q.real(W))
# every query then runs in its own forked process, starting from this state:
# the expression caches are dropped (imported and lazily loaded modules stay)
sympy.core.cache.clear_cache()
n = Symbol('n', integer=True)
Assum = And(Q.integer(n), Q.odd(n))
Residual = Pow(-1, n + 1) - 1
# not Q.eq: in SymPy 1.14 ask(Q.eq(x**2, x), Q.real(x)) is wrongly False
Answer = ask(Q.zero(Residual), Assum)
print(Residual, Answer, sep='\n')
differencePow(-1, n + 1) - 1→(-1)**(n + 1) - 1
askQ.zero(Residual)→None
answernull
demo-parity-02 falseparitysolvedQ.integer(n) ∧ Q.integer(m) ∧ Q.odd(n) ∧ Q.odd(m) ⊢ Eq(Pow((-1), (n*m)), 1)falsedifference → (-1)**(m*n) - 1 · ask → False0.037false
code
setup — not timed
from sympy import *
import sympy

SympyVersion = sympy.__version__
# warm-up: a fixed generic expression, never case content
W = Symbol('W')
Warmup = ask(Q.positive(W**2 + 1), Q.real(W))
# every query then runs in its own forked process, starting from this state:
# the expression caches are dropped (imported and lazily loaded modules stay)
sympy.core.cache.clear_cache()
n = Symbol('n', integer=True)
m = Symbol('m', integer=True)
Assum = And(Q.integer(n), Q.integer(m), Q.odd(n), Q.odd(m))
Residual = Pow(-1, n * m) - 1
# not Q.eq: in SymPy 1.14 ask(Q.eq(x**2, x), Q.real(x)) is wrongly False
Answer = ask(Q.zero(Residual), Assum)
print(Residual, Answer, sep='\n')
differencePow(-1, n * m) - 1→(-1)**(m*n) - 1
askQ.zero(Residual)→False
answerfalse
demo-parity-03 trueparitysolvedQ.integer(n) ⊢ Eq(Pow((-1), (n*(n + 1))), 1)truedifference → 0 · ask → True0.012true
code
setup — not timed
from sympy import *
import sympy

SympyVersion = sympy.__version__
# warm-up: a fixed generic expression, never case content
W = Symbol('W')
Warmup = ask(Q.positive(W**2 + 1), Q.real(W))
# every query then runs in its own forked process, starting from this state:
# the expression caches are dropped (imported and lazily loaded modules stay)
sympy.core.cache.clear_cache()
n = Symbol('n', integer=True)
Assum = And(Q.integer(n))
Residual = Pow(-1, n * (n + 1)) - 1
# not Q.eq: in SymPy 1.14 ask(Q.eq(x**2, x), Q.real(x)) is wrongly False
Answer = ask(Q.zero(Residual), Assum)
print(Residual, Answer, sep='\n')
differencePow(-1, n * (n + 1)) - 1→0
askQ.zero(Residual)→True
answertrue
demo-parity-04 contingentparitydeclined correctlyQ.integer(n) ∧ Q.even(n) ⊢ Eq(Pow(I, n), 1)nulldifference → I**n - 1 · ask → None0.041null (correct: contingent)
code
setup — not timed
from sympy import *
import sympy

SympyVersion = sympy.__version__
# warm-up: a fixed generic expression, never case content
W = Symbol('W')
Warmup = ask(Q.positive(W**2 + 1), Q.real(W))
# every query then runs in its own forked process, starting from this state:
# the expression caches are dropped (imported and lazily loaded modules stay)
sympy.core.cache.clear_cache()
n = Symbol('n', integer=True)
Assum = And(Q.integer(n), Q.even(n))
Residual = Pow(I, n) - 1
# not Q.eq: in SymPy 1.14 ask(Q.eq(x**2, x), Q.real(x)) is wrongly False
Answer = ask(Q.zero(Residual), Assum)
print(Residual, Answer, sep='\n')
differencePow(I, n) - 1→I**n - 1
askQ.zero(Residual)→None
answernull
demo-parity-05 trueparityno verdictQ.integer(n) ∧ Q.integer(m) ∧ Q.odd(n) ∧ Q.odd(m) ⊢ Eq(Pow((-1), (n*m)), (-1))nulldifference → (-1)**(m*n) + 1 · ask → None0.071null
code
setup — not timed
from sympy import *
import sympy

SympyVersion = sympy.__version__
# warm-up: a fixed generic expression, never case content
W = Symbol('W')
Warmup = ask(Q.positive(W**2 + 1), Q.real(W))
# every query then runs in its own forked process, starting from this state:
# the expression caches are dropped (imported and lazily loaded modules stay)
sympy.core.cache.clear_cache()
n = Symbol('n', integer=True)
m = Symbol('m', integer=True)
Assum = And(Q.integer(n), Q.integer(m), Q.odd(n), Q.odd(m))
Residual = Pow(-1, n * m) - (-1)
# not Q.eq: in SymPy 1.14 ask(Q.eq(x**2, x), Q.real(x)) is wrongly False
Answer = ask(Q.zero(Residual), Assum)
print(Residual, Answer, sep='\n')
differencePow(-1, n * m) - (-1)→(-1)**(m*n) + 1
askQ.zero(Residual)→None
answernull
demo-prime-01 trueprimesno verdictQ.integer(p) ∧ Q.prime(p) ∧ (p > 2) ⊢ Eq(Pow((-1), p), (-1))nulldifference → (-1)**p + 1 · ask → None0.056null
code
setup — not timed
from sympy import *
import sympy

SympyVersion = sympy.__version__
# warm-up: a fixed generic expression, never case content
W = Symbol('W')
Warmup = ask(Q.positive(W**2 + 1), Q.real(W))
# every query then runs in its own forked process, starting from this state:
# the expression caches are dropped (imported and lazily loaded modules stay)
sympy.core.cache.clear_cache()
p = Symbol('p', integer=True)
Assum = And(Q.integer(p), Q.prime(p), p > 2)
Residual = Pow(-1, p) - (-1)
# not Q.eq: in SymPy 1.14 ask(Q.eq(x**2, x), Q.real(x)) is wrongly False
Answer = ask(Q.zero(Residual), Assum)
print(Residual, Answer, sep='\n')
differencePow(-1, p) - (-1)→(-1)**p + 1
askQ.zero(Residual)→None
answernull
demo-prime-02 contingentprimesdeclined correctlyQ.integer(p) ∧ Q.prime(p) ⊢ Eq(Pow((-1), p), (-1))nulldifference → (-1)**p + 1 · ask → None0.046null (correct: contingent)
code
setup — not timed
from sympy import *
import sympy

SympyVersion = sympy.__version__
# warm-up: a fixed generic expression, never case content
W = Symbol('W')
Warmup = ask(Q.positive(W**2 + 1), Q.real(W))
# every query then runs in its own forked process, starting from this state:
# the expression caches are dropped (imported and lazily loaded modules stay)
sympy.core.cache.clear_cache()
p = Symbol('p', integer=True)
Assum = And(Q.integer(p), Q.prime(p))
Residual = Pow(-1, p) - (-1)
# not Q.eq: in SymPy 1.14 ask(Q.eq(x**2, x), Q.real(x)) is wrongly False
Answer = ask(Q.zero(Residual), Assum)
print(Residual, Answer, sep='\n')
differencePow(-1, p) - (-1)→(-1)**p + 1
askQ.zero(Residual)→None
answernull
demo-eq-abs-01 trueradicalsno verdictQ.real(x) ∧ Q.negative(x) ⊢ Eq(Abs(x), (-x))nulldifference → x + Abs(x) · ask → None0.032null
code
setup — not timed
from sympy import *
import sympy

SympyVersion = sympy.__version__
# warm-up: a fixed generic expression, never case content
W = Symbol('W')
Warmup = ask(Q.positive(W**2 + 1), Q.real(W))
# every query then runs in its own forked process, starting from this state:
# the expression caches are dropped (imported and lazily loaded modules stay)
sympy.core.cache.clear_cache()
x = Symbol('x', real=True)
Assum = And(Q.real(x), Q.negative(x))
Residual = Abs(x) - (-x)
# not Q.eq: in SymPy 1.14 ask(Q.eq(x**2, x), Q.real(x)) is wrongly False
Answer = ask(Q.zero(Residual), Assum)
print(Residual, Answer, sep='\n')
differenceAbs(x) - (-x)→x + Abs(x)
askQ.zero(Residual)→None
answernull
demo-eq-abs-02 falseradicalssolvedQ.real(x) ∧ Q.negative(x) ⊢ Eq(Abs(x), x)falsedifference → -x + Abs(x) · ask → False0.018false
code
setup — not timed
from sympy import *
import sympy

SympyVersion = sympy.__version__
# warm-up: a fixed generic expression, never case content
W = Symbol('W')
Warmup = ask(Q.positive(W**2 + 1), Q.real(W))
# every query then runs in its own forked process, starting from this state:
# the expression caches are dropped (imported and lazily loaded modules stay)
sympy.core.cache.clear_cache()
x = Symbol('x', real=True)
Assum = And(Q.real(x), Q.negative(x))
Residual = Abs(x) - x
# not Q.eq: in SymPy 1.14 ask(Q.eq(x**2, x), Q.real(x)) is wrongly False
Answer = ask(Q.zero(Residual), Assum)
print(Residual, Answer, sep='\n')
differenceAbs(x) - x→-x + Abs(x)
askQ.zero(Residual)→False
answerfalse
demo-eq-sqrt-01 trueradicalsno verdictQ.real(x) ∧ Q.positive(x) ⊢ Eq(sqrt(Pow(x, 2)), x)nulldifference → -x + Abs(x) · ask → None0.048null
code
setup — not timed
from sympy import *
import sympy

SympyVersion = sympy.__version__
# warm-up: a fixed generic expression, never case content
W = Symbol('W')
Warmup = ask(Q.positive(W**2 + 1), Q.real(W))
# every query then runs in its own forked process, starting from this state:
# the expression caches are dropped (imported and lazily loaded modules stay)
sympy.core.cache.clear_cache()
x = Symbol('x', real=True)
Assum = And(Q.real(x), Q.positive(x))
Residual = sqrt(Pow(x, 2)) - x
# not Q.eq: in SymPy 1.14 ask(Q.eq(x**2, x), Q.real(x)) is wrongly False
Answer = ask(Q.zero(Residual), Assum)
print(Residual, Answer, sep='\n')
differencesqrt(Pow(x, 2)) - x→-x + Abs(x)
askQ.zero(Residual)→None
answernull
demo-eq-sqrt-02 trueradicalssolvedQ.real(x) ⊢ Eq(sqrt(Pow(x, 2)), Abs(x))truedifference → 0 · ask → True0.009true
code
setup — not timed
from sympy import *
import sympy

SympyVersion = sympy.__version__
# warm-up: a fixed generic expression, never case content
W = Symbol('W')
Warmup = ask(Q.positive(W**2 + 1), Q.real(W))
# every query then runs in its own forked process, starting from this state:
# the expression caches are dropped (imported and lazily loaded modules stay)
sympy.core.cache.clear_cache()
x = Symbol('x', real=True)
Assum = And(Q.real(x))
Residual = sqrt(Pow(x, 2)) - Abs(x)
# not Q.eq: in SymPy 1.14 ask(Q.eq(x**2, x), Q.real(x)) is wrongly False
Answer = ask(Q.zero(Residual), Assum)
print(Residual, Answer, sep='\n')
differencesqrt(Pow(x, 2)) - Abs(x)→0
askQ.zero(Residual)→True
answertrue
demo-eq-sqrt-03 contingentradicalsdeclined correctlyQ.real(x) ⊢ Eq(sqrt(Pow(x, 2)), x)nulldifference → -x + Abs(x) · ask → None0.089null (correct: contingent)
code
setup — not timed
from sympy import *
import sympy

SympyVersion = sympy.__version__
# warm-up: a fixed generic expression, never case content
W = Symbol('W')
Warmup = ask(Q.positive(W**2 + 1), Q.real(W))
# every query then runs in its own forked process, starting from this state:
# the expression caches are dropped (imported and lazily loaded modules stay)
sympy.core.cache.clear_cache()
x = Symbol('x', real=True)
Assum = And(Q.real(x))
Residual = sqrt(Pow(x, 2)) - x
# not Q.eq: in SymPy 1.14 ask(Q.eq(x**2, x), Q.real(x)) is wrongly False
Answer = ask(Q.zero(Residual), Assum)
print(Residual, Answer, sep='\n')
differencesqrt(Pow(x, 2)) - x→-x + Abs(x)
askQ.zero(Residual)→None
answernull
demo-eq-sqrt-04 falseradicalsno verdictQ.real(x) ∧ Q.positive(x) ⊢ Eq((sqrt(Pow(x, 2)) + 1), x)nulldifference → -x + Abs(x) + 1 · ask → None0.059null
code
setup — not timed
from sympy import *
import sympy

SympyVersion = sympy.__version__
# warm-up: a fixed generic expression, never case content
W = Symbol('W')
Warmup = ask(Q.positive(W**2 + 1), Q.real(W))
# every query then runs in its own forked process, starting from this state:
# the expression caches are dropped (imported and lazily loaded modules stay)
sympy.core.cache.clear_cache()
x = Symbol('x', real=True)
Assum = And(Q.real(x), Q.positive(x))
Residual = sqrt(Pow(x, 2)) + 1 - x
# not Q.eq: in SymPy 1.14 ask(Q.eq(x**2, x), Q.real(x)) is wrongly False
Answer = ask(Q.zero(Residual), Assum)
print(Residual, Answer, sep='\n')
differencesqrt(Pow(x, 2)) + 1 - x→-x + Abs(x) + 1
askQ.zero(Residual)→None
answernull
demo-nonzero-01 truesignno verdictQ.complex(z) ∧ Q.imaginary(z) ⊢ Eq(Abs(sign(z)), 1)nulldifference → Abs(sign(z)) - 1 · ask → None0.03null
code
setup — not timed
from sympy import *
import sympy

SympyVersion = sympy.__version__
# warm-up: a fixed generic expression, never case content
W = Symbol('W')
Warmup = ask(Q.positive(W**2 + 1), Q.real(W))
# every query then runs in its own forked process, starting from this state:
# the expression caches are dropped (imported and lazily loaded modules stay)
sympy.core.cache.clear_cache()
z = Symbol('z', complex=True)
Assum = And(Q.complex(z), Q.imaginary(z))
Residual = Abs(sign(z)) - 1
# not Q.eq: in SymPy 1.14 ask(Q.eq(x**2, x), Q.real(x)) is wrongly False
Answer = ask(Q.zero(Residual), Assum)
print(Residual, Answer, sep='\n')
differenceAbs(sign(z)) - 1→Abs(sign(z)) - 1
askQ.zero(Residual)→None
answernull
demo-sign-02 truesignno verdictQ.real(x) ∧ (~Q.zero(x)) ⊢ Eq(sign(Pow(x, 2)), 1)nulldifference → sign(x**2) - 1 · ask → None0.029null
code
setup — not timed
from sympy import *
import sympy

SympyVersion = sympy.__version__
# warm-up: a fixed generic expression, never case content
W = Symbol('W')
Warmup = ask(Q.positive(W**2 + 1), Q.real(W))
# every query then runs in its own forked process, starting from this state:
# the expression caches are dropped (imported and lazily loaded modules stay)
sympy.core.cache.clear_cache()
x = Symbol('x', real=True)
Assum = And(Q.real(x), ~Q.zero(x))
Residual = sign(Pow(x, 2)) - 1
# not Q.eq: in SymPy 1.14 ask(Q.eq(x**2, x), Q.real(x)) is wrongly False
Answer = ask(Q.zero(Residual), Assum)
print(Residual, Answer, sep='\n')
differencesign(Pow(x, 2)) - 1→sign(x**2) - 1
askQ.zero(Residual)→None
answernull
demo-sign-03 contingentsigndeclined correctlyQ.complex(x) ∧ (~Q.zero(x)) ⊢ Eq(sign(Pow(x, 2)), 1)nulldifference → sign(x**2) - 1 · ask → None0.037null (correct: contingent)
code
setup — not timed
from sympy import *
import sympy

SympyVersion = sympy.__version__
# warm-up: a fixed generic expression, never case content
W = Symbol('W')
Warmup = ask(Q.positive(W**2 + 1), Q.real(W))
# every query then runs in its own forked process, starting from this state:
# the expression caches are dropped (imported and lazily loaded modules stay)
sympy.core.cache.clear_cache()
x = Symbol('x', complex=True)
Assum = And(Q.complex(x), ~Q.zero(x))
Residual = sign(Pow(x, 2)) - 1
# not Q.eq: in SymPy 1.14 ask(Q.eq(x**2, x), Q.real(x)) is wrongly False
Answer = ask(Q.zero(Residual), Assum)
print(Residual, Answer, sep='\n')
differencesign(Pow(x, 2)) - 1→sign(x**2) - 1
askQ.zero(Residual)→None
answernull
demo-sign-04 truesignno verdictQ.complex(z) ⊢ Eq(Abs((z*conjugate(z))), (z*conjugate(z)))nulldifference → -z*conjugate(z) + Abs(z*conjugate(z)) · ask → None0.144null
code
setup — not timed
from sympy import *
import sympy

SympyVersion = sympy.__version__
# warm-up: a fixed generic expression, never case content
W = Symbol('W')
Warmup = ask(Q.positive(W**2 + 1), Q.real(W))
# every query then runs in its own forked process, starting from this state:
# the expression caches are dropped (imported and lazily loaded modules stay)
sympy.core.cache.clear_cache()
z = Symbol('z', complex=True)
Assum = And(Q.complex(z))
Residual = Abs(z * conjugate(z)) - (z * conjugate(z))
# not Q.eq: in SymPy 1.14 ask(Q.eq(x**2, x), Q.real(x)) is wrongly False
Answer = ask(Q.zero(Residual), Assum)
print(Residual, Answer, sep='\n')
differenceAbs(z * conjugate(z)) - (z * conjugate(z))→-z*conjugate(z) + Abs(z*conjugate(z))
askQ.zero(Residual)→None
answernull
demo-sign-05 truesignno verdictQ.real(x) ∧ Q.real(y) ∧ Q.positive(x) ∧ Q.negative(y) ⊢ Eq(Abs((x - y)), (x - y))nulldifference → -x + y + Abs(x - y) · ask → None0.083null
code
setup — not timed
from sympy import *
import sympy

SympyVersion = sympy.__version__
# warm-up: a fixed generic expression, never case content
W = Symbol('W')
Warmup = ask(Q.positive(W**2 + 1), Q.real(W))
# every query then runs in its own forked process, starting from this state:
# the expression caches are dropped (imported and lazily loaded modules stay)
sympy.core.cache.clear_cache()
x = Symbol('x', real=True)
y = Symbol('y', real=True)
Assum = And(Q.real(x), Q.real(y), Q.positive(x), Q.negative(y))
Residual = Abs(x - y) - (x - y)
# not Q.eq: in SymPy 1.14 ask(Q.eq(x**2, x), Q.real(x)) is wrongly False
Answer = ask(Q.zero(Residual), Assum)
print(Residual, Answer, sep='\n')
differenceAbs(x - y) - (x - y)→-x + y + Abs(x - y)
askQ.zero(Residual)→None
answernull
demo-eq-trig-01 truetrigno verdictQ.complex(x) ⊢ Eq((Pow(sin(x), 2) + Pow(cos(x), 2)), 1)nulldifference → sin(x)**2 + cos(x)**2 - 1 · ask → None0.086null
code
setup — not timed
from sympy import *
import sympy

SympyVersion = sympy.__version__
# warm-up: a fixed generic expression, never case content
W = Symbol('W')
Warmup = ask(Q.positive(W**2 + 1), Q.real(W))
# every query then runs in its own forked process, starting from this state:
# the expression caches are dropped (imported and lazily loaded modules stay)
sympy.core.cache.clear_cache()
x = Symbol('x', complex=True)
Assum = And(Q.complex(x))
Residual = Pow(sin(x), 2) + Pow(cos(x), 2) - 1
# not Q.eq: in SymPy 1.14 ask(Q.eq(x**2, x), Q.real(x)) is wrongly False
Answer = ask(Q.zero(Residual), Assum)
print(Residual, Answer, sep='\n')
differencePow(sin(x), 2) + Pow(cos(x), 2) - 1→sin(x)**2 + cos(x)**2 - 1
askQ.zero(Residual)→None
answernull
demo-eq-trig-02 truetrigno verdictQ.complex(x) ⊢ Eq((2*sin(x)*cos(x)), sin((2*x)))nulldifference → 2*sin(x)*cos(x) - sin(2*x) · ask → None0.143null
code
setup — not timed
from sympy import *
import sympy

SympyVersion = sympy.__version__
# warm-up: a fixed generic expression, never case content
W = Symbol('W')
Warmup = ask(Q.positive(W**2 + 1), Q.real(W))
# every query then runs in its own forked process, starting from this state:
# the expression caches are dropped (imported and lazily loaded modules stay)
sympy.core.cache.clear_cache()
x = Symbol('x', complex=True)
Assum = And(Q.complex(x))
Residual = 2 * sin(x) * cos(x) - sin(2 * x)
# not Q.eq: in SymPy 1.14 ask(Q.eq(x**2, x), Q.real(x)) is wrongly False
Answer = ask(Q.zero(Residual), Assum)
print(Residual, Answer, sep='\n')
difference2 * sin(x) * cos(x) - sin(2 * x)→2*sin(x)*cos(x) - sin(2*x)
askQ.zero(Residual)→None
answernull