Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fixing issues with freeing variables #2569

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 3 commits into from
Mar 6, 2024

Conversation

anutosh491
Copy link
Collaborator

Fixes #2533
Fixes #2552

This Pr fixes all faulty cases mentioned in the above issues.

@anutosh491
Copy link
Collaborator Author

anutosh491 commented Mar 3, 2024

I think this is ready.
Have added relevant failing cases from the above issues for the same.

@anutosh491
Copy link
Collaborator Author

anutosh491 commented Mar 3, 2024

Actually no, I came across a case which is not working yet

def mmrv(e: S, x: S) -> list[S]:
    empty_list : list[S] = []
    if e.func == Pow:
        if e.args[0] != E:
            return empty_list
        else:
            arg1: S = e.args[1]
            print(arg1)
            if arg1.func == log:
                return empty_list
    else:
        raise

def test_mrv():
    # Case 1
    x: S = Symbol("x")
    ans5: list[S] = mmrv(exp(log(x)), x)
    assert len(ans5) == 0

test_mrv()
(lf) anutosh491@spbhat68:~/lpython/lpython$ lpython --enable-symengine integration_tests/test_gruntz.py --backend=c
0x7ffeedf6e158

Debugging this now.

Update : Commit 3 fixes it

@certik certik merged commit 55c145b into lcompilers:main Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issues with declaring and freeing out symbolic variables Issues while trying to print symbolic expressions
2 participants