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

Skip to content

Discussing implementation for visit_assert in replace_symbolic.cpp pass #2401

Closed
@anutosh491

Description

@anutosh491

Consider the following example

(lf) anutosh491@spbhat68:~/lpython/lpython$ cat examples/expr2.py 
from lpython import S
from sympy import pi

def main0():
    x: S = pi
    assert(x == pi)

What we have been doing since the beginning is we

  1. Transform the assert block using basic_str, so we basically compare strings here (where symengine_stack_variable0 stores pi)
    assert (basic_str(x) == basic_str(symengine_stack_variable0))

But what would be better is to do the following assert( basic_eq(x, symengine_stack_variable0) == 1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions