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

Language server does not seem to respect options in project file #4703

Closed
fzaiser opened this issue Oct 20, 2023 · 0 comments · Fixed by #4705
Closed

Language server does not seem to respect options in project file #4703

fzaiser opened this issue Oct 20, 2023 · 0 comments · Fixed by #4705
Labels
kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label

Comments

@fzaiser
Copy link

fzaiser commented Oct 20, 2023

Dafny version

4.3.0

Code to produce this issue

$ cat dfyconfig.toml
includes = ["Test.dfy"]

[options]
disable-nonlinear-arithmetic = true
$ cat Test.dfy
lemma Test(a: real, b: real)
  requires b != 0.0
  ensures a / b == 1.0 / b * a
{}

Command to run and resulting output

$ dafny verify dfyconfig.toml
Test.dfy(4,0): Error: a postcondition could not be proved on this return path
  |
4 | {}
  | ^

Test.dfy(3,10): Related location: this is the postcondition that could not be proved
  |
3 |   ensures a / b == 1.0 / b * a
  |           ^^^^^^^^^^^^^^^^^^^^


Dafny program verifier finished with 1 verified, 1 error

What happened?

dafny verify correctly complains because nonlinear arithmetic is disabled. But in VS Code, the lemma verifies. It seems that the language server ignores the option --disable-nonlinear-arithmetic in the project file.

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

Mac

@fzaiser fzaiser added the kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label label Oct 20, 2023
keyboardDrummer added a commit that referenced this issue Oct 23, 2023
Fixes #4703

### Description
Enable the language server to use the options
`disable-nonlinear-arithmetic` and the Z3 executable path, when they are
specified in the project file

### How has this been tested?
A XUnit test has been added for `disable-nonlinear-arithmetic`

<small>By submitting this pull request, I confirm that my contribution
is made under the terms of the [MIT
license](https://github.com/dafny-lang/dafny/blob/master/LICENSE.txt).</small>
atomb pushed a commit that referenced this issue Oct 23, 2023
Fixes #4703

### Description
Enable the language server to use the options
`disable-nonlinear-arithmetic` and the Z3 executable path, when they are
specified in the project file

### How has this been tested?
A XUnit test has been added for `disable-nonlinear-arithmetic`

<small>By submitting this pull request, I confirm that my contribution
is made under the terms of the [MIT
license](https://github.com/dafny-lang/dafny/blob/master/LICENSE.txt).</small>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant