Skip to content

C# Wrong Result: Multi-level Multisets #4011

@alex-usher

Description

@alex-usher

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

Metadata

Metadata

Assignees

Labels

during 4: bad execution of correct programA bug in the Dafny compiler that causes a correct Dafny program to execute incorrectlykind: bugCrashes, unsoundness, incorrect output, etc. If possible, add a `part:` labellang: c#Dafny's C# transpiler and its runtimepart: code-generationSupport for transpiling Dafny to another language. If relevant, add a `lang:` tagpriority: nextWill consider working on this after in progress work is done

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions