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

Make SymbolicDFA accept SymPy symbols as keys of propositional interpretations #104

Open
marcofavorito opened this issue May 24, 2020 · 0 comments

Comments

@marcofavorito
Copy link
Member

Is your feature request related to a problem? Please describe.
The following code does not work:

from pythomata.impl.symbolic import SymbolicDFA
from sympy import symbols
a = symbols("a")
dfa = SymbolicDFA()
dfa.create_state()
dfa.add_transition((0, a, 1))
dfa.set_accepting_state(1, True)

# returns True, correctly
dfa.accepts([{"a": True}])

# it raises ValueError: Symbol {a: True} is not valid.
dfa.accepts([{a: True}])

The reason is that SymbolicDFA.accepts accepts only PropositionalInterpretation whose labels are of type str and not sympy.Symbol.

Describe the solution you'd like
Make it work. That is, try to be more flexible on the data validation in SymbolicDFA.accepts.

Describe alternatives you've considered
n/a

Additional context
n/a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant