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
Properly parse qualified identifiers #3111
Conversation
…structors, disable others
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, one minor suggestion.
I didn't have time to look at this in detail yet. One high-level comment that I have: We have decided to move logic out of the parser files as much as possible (to make it easier to move away from ANTLR3) but this PR adds quite a bit of logic in the parser file itself. Is there any chance that we could move this code to the parser class? |
I agree we should move code to the parser files. This PR actually doesn't add much code, it just rearranges it. Perhaps we should do this on a followup PR? |
Co-Authored-By: Mathias Preiner <mathias.preiner@gmail.com>
Yes, I think it's a good idea to move the logic to the parser files in a follow-up PR. |
Ready to merge? |
I think we should still wait to get a second review for that. @4tXJ7f do you have any time soon to do a quick review? |
I'll try to do it tomorrow evening (Thursday). |
Co-Authored-By: Aina Niemetz <aina.niemetz@gmail.com>
Co-Authored-By: Aina Niemetz <aina.niemetz@gmail.com>
This refactors the smt2 parser so that it properly parses qualified identifiers (the generic form of function application heads in smt2). This required refactoring of the termNonVariable grammar in Smt2.g.
Specifically:
as
, (2) function variables applied to argument list (3) indexed functions applied to argument list, and (4) array constants, which can be seen as(as const (Array T1 T2))
applied to an argument.These are now all cases of a qualified identifier (
qualIdentifier
) applied to argument list, which follows terms in section 3.6 of http://smtlib.cs.uiowa.edu/papers/smt-lib-reference-v2.6-r2017-07-18.pdf.identifier
, following the definition of identifier in section 3.3 of http://smtlib.cs.uiowa.edu/papers/smt-lib-reference-v2.6-r2017-07-18.pdf.This fixes #2832.