Skip to content

Dafny IR does not generate modules in dependency order anymore #5788

@dnezam

Description

@dnezam

Dafny version

4.8.0

Code to produce this issue

No response

Command to run and resulting output

No response

What happened?

Previously, the Dafny IR generated modules in a linear and topologically sorted order which the Dafny to CakeML compiler relied on. However, updating to the current master branch broke this behavior: for example, the default module _module is now mentioned first. Since the Dafny Reference mentions that it will figure out a topological order (emphasis mine)

(4.7. Module Ordering and Dependencies) "In particular, there must be a way to order the modules in a program such that each only refers to things defined before it in the ordering. [...] Dafny will figure out that order for you, assuming you haven’t made any circular references. "

I really would like to utilize it. I confirmed that the offending PR is #5684. If possible, it would be nice if this could be reverted for now to make sure that the CakeML compiler does not drift apart too much. If something downstream of the Rust compiler relies on this, perhaps it could be added there.

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

Linux

Metadata

Metadata

Assignees

Labels

kind: bugCrashes, unsoundness, incorrect output, etc. If possible, add a `part:` label

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions