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

Provide generic helper functions to turn Coq terms into ocaml values and vice versa #9

Merged
merged 5 commits into from
Mar 7, 2019

Conversation

lthms
Copy link
Owner

@lthms lthms commented Mar 6, 2019

  • Support ascii (char) [prior to this PR]
  • Support string (string) [prior to this PR]
  • Partial support Z (int)
  • Support bool (bool)

@lthms
Copy link
Owner Author

lthms commented Mar 6, 2019

Until coq-8.10 is out, I would want to use coq-prelude' signed.t (Definition i63 := signed.t 63`) to deal with bounded signed integers.

What do you think?

@yurug
Copy link
Collaborator

yurug commented Mar 6, 2019

I guess that bounded signed/unsigned integers are indeed the adequate types to interact with OCaml-level integers.

Now, to develop certified applications, I would prefer arbitrary precision arithmetic if possible to avoid overflow-related bugs.

The two kinds of integers should probably coexist in a the library.

@lthms lthms requested a review from yurug March 7, 2019 09:20
@lthms
Copy link
Owner Author

lthms commented Mar 7, 2019

Since Vincent will need to work with Z, I propose to merge that PR as-is (if you could just have a quick look, @yurug, that would be awesome). Vincent will have to write the conversion from Ocaml to Coq, but it can be a good exercise.

exec/src/coqbool.ml Show resolved Hide resolved
exec/src/coqnum.mli Show resolved Hide resolved
stdlib/debug/theories/Debug.v Show resolved Hide resolved
@yurug
Copy link
Collaborator

yurug commented Mar 7, 2019

Nothing significant to say. You can merge this even if some refactoring might be needed at some point to make explicit good combinators for deconstruction of Coq values.

yurug
yurug previously approved these changes Mar 7, 2019
@lthms
Copy link
Owner Author

lthms commented Mar 7, 2019

Thanks. I will rework it a bit to address your comments, and then merge it.

Thanks your the review! You can tell Vincent this will be ready this afternoon.

@lthms lthms merged commit 17ab96d into lthms:master Mar 7, 2019
@lthms lthms changed the title wip: Provide generic helper functions to turn Coq terms into ocaml values and vice versa Provide generic helper functions to turn Coq terms into ocaml values and vice versa Mar 7, 2019
@lthms lthms deleted the coq-types branch March 7, 2019 12:22
@lthms lthms added kind | feature Adding something to FreeSpec that cannot be done with existing code kind | refactor Improving the code quality of the project target | exec labels Mar 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind | feature Adding something to FreeSpec that cannot be done with existing code kind | refactor Improving the code quality of the project target | exec
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants