-
Notifications
You must be signed in to change notification settings - Fork 16
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
Bool #391
Bool #391
Conversation
Thanks!
Feel free do do so, some code base cleanup is always welcome and one of the points of this modification is to make the type-checker simpler.
As stated in #393, there are other problems in the preprocessor, so maybe we can have another PR dealing with syntax. Also, I'm not sure we are completely decided about removing
This is indeed a nice improvement in the error message!
That makes sense and I believe this makes gospel a bit more natural from a programmer point of view :-)
This was to be expected but your idea of using
No need to make another PR! This one is already great!
If in situation |
Hello There are some functions in the |
Ok, I think this is all I want to do. Besides the unification of the type of booleans and propositions, I need some refactoring, which consisted mostly of removing redundant checks. One of them was checking if a function's spec had no undefined variables. I removed the check, but kept the function that collects all the free variables since it may be useful at some point down the line. |
There are some conflicts that need to be resolved. This would be a shame to lose the benefit of this PR! |
Hello I have resolved the conflicts, but one of the checks failed, specifically with regards to the changelog. I'm not sure what I did wrong :( |
Thanks! |
Yes I had already mentioned that I accidentally had the commits for the identifiers PR in this one.
And you said
But yes, it is a bit awkward :| As for the changelog, I will add an entry to it ASAP. |
Yes, but what puzzles me is that it seems to be a mix of commits from both PRs now. |
But I believe a rebase on main is necessary as the PR seems to remove some changes done by previous ones. |
For review purpose I've rebased the PR on main there. Apart from the rebasing, I've allowed myself to run ocamlformat on each commit and reformat the commit messages. I've noticed that @mariojppereira do you still want to review this PR? |
Ok, I reset the branch with the commits from your rebase, I think everything should be in order. I'll try and rename some of the commit messages tomorrow. Regarding |
ocaml-ci failling seems unrelated. I believe the PR is just waiting for on entry in the changelog to be mergeable. @mariojppereira did you had a chance to look at it? |
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.
Thanks.
I would have enjoyed a bit of context in the commit messages when you remove redundant checks (a pointer to where they have already been done for example). But the core of the PR, which is removing the prop
type is well handled. Thanks again.
Should I wait for @mariojppereira approval to merge?
CI failing: you should run ocamlformat on the penultimate commit. |
I've just spotted that the changelog is still update in the 0.3.0 section. |
Approved and CI happy, merging. |
Hello
This pull request changes the Gospel typed AST so that the types of terms are represented with
ty
instead ofty option
, thereby eliminating the distinction between terms that evaluate tobool
and propositions. This also means that programs are no longer transformed to turn bools into props. A few caveats:variant
clause didn't pass because now the error message is different. The ill typed program wasvariant i = 0
. The old error message was "A term was expected" and the new error message is now "this term has type bool but was expected a value of type integer". In my opinion this message is a bit more clear, but I'm wondering what you think. Another test that failed was one where a predicate is used as an argument for a higher order function that receives a function of type'a -> bool
. This is now valid under the new typechecker, I suppose this is fine? Another test that failed was the location test, but that is only because it dumps the entire ast, so any changes are always gonna effect it. (side note: this test seems very fragile, may I change it in a future commit so it uses grep and only prints the locations?)Edit: I just realised that I also have the commits for the path pr here :|, not sure if I should do another pr or if we should wrap up the identifiers one first.