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

Remove and replace the coercion mechanism #433

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

n-osborne
Copy link
Contributor

Fixes #432

This PR is in two fold:

  1. provide default models to types that are subject to the coercion mechanism (and update the tests accordingly)
  2. remove the coercion mechanism

In order to provide the default models, the PR proposes to open an Annotated_stdlib module at the beginning of every module inspected by the Gospel type-checker (apart from some exceptions like itself, the OCaml standard library and the Gospel one).

The default models are:

  • model v of type integer for the OCaml type int
  • model array_content of type 'a sequence for the OCaml type 'a array
  • model list_content of type 'a sequence for the OCaml type 'a list

Naming is clearly open to discussion!

This is obviously increasing the verbosity of the specifications, at least the one written in the tests.
This point is clearly an argument in favor of removing the name of the models as suggested by @mrjazzybread in #392

Comments are very welcome.

The commit puts in place the same mechanism than the one for
`Gospelstdlib`. The `Annotated_stdlib` uses type alias to give a
logical model to the type `int`.
Use `int`'s model rather than coercion in documentation and tests.
Use the default model rather than the coercion mechanism in tests. For
clarity reasons the model can be re-stated in the documentation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Removing coercions
1 participant