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

tests: Add an example to show how to interop Dafny and C# #1769

Merged
merged 16 commits into from
Feb 22, 2022

Conversation

cpitclaudel
Copy link
Member

@cpitclaudel cpitclaudel commented Jan 27, 2022

Here's the demo I gave recently, repackaged as a test. I haven't added it to the CI yet (I'm missing the lit header), but the rest is ready for review. I wrote a bit of documentation in the C# and Dafny files, so I'd appreciate some proofreading ^^

CCing @RustanLeino since you asked about how nice the proofs looked.

@cpitclaudel cpitclaudel added the misc: tests New tests or tutorials label Jan 27, 2022
Co-authored-by: Fabio Madge <fabio@madge.me>
@cpitclaudel
Copy link
Member Author

Looks like the MacOS tests are failing as well; not sure if this is related.

Error: /Users/runner/.dotnet/sdk/6.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(550,5): error NETSDK1177: Failed to sign apphost with error code 0: /Users/runner/work/dafny/dafny/dafny/Source/DafnyServer/obj/Release/net6.0/osx-x64/apphost: No such file or directory [/Users/runner/work/dafny/dafny/dafny/Source/DafnyServer/DafnyServer.csproj]

keyboardDrummer
keyboardDrummer previously approved these changes Feb 2, 2022
Copy link
Member

@keyboardDrummer keyboardDrummer left a comment

Choose a reason for hiding this comment

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

Great example! Very nice :-)

Test/tutorial/Simple_compiler/Compiler.dfy Outdated Show resolved Hide resolved
Test/tutorial/Simple_compiler/Compiler.dfy Show resolved Hide resolved
Test/tutorial/Simple_compiler/Compiler.dfy Outdated Show resolved Hide resolved
Test/tutorial/Simple_compiler/Compiler.dfy Outdated Show resolved Hide resolved
Test/tutorial/Simple_compiler/Compiler.dfy Outdated Show resolved Hide resolved
Copy link
Member

@MikaelMayer MikaelMayer left a comment

Choose a reason for hiding this comment

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

Looks great, I can't wait to have Dafny running Dafny !

Source/IntegrationTests/LitTests.cs Outdated Show resolved Hide resolved
Test/tutorial/Simple_compiler/README.md Outdated Show resolved Hide resolved
@cpitclaudel
Copy link
Member Author

Thanks @MikaelMayer and @keyboardDrummer for the reviews! @keyboardDrummer , I added an additional constructor for inputs. The commit that implements that is 4ea62c8 . Could you have a look and tell me whether you think the added complexity is worth it? Personally I like it, I think it makes the example a bit more realistic!

The theorem you were expecting is in a separate commit at 2272b16

Copy link
Member

@keyboardDrummer keyboardDrummer left a comment

Choose a reason for hiding this comment

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

Apart from the FIXME and WISH, looks good to me.

Test/tutorial/Simple_compiler/Compiler.dfy Outdated Show resolved Hide resolved
Test/tutorial/Simple_compiler/Compiler.dfy Outdated Show resolved Hide resolved
@cpitclaudel cpitclaudel self-assigned this Feb 8, 2022
@cpitclaudel cpitclaudel force-pushed the cpitclaudel_interop_test branch from 2e8022e to fa38e8c Compare February 18, 2022 18:14
@cpitclaudel cpitclaudel enabled auto-merge (squash) February 22, 2022 16:37
@cpitclaudel cpitclaudel merged commit 365f937 into dafny-lang:master Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
misc: tests New tests or tutorials
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants