Open BenWeber42 opened 1 year ago
see #1423
updated results:
In [2]: from ast import parse
...: from dace.symbolic import pystr_to_symbolic, names_in_ast, symlist
In [3]: pystr_to_symbolic("a[i]").free_symbols
Out[3]: {i}
In [4]: names_in_ast(parse("a[i]"))
Out[4]: ['a', 'i']
In [5]: symlist(pystr_to_symbolic("a[i]"))
Out[5]: {'i': i}
In [6]: pystr_to_symbolic("a.b").free_symbols
Out[6]: {a.b}
In [7]: names_in_ast(parse("a.b"))
Out[7]: ['a']
In [8]: symlist(pystr_to_symbolic("a.b"))
Out[8]: {'a.b': a.b}
In [9]: pystr_to_symbolic("a.b[i]").free_symbols
Out[9]: {a.b(i)}
In [10]: names_in_ast(parse("a.b[i]"))
Out[10]: ['a', 'i']
In [11]: symlist(pystr_to_symbolic("a.b[i]"))
Out[11]: {'a.b(i)': a.b(i)}
In our sympy layer, there exist multiple implementations to query symbols in a symbolic expression. They give vastly different results for various expressions:
We should:
For consistent specifications there must be consistent return values.