Closed anutosh491 closed 7 months ago
So the plan would be
from lpython import S
from sympy import Symbol, pi, Add, Mul, Pow, E, log
def mmrv(e: S, x: S) -> set[S]:
if not e.has(x):
empty_set: set[S]
return empty_set
elif e == x:
set1: set[S] = {x}
return set1
elif e.func == Mul or e.func == Add:
# TODO
elif e.func == Pow and e.args[0] != E:
# TODO
elif e.func == log:
arg0: S = e.args[0]
set4: set[S] = mmrv(arg0, x)
set5: set[S]
for i in set4:
ele: S = log(i)
set5.add(ele)
return set5
elif e.func == Pow and e.args[0] == E:
arg1: S = e.args[1]
if arg1.func == log:
arg2 = arg1.args[0]
return mmrv(arg2, x)
# TODO
else:
raise
def test_mmrv():
x: S = Symbol("x")
y: S = Symbol("y")
ans: set[S] = mmrv(y, x)
test_mmrv()
Ready
The next few cases for test_gruntz.py would involve cases where symbolic compare should work correctly For eg check case 2 ( we need
if e == x
working for the same)