Skip to content

Commit

Permalink
Added case to support log instances in mrv function
Browse files Browse the repository at this point in the history
  • Loading branch information
anutosh491 committed Feb 12, 2024
1 parent 2e7f1f5 commit 5d9fe5d
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion integration_tests/test_gruntz.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from lpython import S
from sympy import Symbol
from sympy import Symbol, log

def mmrv(e: S, x: S) -> list[S]:
if not e.has(x):
Expand All @@ -8,6 +8,10 @@ def mmrv(e: S, x: S) -> list[S]:
elif e == x:
list1: list[S] = [x]
return list1
elif e.func == log:
arg0: S = e.args[0]
list2: list[S] = mmrv(arg0, x)
return list2
else:
raise

Expand All @@ -26,4 +30,11 @@ def test_mrv():
assert ele1 == x
assert len(ans2) == 1

# Case 3
ans3: list[S] = mmrv(log(x), x)
ele2: S = ans3[0]
print(ele2)
assert ele2 == x
assert len(ans2) == 1

test_mrv()

0 comments on commit 5d9fe5d

Please sign in to comment.