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

Update tests to work with Z3 4.12.1 #3400

Merged
merged 110 commits into from
Feb 28, 2023
Merged
Show file tree
Hide file tree
Changes from 38 commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
aec5aa0
Reorder output of several tests
atomb Jan 24, 2023
534a69f
Bump libraries submodule
atomb Jan 24, 2023
e461695
Update CI to use Z3 4.11.2
atomb Jan 24, 2023
da2ee9b
Roughly update some tests to work with Z3 4.11.2
atomb Jan 24, 2023
a23e889
Update Z3 download URLs
atomb Jan 24, 2023
27429e4
Remove errant newline
atomb Jan 24, 2023
f092846
Fix ordering in expected output of doc test
atomb Jan 25, 2023
03e3a13
Fix Z3 option used in test generation
atomb Jan 26, 2023
36417d9
Allow a few more tests to pass
atomb Jan 26, 2023
ded3d93
Speed up a test
atomb Jan 26, 2023
0eff6ce
Update expected output
atomb Jan 26, 2023
b7e6f51
Temporarily disable a few hard proofs
atomb Jan 26, 2023
f817274
Update SnapshotableTrees.dfy to be easier
atomb Jan 26, 2023
2547af7
Speed up BreadthFirstSearch
atomb Jan 26, 2023
b20ee60
Allow ACL2-extractor to go through
atomb Jan 26, 2023
1e82a0e
Reduce timeout likelihood for MutexLifetime-short
atomb Jan 26, 2023
7b72ca7
Simplify Z3 version check in language server
atomb Jan 27, 2023
6c6be0c
Adjust assertion order in language server test
atomb Jan 27, 2023
671697c
Upgrade to Z3 4.12.1
atomb Jan 27, 2023
e30100d
Update a test to skip a check no longer relevant
atomb Jan 27, 2023
f1176b0
Update test for different models with newer Z3
atomb Jan 28, 2023
e0d3134
Update order of error messages
atomb Jan 28, 2023
97f2e78
Fix previously-broken test update
atomb Jan 28, 2023
0d01cf7
Change what Dafny's expected to prove in one case
atomb Jan 28, 2023
4acf36a
Speed up a verification by splitting assertions
atomb Jan 28, 2023
b031987
Update download URL for Linux Z3 releases
atomb Jan 30, 2023
c6833a9
Update TestGeneration tests to be more permissive
atomb Jan 30, 2023
c2866ac
Avoid missing errors in BitvectorsMore
atomb Jan 31, 2023
17ca607
Speed up dafny2/SnapshotableTrees.dfy
atomb Jan 31, 2023
ca920f9
Attempt XUnit tests on ubuntu-22.04
atomb Jan 31, 2023
b612552
Update all ubuntu-20.04 to ubuntu-22.04
atomb Feb 1, 2023
0fd95ca
Get a few more tests passing with Z3 4.12.1
atomb Feb 2, 2023
c1a37e4
Split out test of all-literals axiom
atomb Feb 2, 2023
89b458b
Update fuel tests
atomb Feb 2, 2023
a5a9020
Bump libraries submodule
atomb Feb 6, 2023
a5935db
Merge remote-tracking branch 'upstream/master' into update-tests-z3-4…
atomb Feb 6, 2023
c2e978f
Update fuel tests -- TODO: needs careful thought!
atomb Feb 6, 2023
477c51e
Remove overly restrictive checks from test generation tests
atomb Feb 7, 2023
fdba438
Merge remote-tracking branch 'upstream/master' into update-tests-z3-4…
atomb Feb 9, 2023
dcea69b
Revert "Attempt XUnit tests on ubuntu-22.04"
atomb Feb 11, 2023
7230d01
Revert "Update all ubuntu-20.04 to ubuntu-22.04"
atomb Feb 11, 2023
2e8c1c7
Try Z3 4.12.2 nightly
atomb Feb 11, 2023
2e856a6
Merge remote-tracking branch 'upstream/master' into update-tests-z3-4…
atomb Feb 13, 2023
5fe892c
Merge remote-tracking branch 'upstream/master' into update-tests-z3-4…
atomb Feb 15, 2023
0be00ac
Add more debug output to language server tests
atomb Feb 15, 2023
91c8efe
Use nightly builds in Makefile, too
atomb Feb 16, 2023
c04ee95
Use `/errorLimit:0` to allow all errors through
atomb Feb 16, 2023
ba8c6d1
Enable the proof of a difficult postcondition
atomb Feb 16, 2023
011b21f
Apply suggestion from @Dargones
atomb Feb 16, 2023
178915d
Merge remote-tracking branch 'upstream/master' into update-tests-z3-4…
atomb Feb 16, 2023
64bb1d0
Merge remote-tracking branch 'upstream/master' into update-tests-z3-4…
atomb Feb 17, 2023
dd6a5ae
Use custom-built Z3 binaries
atomb Feb 17, 2023
5c5d349
Fix some Z3 setup typos
atomb Feb 17, 2023
06fb478
Fix some more Z3-related paths
atomb Feb 17, 2023
e2ecab6
Merge remote-tracking branch 'upstream/master' into update-tests-z3-4…
atomb Feb 20, 2023
5218862
Log memory use around verification in language server
atomb Feb 20, 2023
c082a01
Run language server tests with one thread
atomb Feb 20, 2023
deda3f8
More deterministic test of --error-limit
atomb Feb 20, 2023
809b1d1
Temporarily disable the two most expensive tests
atomb Feb 21, 2023
d0ae816
Revert "Temporarily disable the two most expensive tests"
atomb Feb 21, 2023
3a31c38
Merge remote-tracking branch 'upstream/master' into update-tests-z3-4…
atomb Feb 21, 2023
6a9f3ab
Install Z3 4.8.5 _and_ 4.12.1 in CI and packaging
atomb Feb 21, 2023
846de6d
Set %z3 correctly for lit-style tests
atomb Feb 21, 2023
70ff9c4
Try running language server tests with Z3 4.8.5
atomb Feb 21, 2023
7793799
Revert XUnit configuration to release builds
atomb Feb 21, 2023
6e159d1
Fix typo
atomb Feb 21, 2023
65a2516
Fix typo
atomb Feb 21, 2023
7442149
Typo
atomb Feb 22, 2023
d9169a3
Make xUnit test tolerate other Z3 processes
atomb Feb 22, 2023
d44704f
Fix Z3 move on non-Windows
atomb Feb 22, 2023
1f47358
Fix z3 version printing for release workflows
atomb Feb 22, 2023
4d61647
Merge remote-tracking branch 'upstream/master' into update-tests-z3-4…
atomb Feb 22, 2023
98c25f7
Hopefully get xUnit tests working with old setup
atomb Feb 22, 2023
4ca6e61
Fix merge conflict artifact
atomb Feb 23, 2023
355e811
Fix Z3 path
atomb Feb 23, 2023
68f7be8
Undo changes that broke resource use test
atomb Feb 23, 2023
6a114d0
Merge remote-tracking branch 'upstream/master' into update-tests-z3-4…
atomb Feb 23, 2023
228a769
Update build to use both Z3 4.8.5 and 4.12.1
atomb Feb 23, 2023
add1e96
Fix Z3 path typo
atomb Feb 23, 2023
32d9823
Use our builds of Z3 4.8.5 in xUnit tests
atomb Feb 23, 2023
feb2b24
Use macos-11, not macos-latest, in xUnit tests
atomb Feb 23, 2023
f2d6da7
Merge branch 'dual-solvers' into update-tests-z3-4.11.2
atomb Feb 23, 2023
cad7593
Remove merge conflict artifact
atomb Feb 23, 2023
61aaf9e
Undo temporary changes
atomb Feb 23, 2023
6745194
Merge remote-tracking branch 'upstream/master' into update-tests-z3-4…
atomb Feb 23, 2023
50ce749
Fix a couple of test outputs
atomb Feb 23, 2023
6f2b1b6
Merge remote-tracking branch 'upstream/master' into update-tests-z3-4…
atomb Feb 23, 2023
85d5783
Update xUnit tests to Z3 4.12.1
atomb Feb 23, 2023
1081126
Update test results
atomb Feb 23, 2023
50049f8
Get one more test to pass
atomb Feb 23, 2023
6c1b354
Merge remote-tracking branch 'upstream/master' into update-tests-z3-4…
atomb Feb 24, 2023
2daef3a
Merge remote-tracking branch 'upstream/master' into update-tests-z3-4…
atomb Feb 27, 2023
3d59924
Update expected output ordering for Fuel.dfy
atomb Feb 27, 2023
86060d4
Get dafny1/MoreInduction.dfy to pass
atomb Feb 27, 2023
b3b2be5
Merge remote-tracking branch 'upstream/master' into update-tests-z3-4…
atomb Feb 27, 2023
9ddc588
Merge remote-tracking branch 'upstream/master' into update-tests-z3-4…
atomb Feb 27, 2023
8d8e327
Fix expected output order for git-issue-2299.dfy
atomb Feb 27, 2023
f156ca3
Get dafny2/SnapshotableTrees.dfy to pass
atomb Feb 27, 2023
21c6c1a
Change test output order
atomb Feb 28, 2023
ef0923e
One more proof obligation in one case
atomb Feb 28, 2023
910c8d1
Revert "One more proof obligation in one case"
atomb Feb 28, 2023
6592175
Revert "Change test output order"
atomb Feb 28, 2023
0e91d79
One more failed proof in SnapshotableTrees
atomb Feb 28, 2023
66994cc
Get vstte2012/BreadthFirstSearch.dfy working
atomb Feb 28, 2023
259891f
Fix some test outputs
atomb Feb 28, 2023
ab38ecc
Merge remote-tracking branch 'upstream/main-4.0' into update-tests-z3…
atomb Feb 28, 2023
0133584
Resolve conflicts properly
atomb Feb 28, 2023
eae661b
Update mklink command
atomb Feb 28, 2023
fa8053d
Fix tests
atomb Feb 28, 2023
48451aa
Disable output checking of SnapshotableTrees.dfy
atomb Feb 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/check-deep-tests-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

