-
Notifications
You must be signed in to change notification settings - Fork 0
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 type annotations #11
Conversation
ok: infer_based_on_annotations error: check_annotations ... correctly sat but failing to parse output
Annotated programs that were introduced are - anfold_fun_list_make_list - risers - indirectintro9 - indirectintro app
This is now ready to be merged.
@moratorium08 Do you want to review this or can I just merge it? Let me also write down some areas for improvements (which I'm not going to address in this PR).
|
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.
There are some concerns as follows, but overall, this change looks fine:
- What happens if invalid refinement types, such as not well-formed ones, are provided?
--remove-disjunctions
breaks the structure of fixpoints (e.g., by introducing another variable or continuations). But it’s fine to leave this for future work.- Why does input/annot/ only include ML files? If you expect
ocaml2hfl
functionality in MoCHi, it would be better to provide generated HFL(Z) files since the annotation targets HFL(Z).
try | ||
Stdlib.List.assoc name !map | ||
with Not_found -> | ||
let x = Id.gen ~name `Int in |
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.
I'm not sure what happens if we assume well-formedness for refinement types.
It might be better that when users write a non-well-formed type, the program fails with some error.
Since this change does not break the current functionality, you can merge it whenever you’re ready. |
Now we invoke the infer function after the type environemnt has been modified
Now we invoke the infer function after the type environemnt has been modified
As for 3, I just forgot to add it. I'll added them (and force pushed) now. Actually, I was planning to add only the |
I won't address 1 and 2 for now, but those are good catches. |
This PR allows users to annotate formulas with refinement types.
The refinement types should be written in a separate
*.annot
file.TODOs: