Skip to content
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

Added support for visit_Assert through basic_eq #2404

Merged
merged 2 commits into from
Nov 2, 2023

Conversation

anutosh491
Copy link
Collaborator

Fixes #2401

Instead of converting the basic variables into strings using basic_str and doing a string comparison, I think using basic_eq works better. This has been addressed through the PR

@certik
Copy link
Contributor

certik commented Nov 1, 2023

Let's write a test that fails in master, but now works. Something like:

x: S = Symbol("pi")
assert x != pi

Which with this PR should pass, but in master fails?

@certik
Copy link
Contributor

certik commented Nov 1, 2023

Here is a test that fails in master, but works in this PR:

from sympy import Symbol, pi
from lpython import S

def main0():
    x: S = Symbol('pi')
    print(x)
    print(x != pi)
    assert x != pi

main0()

@anutosh491
Copy link
Collaborator Author

Ready.

@anutosh491
Copy link
Collaborator Author

cc @certik

Copy link
Contributor

@certik certik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, thanks!

@certik certik merged commit dcaf253 into lcompilers:main Nov 2, 2023
13 checks passed
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.

Discussing implementation for visit_assert in replace_symbolic.cpp pass
2 participants