jobs:
check-deep-tests:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Checkout Dafny
uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/doc-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ jobs:
matrix:
include:
- os: ubuntu-latest
z3: z3-4.8.5-x64-ubuntu-16.04
z3: z3-4.12.1-x64-glibc-2.35
chmod: true

env:
solutionPath: Source/Dafny.sln
z3BaseUri: https://github.com/Z3Prover/z3/releases/download/Z3-4.8.5
z3BaseUri: https://github.com/Z3Prover/z3/releases/download/z3-4.12.1
Logging__LogLevel__Microsoft: Debug
steps:
- name: OS
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/integration-tests-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ jobs:
- name: Populate OS list (all platforms)
id: populate-os-list-all
if: inputs.all_platforms
run: echo "os-list=[\"ubuntu-latest\", \"ubuntu-20.04\", \"macos-latest\", \"windows-2019\"]" >> $GITHUB_OUTPUT
run: echo "os-list=[\"ubuntu-latest\", \"ubuntu-22.04\", \"macos-latest\", \"windows-2019\"]" >> $GITHUB_OUTPUT
- name: Populate OS list (one platform)
id: populate-os-list-one
if: "!inputs.all_platforms"
run: echo "os-list=[\"ubuntu-20.04\"]" >> $GITHUB_OUTPUT
run: echo "os-list=[\"ubuntu-22.04\"]" >> $GITHUB_OUTPUT
- name: Populate OS mapping for package.py
id: populate-os-mapping
run: |
echo "os-mapping={\"ubuntu-latest\": \"ubuntu\", \"ubuntu-20.04\": \"ubuntu\", \"macos-latest\": \"osx\", \"windows-2019\": \"win\"}" >> $GITHUB_OUTPUT
echo "os-mapping={\"ubuntu-latest\": \"ubuntu\", \"ubuntu-22.04\": \"ubuntu\", \"macos-latest\": \"osx\", \"windows-2019\": \"win\"}" >> $GITHUB_OUTPUT
- name: Populate target runtime version list (all platforms)
id: populate-target-runtime-version-all
if: inputs.all_platforms
Expand Down Expand Up @@ -64,12 +64,12 @@ jobs:
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.dotnet-version }}
- name: C++ for ubuntu 20.04
if: matrix.os == 'ubuntu-20.04'
- name: C++ for ubuntu 22.04
if: matrix.os == 'ubuntu-22.04'
run: |
sudo apt-get install -y build-essential
- name: Choose the right C++ for ubuntu 20.04
if: matrix.os == 'ubuntu-20.04'
- name: Choose the right C++ for ubuntu 22.04
if: matrix.os == 'ubuntu-22.04'
run: |
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 60
- name: Set up oldest supported JDK
Expand Down Expand Up @@ -116,8 +116,9 @@ jobs:
run: |
sudo apt-get install -qq libarchive-tools
mkdir dafny/Binaries/z3
wget -qO- https://github.com/Z3Prover/z3/releases/download/Z3-4.8.5/z3-4.8.5-x64-ubuntu-16.04.zip | bsdtar -xf - -C dafny/Binaries/z3 --strip-components=1
wget -qO- https://github.com/Z3Prover/z3/releases/download/z3-4.12.1/z3-4.12.1-x64-glibc-2.35.zip | bsdtar -xf - -C dafny/Binaries/z3 --strip-components=1
chmod +x dafny/Binaries/z3/bin/z3
./dafny/Binaries/z3/bin/z3 --version
- name: Run integration tests
if: runner.os == 'Windows'
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/msbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ env:

