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

Coq translator: efficient array and integer literals #1530

Merged
merged 3 commits into from
Dec 3, 2021

Conversation

eddywestbrook
Copy link
Contributor

Previously, the SAW-core-to-Coq translator would translate array literals to successive applications of the Vector.cons constructor, which is really slow for large arrays. This PR changes the translation of array literals to use Vector.of_list of Coq list literals, which seems to be much faster for large vectors.

Additionally, this PR changes the translation of natural number literals that are big enough (currently defined as greater than 20) to explicitly convert from the Coq integer notation rather than use the natural number notation. Note that Coq already does this anyway under the hood but prints a warning, so this change really just gets rid of the warning.

@eddywestbrook eddywestbrook added the subsystem: saw-core-coq Issues related to converting saw-core to Gallina for use with the Coq/Rocq theorem prover label Dec 1, 2021
@eddywestbrook
Copy link
Contributor Author

Well, drat, the change to the nat literals messes with some of our existing Heapster proofs if it happens for natural numbers like 64 that we are explicitly using in some of our specs. And anyway, Coq doesn't complain until the nats get up into the thousands. So I'm changing "too big" for nat literals to be greater than 1,000.

Copy link
Contributor

@brianhuffman brianhuffman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The overall diff looks good and small, but why are there 23 different commits? Most of them are changes to unrelated files that are apparently canceled out by other merge commits.

Please cherrypick these 3 commits that are actually relevant to this patch: 9879419, f83f010, 966ab60

@brianhuffman brianhuffman force-pushed the saw-core-coq/efficient-arrays-int-lits branch from 15ac002 to 668f357 Compare December 2, 2021 23:07
@brianhuffman brianhuffman self-requested a review December 2, 2021 23:08
@eddywestbrook eddywestbrook added the PR: ready to merge Magic flag for pull requests to ask Mergify to merge given an approval and a successful CI run label Dec 2, 2021
@mergify mergify bot merged commit d8d4776 into master Dec 3, 2021
@mergify mergify bot deleted the saw-core-coq/efficient-arrays-int-lits branch December 3, 2021 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: ready to merge Magic flag for pull requests to ask Mergify to merge given an approval and a successful CI run subsystem: saw-core-coq Issues related to converting saw-core to Gallina for use with the Coq/Rocq theorem prover
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants