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

Resolver falsely flags import of compiled module as abstract #5968

Open
ssomayyajula opened this issue Dec 9, 2024 · 1 comment
Open

Resolver falsely flags import of compiled module as abstract #5968

ssomayyajula opened this issue Dec 9, 2024 · 1 comment
Labels
incompleteness Things that Dafny should be able to prove, but can't kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label part: resolver Resolution and typechecking

Comments

@ssomayyajula
Copy link
Contributor

Dafny version

latest

Code to produce this issue

abstract module Base { }

abstract module Parent {
  import Child: Base
}

abstract module RenamedBase refines Base {
  // renames members of Base for my domain
}

// analogous to RenamedBase
abstract module RenamedParent {
  import RenamedChild: RenamedBase
  import Child = RenamedChild
}

module ConcreteBase1 refines Base { }

module ConcreteParent1 refines Parent {
  import Child = ConcreteBase1
}

module ConcreteBase2 refines RenamedBase { }

module ConcreteParent2 refines RenamedParent {
  // Error: a compiled module (ConcreteParent2) is not allowed to import an abstract module (RenamedChild)
  import RenamedChild = ConcreteBase2
}

Command to run and resulting output

dafny verify --type-system-refresh

What happened?

The reported error does not occur for ConcreteParent1 but for ConcreteParent2, which implies that the resolver does not consider transitive imports of compiled modules as compiled, even though it should (of course, Child cannot be re-imported).

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

Mac

@ssomayyajula ssomayyajula added kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label part: resolver Resolution and typechecking incompleteness Things that Dafny should be able to prove, but can't labels Dec 9, 2024
@RustanLeino
Copy link
Collaborator

Yes, that's a bug. Thanks for finding and reporting it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
incompleteness Things that Dafny should be able to prove, but can't kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label part: resolver Resolution and typechecking
Projects
None yet
Development

No branches or pull requests

2 participants