jobs:
singletons:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Setup dotnet
uses: actions/setup-dotnet@v3
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish-release-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ jobs:
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{env.dotnet-version}}
- name: C++ for ubuntu 20.04
if: matrix.os == 'ubuntu-20.04'
- name: C++ for ubuntu 22.04
if: matrix.os == 'ubuntu-22.04'
run: |
sudo apt-get install -y build-essential
- name: Choose the right C++ for ubuntu 20.04
if: matrix.os == 'ubuntu-20.04'
- name: Choose the right C++ for ubuntu 22.04
if: matrix.os == 'ubuntu-22.04'
run: |
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 60
- name: Set up JDK 18
Expand Down
34 changes: 17 additions & 17 deletions .github/workflows/release-downloads-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:

env:
dotnet-version: 6.0.x # SDK Version for running Dafny (TODO: should this be an older version?)
z3BaseUri: https://github.com/Z3Prover/z3/releases/download/Z3-4.8.5
z3BaseUri: https://github.com/Z3Prover/z3/releases/download/z3-4.12.1

jobs:
test-dafny-cli-tool:
Expand All @@ -28,20 +28,20 @@ jobs:
fail-fast: false
matrix:
# This workflow breaks on windows-2022: https://github.com/dafny-lang/dafny/issues/1906
os: [ ubuntu-latest, ubuntu-20.04, macos-latest, windows-2019 ]
os: [ ubuntu-latest, ubuntu-22.04, macos-latest, windows-2019 ]
include:
- os: 'ubuntu-latest'
osn: 'ubuntu\-20.04'
z3: z3-4.8.5-x64-ubuntu-16.04
- os: 'ubuntu-20.04'
osn: 'ubuntu\-20.04'
z3: z3-4.8.5-x64-ubuntu-16.04
osn: 'ubuntu\-22.04'
z3: z3-4.12.1-x64-glibc-2.35
- os: 'ubuntu-22.04'
osn: 'ubuntu\-22.04'
z3: z3-4.12.1-x64-glibc-2.35
- os: 'macos-latest'
osn: 'osx-.*'
z3: z3-4.8.5-x64-osx-10.14.2
z3: z3-4.12.1-x64-osx-10.16
- os: 'windows-2019'
osn: 'win'
z3: z3-4.8.5-x64-win
z3: z3-4.12.1-x64-win

