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

Impossible to specify type characteristics when export provides #4379

Open
MikaelMayer opened this issue Aug 3, 2023 · 0 comments
Open

Impossible to specify type characteristics when export provides #4379

MikaelMayer opened this issue Aug 3, 2023 · 0 comments
Labels
kind: enhancement Enhancements, feature requests, etc. These are NOT bugs, but ways we can improve Dafny part: language definition Relating to the Dafny language definition itself

Comments

@MikaelMayer
Copy link
Member

Dafny version

4.2.0

Code to produce this issue

module DatatypeHider {
  export provides Test, Test.Number

  datatype Test = Test(i: nat)
  {
    function Number(): nat {
      i
    }
  }
}
module DatatypeUser {
  import opened DatatypeHider

  predicate Test() {
    forall t: Test :: true // Error: a forall expression involved in a predicate definition is not allowed to depend on the set of allocated references, but values of 't' (of type 'Test') may contain references
  }
}

Command to run and resulting output

dafny verify

What happened?

I'm exporting a datatype but I want to hide its constructors.
I would still export the fact that this datatype is not allocated though, otherwise, I can't quantify on all of them.
I did not find a mechanism to do that. We should be able to do something like

export provides Test(!new)

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

Windows

@MikaelMayer MikaelMayer added the kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label label Aug 3, 2023
@keyboardDrummer keyboardDrummer added kind: enhancement Enhancements, feature requests, etc. These are NOT bugs, but ways we can improve Dafny part: language definition Relating to the Dafny language definition itself and removed kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label labels Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: enhancement Enhancements, feature requests, etc. These are NOT bugs, but ways we can improve Dafny part: language definition Relating to the Dafny language definition itself
Projects
None yet
Development

No branches or pull requests

2 participants