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

feat: import Unicode libraries #4780

Merged
merged 24 commits into from
Nov 15, 2023

Conversation

alex-chew
Copy link
Contributor

@alex-chew alex-chew commented Nov 15, 2023

This PR imports the Unicode libraries from dafny-lang/libraries.

Notes:

  • This disables redundant- and contradictory-assumptions warnings in dfyconfig.toml, as not all of the many false-positives can be resolved by rewriting existing proofs (as far as I can tell). We'll want to re-enable them in the future, for example if/when finer-grained control of such warnings is possible.
  • As a consequence of the above, verification performance of all the libraries are subject to perturbation. This PR also makes some non-Unicode-related changes to get other proofs to pass under the new set of options.
  • Because the DafnyStdLibs only supports a single set of verification options right now, and we are proceeding with --unicode-char:true, the UnicodeStringsWithoutUnicodeChar module is not included in this PR.

TODO:

  • Examples + test coverage
  • Top-level module documentation

Description

How has this been tested?

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

@alex-chew alex-chew marked this pull request as ready for review November 15, 2023 20:26
@alex-chew alex-chew linked an issue Nov 15, 2023 that may be closed by this pull request
Copy link
Member

@robin-aws robin-aws left a comment

Choose a reason for hiding this comment

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

LGTM, very nice testing coverage on this one

@@ -10,6 +10,10 @@ DOO_FILE_ARITHMETIC_TARGET=binaries/DafnyStandardLibraries-arithmetic.doo

all: check-binary test check-format check-examples

verify:
Copy link
Member

Choose a reason for hiding this comment

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

Nice improvements! I had some of these as part of the FileIO import too, especially since the build will change per language too. I did find a slightly cleaner approach but I can apply that in my PR instead of insisting on it here.


module Helpers {
import opened DafnyStdLibs.Wrappers
// TODO: consider tweaking /testContracts to support this use case better.
Copy link
Member

Choose a reason for hiding this comment

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

+1, and would prefer an issue to a TODO, but don't want to block on it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just copied this comment over from where Helpers was originally defined, but here's a new issue for it: #4786

Comment on lines +14 to +16
// This top-level module contains no definitions.
// It exists to enable import between child modules,
// and so that its doc comment appears in generated documentation.
Copy link
Member

Choose a reason for hiding this comment

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

This is a good point and too bad we can't do the same for the top level DafnyStdLibs module since it has to appear in multiple doo files. But could hopefully address that somehow in the future.

@robin-aws robin-aws merged commit f81c316 into dafny-lang:master Nov 15, 2023
20 checks passed
@alex-chew alex-chew deleted the feat/libraries-unicode branch November 15, 2023 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Standard library: Unicode
2 participants