steps:
- name: OS
Expand Down Expand Up @@ -137,20 +137,20 @@ jobs:
# but note we need to skip Dafny since nuget install doesn't work for dotnet tools.
library-name: [ DafnyPipeline, DafnyServer, DafnyLanguageServer, DafnyRuntime, DafnyCore, DafnyDriver ]
# This workflow breaks on windows-2022: https://github.com/dafny-lang/dafny/issues/1906
os: [ ubuntu-latest, ubuntu-20.04, macos-latest, windows-2019 ]
os: [ ubuntu-latest, ubuntu-22.04, macos-latest, windows-2019 ]
include:
- os: 'ubuntu-latest'
osn: 'ubuntu\-20.04'
z3: z3-4.8.5-x64-ubuntu-16.04
- os: 'ubuntu-20.04'
osn: 'ubuntu\-20.04'
z3: z3-4.8.5-x64-ubuntu-16.04
osn: 'ubuntu\-22.04'
z3: z3-4.12.1-x64-glibc-2.35
- os: 'ubuntu-22.04'
osn: 'ubuntu\-22.04'
z3: z3-4.12.1-x64-glibc-2.35
- os: 'macos-latest'
osn: 'osx-.*'
z3: z3-4.8.5-x64-osx-10.14.2
z3: z3-4.12.1-x64-osx-10.16
- os: 'windows-2019'
osn: 'win'
z3: z3-4.8.5-x64-win
z3: z3-4.12.1-x64-win

