-
Notifications
You must be signed in to change notification settings - Fork 38
new parser for lp files #1129
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
base: master
Are you sure you want to change the base?
new parser for lp files #1129
Conversation
@@ -210,7 +210,7 @@ query: | |||
| TYPE_QUERY t=term | |||
{ make_pos $sloc (P_query_infer(t, {strategy=NONE; steps=None}))} | |||
| SEARCH s=STRINGLIT | |||
{ make_pos $sloc (P_query_search s) } | |||
{ make_pos $sloc (P_query_search(QBase(QName s))) } |
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.
looks wrong
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.
this is a temporary fix for the old parser to compile
Since you are working on the parser, the old parser did not accept binders of the form "id+ : term", it only accepted "id+" or "(id+ : term)" (and many more variations). This was a limitation of the Menhir technology (a shift/reduce conflict). In the Rocq parser me and Abdelghani have just written in Bologna, we managed to accept that combination (that is valid in Rocq) by having Menhir parse a larger grammar and then check if the input made sense in the OCaml code. I think that it would make sense to also accept the missing case in your new parser. |
This PR provides a new parser for lp files not based on Menhir but written by hand. It is more efficient, provides better error messages and is easier to change later if needed.
It also integrates search queries properly.
Performance of parsing on the translation to lp of the HOL-Light base file hol.ml (1.2 Go): 1m22s with the master branch, and 1m8s with the PR: -16%.
TODO: