-
Notifications
You must be signed in to change notification settings - Fork 92
/
lib.rs
52 lines (44 loc) · 1.72 KB
/
lib.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Copyright Kani Contributors
// SPDX-License-Identifier: Apache-2.0 OR MIT
use std::{collections::HashSet, path::PathBuf};
use serde::{Deserialize, Serialize};
pub use artifact::ArtifactType;
pub use cbmc_solver::CbmcSolver;
pub use harness::*;
pub use vtable::*;
pub mod artifact;
mod cbmc_solver;
mod harness;
mod vtable;
/// The structure of `.kani-metadata.json` files, which are emitted for each crate
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct KaniMetadata {
/// The crate name from which this metadata was extracted.
pub crate_name: String,
/// The proof harnesses (`#[kani::proof]`) found in this crate.
pub proof_harnesses: Vec<HarnessMetadata>,
/// The features found in this crate that Kani does not support.
/// (These general translate to `assert(false)` so we can still attempt verification.)
pub unsupported_features: Vec<UnsupportedFeature>,
/// If crates are built in test-mode, then test harnesses will be recorded here.
pub test_harnesses: Vec<HarnessMetadata>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct UnsupportedFeature {
// We could replace this with an enum: https://github.com/model-checking/kani/issues/1765
/// A string identifying the feature.
pub feature: String,
/// A list of locations (file, line) where this unsupported feature can be found.
pub locations: HashSet<Location>,
}
/// The location in a file
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
pub struct Location {
pub filename: String,
pub start_line: u64,
}
/// We stub artifacts with the path to a KaniMetadata file.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CompilerArtifactStub {
pub metadata_path: PathBuf,
}