steps:
## Verify that the dependencies of the libraries we publish (e.g. DafnyLanguageServer)
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release-downloads.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ jobs:
fail-fast: false
matrix:
# This workflow breaks on windows-2022: https://github.com/dafny-lang/dafny/issues/1906
os: [ ubuntu-latest, ubuntu-20.04, macos-latest, windows-2019 ]
os: [ ubuntu-latest, ubuntu-22.04, macos-latest, windows-2019 ]
include:
- os: 'ubuntu-latest'
osn: 'ubuntu\-20.04'
- os: 'ubuntu-20.04'
osn: 'ubuntu\-20.04'
osn: 'ubuntu\-22.04'
- os: 'ubuntu-22.04'
osn: 'ubuntu\-22.04'
- os: 'macos-latest'
osn: 'x64-osx-.*'
- os: 'windows-2019'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Publish Test Results
uses: dorny/test-reporter@v1
with:
artifact: integration-test-results-ubuntu-20.04
artifact: integration-test-results-ubuntu-22.04
name: Build and Test Results
path: "*.trx"
reporter: dotnet-trx
15 changes: 8 additions & 7 deletions .github/workflows/xunit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,24 @@ jobs:
fail-fast: false
matrix:
include:
- os: ubuntu-20.04
suffix: ubuntu-20.04
z3: z3-4.8.5-x64-ubuntu-16.04
- os: ubuntu-22.04
suffix: ubuntu-22.04
z3: z3-4.12.1-x64-glibc-2.35
chmod: true
coverage: true
- os: windows-2019
suffix: win
z3: z3-4.8.5-x64-win
z3: z3-4.12.1-x64-win
chmod: false
coverage: false
- os: macos-latest
suffix: osx
z3: z3-4.8.5-x64-osx-10.14.2
z3: z3-4.12.1-x64-osx-10.16
chmod: true
coverage: false
env:
solutionPath: Source/Dafny.sln
z3BaseUri: https://github.com/Z3Prover/z3/releases/download/Z3-4.8.5
z3BaseUri: https://github.com/Z3Prover/z3/releases/download/z3-4.12.1
Logging__LogLevel__Microsoft: Debug
steps:
- uses: actions/checkout@v3
Expand All @@ -57,10 +57,11 @@ jobs:
Expand-Archive z3.zip .
Remove-Item z3.zip
Copy-Item ${{matrix.z3}} Binaries/z3 -Recurse
- name: Set Z3 Permissions
- name: Set Z3 permissions and try running
if: ${{matrix.chmod}}
run: |
chmod +x Binaries/z3/bin/z3
./Binaries/z3/bin/z3 --version
- name: Build
run: dotnet build -warnaserror --no-restore ${{env.solutionPath}}
- name: Run DafnyLanguageServer Tests
Expand Down
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ refman-release:
make -C ${DIR}/docs/DafnyRef release

z3-mac:
wget https://github.com/Z3Prover/z3/releases/download/Z3-4.8.5/z3-4.8.5-x64-osx-10.14.2.zip
unzip z3-4.8.5-x64-osx-10.14.2.zip
mv z3-4.8.5-x64-osx-10.14.2 ${DIR}/Binaries/z3
wget https://github.com/Z3Prover/z3/releases/download/z3-4.12.1/z3-4.12.1-x64-osx-10.16.zip
unzip z3-4.12.1-x64-osx-10.16.zip
mv z3-4.12.1-x64-osx-10.16 ${DIR}/Binaries/z3

