Skip to content

Commit

Permalink
Merge branch 'main' into reset-mem-init
Browse files Browse the repository at this point in the history
  • Loading branch information
artemagvanian committed Jul 26, 2024
2 parents ec06a22 + 70bd021 commit b8f454a
Show file tree
Hide file tree
Showing 90 changed files with 2,255 additions and 588 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,14 @@ jobs:
apt-get install -y software-properties-common apt-utils
add-apt-repository ppa:git-core/ppa
add-apt-repository ppa:deadsnakes/ppa
add-apt-repository ppa:ubuntu-toolchain-r/test
apt-get update
apt-get install -y \
build-essential bash-completion curl lsb-release sudo g++ gcc flex \
build-essential bash-completion curl lsb-release sudo g++-9 gcc-9 flex \
bison make patch git python3.7 python3.7-dev python3.7-distutils
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 110 \
--slave /usr/bin/g++ g++ /usr/bin/g++-9
ln -sf cpp-9 /usr/bin/cpp
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 1
curl -s https://bootstrap.pypa.io/pip/3.7/get-pip.py -o get-pip.py
python3 get-pip.py --force-reinstall
Expand Down
86 changes: 86 additions & 0 deletions .github/workflows/verify-std-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Copyright Kani Contributors
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
# This workflow will try to build and run the `verify-rust-std` repository.
#
# This check should be optional, but it has been added to help provide
# visibility to when a PR may break the `verify-rust-std` repository.
#
# We expect toolchain updates to potentially break this workflow in cases where
# the version tracked in the `verify-rust-std` is not compatible with newer
# versions of the Rust toolchain.
#
# Changes unrelated to the toolchain should match the current status of main.

name: Check Std Verification
on:
pull_request:
workflow_call:

env:
RUST_BACKTRACE: 1

jobs:
verify-std:
runs-on: ${{ matrix.os }}
strategy:
matrix:
# Kani does not support windows.
os: [ ubuntu-22.04, macos-14 ]
steps:
- name: Checkout Library
uses: actions/checkout@v4
with:
repository: model-checking/verify-rust-std
path: verify-rust-std
submodules: true

- name: Checkout `Kani`
uses: actions/checkout@v4
with:
path: kani

- name: Setup Kani Dependencies
uses: ./kani/.github/actions/setup
with:
os: ${{ matrix.os }}
kani_dir: kani

- name: Build Kani
working-directory: kani
run: |
cargo build-dev
echo "$(pwd)/scripts" >> $GITHUB_PATH
- name: Run verification with HEAD
id: check-head
working-directory: verify-rust-std
continue-on-error: true
run: |
kani verify-std -Z unstable-options ./library --target-dir ${{ runner.temp }} -Z function-contracts \
-Z mem-predicates -Z ptr-to-ref-cast-checks
# If the head failed, check if it's a new failure.
- name: Checkout base
working-directory: kani
if: steps.check-head.outcome != 'success' && github.event_name == 'pull_request'
run: |
BASE_REF=${{ github.event.pull_request.base.sha }}
git checkout ${BASE_REF}
cargo build-dev
- name: Run verification with BASE
id: check-base
if: steps.check-head.outcome != 'success' && github.event_name == 'pull_request'
working-directory: verify-rust-std
continue-on-error: true
run: |
kani verify-std -Z unstable-options ./library --target-dir ${{ runner.temp }} -Z function-contracts \
-Z mem-predicates -Z ptr-to-ref-cast-checks
- name: Compare PR results
if: steps.check-head.outcome != 'success' && steps.check-head.output != github.check-base.output
run: |
echo "New failure introduced by this change"
exit 1
35 changes: 35 additions & 0 deletions .github/workflows/verify-std-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright Kani Contributors
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
# This workflow will try to update the verify std branch.

name: Update "features/verify-rust-std"
on:
schedule:
- cron: "30 3 * * *" # Run this every day at 03:30 UTC
workflow_dispatch: # Allow manual dispatching.

env:
RUST_BACKTRACE: 1

jobs:
# First ensure the HEAD is compatible with the `verify-rust-std` repository.
verify-std:
name: Verify Std
permissions: { }
uses: ./.github/workflows/verify-std-check.yml

# Push changes to the features branch.
update-branch:
needs: verify-std
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout Kani
uses: actions/checkout@v4

- name: Update feature branch
run: |
git push origin HEAD:features/verify-rust-std
42 changes: 21 additions & 21 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ dependencies = [
"heck",
"proc-macro2",
"quote",
"syn 2.0.71",
"syn 2.0.72",
]

[[package]]
Expand Down Expand Up @@ -482,7 +482,7 @@ dependencies = [
"proc-macro-error",
"proc-macro2",
"quote",
"syn 2.0.71",
"syn 2.0.72",
]

[[package]]
Expand Down Expand Up @@ -801,9 +801,9 @@ dependencies = [

[[package]]
name = "redox_syscall"
version = "0.5.2"
version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd"
checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4"
dependencies = [
"bitflags",
]
Expand Down Expand Up @@ -924,7 +924,7 @@ checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.71",
"syn 2.0.72",
]

