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

Allow to write predicates without question marks #682

Open
facundominguez opened this issue Mar 6, 2024 · 6 comments
Open

Allow to write predicates without question marks #682

facundominguez opened this issue Mar 6, 2024 · 6 comments

Comments

@facundominguez
Copy link
Collaborator

Recently #678 introduced the ability to write predicates inside other expressions by using a question mark.

This issue is to investigate if we can remove the question mark.

@facundominguez
Copy link
Collaborator Author

I'm guessing we could use some insight on why liquid-fixpoint has separate parsers for predicates and expressions.

Is the difference between a predicate and an expression only about the operators that they use?

I think that by removing the question mark, the grammar becomes left recursive via: expr0P -> predP -> pred0P -> predrP -> exprP -> expr1P -> expr0P. But I'd like to understand better the motivation of the current implementation ahead of considering changes.

@ranjitjhala
Copy link
Member

@facundominguez the honest answer is it is just a quirk of history. Originally we had separate types Expr and Pred and the former were not supposed to be bool valued, but over time this became untenable and so they are all really just a single type BUT the parser somehow still kept this (needless) stratification… so really no good technical reason!

@facundominguez
Copy link
Collaborator Author

Thanks @ranjitjhala. That is helpful to know. In that case, probably we should try consolidating the parsers.

@ranjitjhala
Copy link
Member

indeed though even better may be to switch over to a full SMTLIB style prefix-parens syntax …

@facundominguez
Copy link
Collaborator Author

... yes, Ranjit, please start a new issue if you want to change the user interface that far :)

Please correct me if I'm wrong: if Liquid Haskell continues to use the current language, only removing the question mark might still worth the trouble.

@ranjitjhala
Copy link
Member

Yup, you’re right! :-)

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

2 participants