z3-ubuntu:
wget https://github.com/Z3Prover/z3/releases/download/Z3-4.8.5/z3-4.8.5-x64-ubuntu-16.04.zip
unzip z3-4.8.5-x64-ubuntu-16.04.zip
mv z3-4.8.5-x64-ubuntu-16.04 ${DIR}/Binaries/z3
wget https://github.com/Z3Prover/z3/releases/download/z3-4.12.1/z3-4.12.1-x64-glibc-2.31.zip
unzip z3-4.12.1-x64-glibc-2.31.zip
mv z3-4.12.1-x64-glibc-2.31 ${DIR}/Binaries/z3

format:
dotnet tool run dotnet-format -w -s error Source/Dafny.sln --exclude DafnyCore/Scanner.cs --exclude DafnyCore/Parser.cs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ method Abs(x: int) returns (y: int)
// When hovering the postcondition, it should display the position of the failing path
await AssertHoverMatches(documentItem, (2, 15),
@"[**Error:**](???) This postcondition might not hold on a return path.
This is assertion #1 of 4 in method Abs
This is assertion #2 of 4 in method Abs
Resource usage: ??? RU
Return path: testFile.dfy(6, 5)"
);
Expand All @@ -59,13 +59,13 @@ This is assertion #1 of 4 in method Abs
await AssertHoverMatches(documentItem, (5, 4),
@"[**Error:**](???) A postcondition might not hold on this return path.
Could not prove: y >= 0
This is assertion #1 of 4 in method Abs
This is assertion #2 of 4 in method Abs
Resource usage: ??? RU"
);
await AssertHoverMatches(documentItem, (7, 11),
@"[**Error:**](???) assertion might not hold
This is assertion #2 of 4 in method Abs
Resource usage: 9K RU"
This is assertion #1 of 4 in method Abs
Resource usage: ??? RU"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know why we lost this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ??? matches anything, so that change just makes the test less fragile as the solver evolves.

);
await AssertHoverMatches(documentItem, (0, 7),
@"**Verification performance metrics for method Abs**:
Expand Down
5 changes: 5 additions & 0 deletions Source/DafnyLanguageServer.Test/Various/CounterExampleTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1109,9 +1109,14 @@ public async Task NonIntegerSeqIndices() {
/* Then, extract the number of non-integral indexed sequences from the repro case... */
.Count(IsNegativeIndexedSeq);

// With more recent Z3 versions (at least 4.11+, but maybe going back farther), this situation doesn't seem
// to arise anymore. So this test now just confirms that the test file it loads can be verified without
// crashing.
/*
Assert.IsTrue(nonIntegralIndexedSeqs > 0, "If we do not see at least one non-integral index in " +
"this test case, then the backend changed " +
"The indices being returned to the Language Server.");
*/
}

/* Helper for the NonIntegerSeqIndices test. */
Expand Down
10 changes: 2 additions & 8 deletions Source/DafnyLanguageServer/DafnyLanguageServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,11 @@ private static void PublishSolverPath(ILanguageServer server) {

private static void HandleZ3Version(ITelemetryPublisher telemetryPublisher, SMTLibSolverOptions proverOptions) {
var z3Version = DafnyOptions.GetZ3Version(proverOptions.ProverPath);
if (z3Version is null) {
return;
}
var major = z3Version.Major;
var minor = z3Version.Minor;
var patch = z3Version.Build;
if (major <= 4 && (major < 4 || minor <= 8) && (minor < 8 || patch <= 6)) {
if (z3Version is null || z3Version < new Version(4, 8, 6)) {
return;
}

telemetryPublisher.PublishZ3Version("Z3 version {major}.{minor}.{patch}");
telemetryPublisher.PublishZ3Version($"Z3 version {z3Version}");

var toReplace = "O:model_compress=false";
var i = DafnyOptions.O.ProverOptions.IndexOf(toReplace);
Expand Down
10 changes: 7 additions & 3 deletions Source/DafnyTestGeneration.Test/Collections.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ invariant i < |c| {
".TrimStart();
var program = Utils.Parse(source);
var methods = await Main.GetTestMethodsForProgram(program).ToListAsync();
// Assert.AreEqual(3, methods.Count);
Assert.AreEqual(3, methods.Count);
Assert.IsTrue(methods.All(m =>
m.MethodName ==
"SimpleTest.compareStringToSeqOfChars"));
Expand All @@ -95,11 +95,15 @@ invariant i < |c| {
m.ValueCreation[0].value.Length - 2 !=
m.ValueCreation.Last().value.Split(",").Length));

Assert.IsTrue(methods.Exists(m =>
m.ArgValues[0].Split(",").Length < 2));
// This test is too specific. A test input may be valid and still not satisfy it.
/*
Assert.IsTrue(methods.Exists(m =>
m.ValueCreation[0].value.Length < 4 &&
m.ValueCreation[0].value.Length - 2 ==
m.ValueCreation.Last().value.Split(",").Length));
m.ValueCreation.Last().value.Split(",").Length));*/
}

}
}
}
7 changes: 5 additions & 2 deletions Source/DafnyTestGeneration.Test/Various.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ static method eightPaths (i:int) returns (divBy2:bool, divBy3:bool, divBy5:bool)
".TrimStart();
var program = Utils.Parse(source);
var methods = await Main.GetTestMethodsForProgram(program).ToListAsync();
Assert.IsTrue(methods.Count is >= 4 and <= 6);
Assert.IsTrue(methods.Count is >= 3 and <= 6);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think changing this to methods.Count is >= 2 and <= 6 would make sure the assertion accounts for all possible solutions.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Assert.IsTrue(methods.All(m => m.MethodName == "Paths.eightPaths"));
Assert.IsTrue(methods.All(m => m.DafnyInfo.IsStatic("Paths.eightPaths")));
Assert.IsTrue(methods.All(m => m.ArgValues.Count == 1));
Expand Down Expand Up @@ -199,18 +199,21 @@ decreases 3 - counter {
DafnyOptions.O.TestGenOptions.TargetMethod =
"Objects.List.IsACircleOfLessThanThree";
var methods = await Main.GetTestMethodsForProgram(program).ToListAsync();
Assert.AreEqual(3, methods.Count);
Assert.IsTrue(methods.Count >= 2);
Assert.IsTrue(methods.All(m =>
m.MethodName == "Objects.List.IsACircleOfLessThanThree"));
Assert.IsTrue(methods.All(m =>
m.DafnyInfo.IsStatic("Objects.List.IsACircleOfLessThanThree")));
Assert.IsTrue(methods.All(m => m.ArgValues.Count == 1));
// This test is too specific. A test input may be valid and still not satisfy it.
/*
Assert.IsTrue(methods.Exists(m =>
(m.Assignments.Count == 1 && m.Assignments[0] == ("v0", "next", "v0") &&
m.ValueCreation.Count == 1) ||
(m.Assignments.Count == 2 && m.Assignments[1] == ("v0", "next", "v1") &&
m.Assignments[0] == ("v1", "next", "v0") &&
m.ValueCreation.Count == 2)));
*/
Assert.IsTrue(methods.Exists(m =>
(m.Assignments.Count > 2 && m.ValueCreation.Count > 2 &&
m.Assignments.Last() == ("v0", "next", "v1") &&
Expand Down
5 changes: 3 additions & 2 deletions Source/DafnyTestGeneration/ProgramModification.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ private static DafnyOptions SetupOptions(string procedure) {
options.EnhancedErrorMessages = 1;
options.ModelViewFile = "-";
options.ProverOptions = new List<string>() {
"O:model_compress=false",
// TODO: condition this on Z3 version
"O:model.compact=false",
"O:model_evaluator.completion=true",
"O:model.completion=true"
};
Expand Down Expand Up @@ -208,4 +209,4 @@ public static void ResetStatistics() {
idToModification = new();
}
}
}
}
3 changes: 3 additions & 0 deletions Test/allocated1/dafny0/AllLiteralsAxiom.dfy
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// RUN: %dafny /verifyAllModules /allocated:1 /compile:0 /print:"%t.print" /dprint:"%t.dprint" "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
include "../../dafny0/AllLiteralsAxiom.dfy"
2 changes: 2 additions & 0 deletions Test/allocated1/dafny0/AllLiteralsAxiom.dfy.expect
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

Dafny program verifier finished with 4 verified, 0 errors
Loading