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

Skip to content

Issues while trying to print symbolic expressions #2533

Closed
@anutosh491

Description

@anutosh491

Consider the following minimalistic example

from lpython import S
from sympy import Symbol, log

def mmrv(e: S, x: S) -> list[S]:
    if e == x:
        list1: list[S] = [x]
        return list1
    else:
        list2: list[S] = mmrv(x, x)
        return list2

def test_mrv():
    x: S = Symbol("x")
    ans3: list[S] = mmrv(log(x), x)
    ele2: S = ans3[0]
    print(ele2)

test_mrv()

Mostly this works

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

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