dafny icon indicating copy to clipboard operation
dafny copied to clipboard

C# Wrong Result: Multi-level Multisets

Open alex-usher opened this issue 2 years ago • 1 comments

Dafny version

4.1.0

Code to produce this issue

method Main() {
	var a: multiset<bool> := multiset{false, true};
	var b: multiset<multiset<bool>> := multiset{a[true := 0]};

	print b == multiset{multiset{false}}, "\n";
}

Command to run and resulting output

$ dafny /compile:4 main.dfy

Dafny program verifier finished with 1 verified, 0 errors
Running...

false

$ dafny /compile:4 /compileTarget:js main.dfy

Dafny program verifier finished with 1 verified, 0 errors
Running...

true

What happened?

The above program verifies and compiles successfully to all backends, but the C# backend will print false while all others will print true (where true would be the expected case).

What type of operating system are you experiencing the problem on?

Linux, Mac

alex-usher avatar May 15 '23 17:05 alex-usher

Hi, just wanted to ping this issue as I believe it may be a soundness wrong result :)

alex-usher avatar Oct 23 '23 20:10 alex-usher

Reopening because we had to revert the PR to fix nightly: https://github.com/dafny-lang/dafny/pull/5492

robin-aws avatar May 27 '24 16:05 robin-aws