[[package]]
Expand Down Expand Up @@ -1030,7 +1030,7 @@ dependencies = [
"proc-macro2",
"quote",
"rustversion",
"syn 2.0.71",
"syn 2.0.72",
]

[[package]]
Expand All @@ -1045,9 +1045,9 @@ dependencies = [

[[package]]
name = "syn"
version = "2.0.71"
version = "2.0.72"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b146dcf730474b4bcd16c311627b31ede9ab149045db4d6088b3becaea046462"
checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af"
dependencies = [
"proc-macro2",
"quote",
Expand All @@ -1068,22 +1068,22 @@ dependencies = [

[[package]]
name = "thiserror"
version = "1.0.62"
version = "1.0.63"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f2675633b1499176c2dff06b0856a27976a8f9d436737b4cf4f312d4d91d8bbb"
checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724"
dependencies = [
"thiserror-impl",
]

[[package]]
name = "thiserror-impl"
version = "1.0.62"
version = "1.0.63"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d20468752b09f49e909e55a5d338caa8bedf615594e9d80bc4c565d30faf798c"
checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.71",
"syn 2.0.72",
]

[[package]]
Expand All @@ -1098,9 +1098,9 @@ dependencies = [

[[package]]
name = "toml"
version = "0.8.14"
version = "0.8.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6f49eb2ab21d2f26bd6db7bf383edc527a7ebaee412d17af4d40fdccd442f335"
checksum = "ac2caab0bf757388c6c0ae23b3293fdb463fee59434529014f85e3263b995c28"
dependencies = [
"serde",
"serde_spanned",
Expand All @@ -1119,9 +1119,9 @@ dependencies = [

[[package]]
name = "toml_edit"
version = "0.22.15"
version = "0.22.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d59a3a72298453f564e2b111fa896f8d07fabb36f51f06d7e875fc5e0b5a3ef1"
checksum = "278f3d518e152219c994ce877758516bca5e118eaed6996192a774fb9fbf0788"
dependencies = [
"indexmap",
"serde",
Expand Down Expand Up @@ -1149,7 +1149,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.71",
"syn 2.0.72",
]

[[package]]
Expand Down Expand Up @@ -1384,9 +1384,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"

[[package]]
name = "winnow"
version = "0.6.13"
version = "0.6.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "59b5e5f6c299a3c7890b876a2a587f3115162487e704907d9b6cd29473052ba1"
checksum = "374ec40a2d767a3c1b4972d9475ecd557356637be906f2cb3f7fe17a6eb5e22f"
dependencies = [
"memchr",
]
Expand Down Expand Up @@ -1414,5 +1414,5 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.71",
"syn 2.0.72",
]
35 changes: 24 additions & 11 deletions cprover_bindings/src/goto_program/location.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pub enum Location {
start_col: Option<u64>,
end_line: u64,
end_col: Option<u64>,
pragmas: &'static [&'static str], // CBMC `#pragma check` statements per location.
},
/// Location for Statements that use Property Class and Description - Assert, Assume, Cover etc.
Property {
Expand All @@ -28,6 +29,7 @@ pub enum Location {
col: Option<u64>,
comment: InternedString,
property_class: InternedString,
pragmas: &'static [&'static str], // CBMC `#pragma check` statements per location.
},
/// Covers cases where Location Details are unknown or set as None but Property Class is needed.
PropertyUnknownLocation { comment: InternedString, property_class: InternedString },
Expand Down Expand Up @@ -99,6 +101,7 @@ impl Location {
start_col: Option<T>,
end_line: T,
end_col: Option<T>,
pragmas: &'static [&'static str],
) -> Location
where
T: TryInto<u64>,
Expand All @@ -117,6 +120,7 @@ impl Location {
start_col: start_col_into,
end_line: end_line_into,
end_col: end_col_into,
pragmas,
}
}

Expand All @@ -128,6 +132,7 @@ impl Location {
col: Option<T>,
comment: U,
property_name: U,
pragmas: &'static [&'static str],
) -> Location
where
T: TryInto<u64>,
Expand All @@ -140,7 +145,7 @@ impl Location {
let function = function.intern();
let property_class = property_name.into();
let comment = comment.into();
Location::Property { file, function, line, col, comment, property_class }
Location::Property { file, function, line, col, comment, property_class, pragmas }
}

/// Create a Property type Location from an already existing Location type
Expand All @@ -157,17 +162,25 @@ impl Location {
None,
comment.into(),
property_name.into(),
&[],
),
Location::Loc {
file,
function,
start_line,
start_col,
end_line: _,
end_col: _,
pragmas,
} => Location::property_location(
file.into(),
function.intern(),
start_line,
start_col,
comment.into(),
property_name.into(),
pragmas,
),
Location::Loc { file, function, start_line, start_col, end_line: _, end_col: _ } => {
Location::property_location(
file.into(),
function.intern(),
start_line,
start_col,
comment.into(),
property_name.into(),
)
}
Location::Property { .. } => location,
Location::PropertyUnknownLocation { .. } => location,
// This converts None type Locations to PropertyUnknownLocation type which inserts Property Class and Description
Expand Down
Loading

0 comments on commit b8f454a

Please sign in to comment.