Skip to content

Added case to support log instances in mrv function #2525

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()