Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
bytecodealliance
GitHub Repository: bytecodealliance/wasmtime
Path: blob/main/cranelift/isle/veri/veri_engine/src/lib.rs
1693 views
1
use easy_smt::SExpr;
2
3
pub mod annotations;
4
pub mod interp;
5
pub mod solver;
6
pub mod termname;
7
pub mod type_inference;
8
pub mod verify;
9
10
pub const REG_WIDTH: usize = 64;
11
12
// Use a distinct with as the maximum width any value should have within type inference
13
pub const MAX_WIDTH: usize = 2 * REG_WIDTH;
14
15
pub const FLAGS_WIDTH: usize = 4;
16
17
pub const WIDTHS: [usize; 4] = [8, 16, 32, 64];
18
19
// Closure arguments: SMT context, arguments to the term, lhs, rhs
20
type CustomCondition = dyn Fn(&easy_smt::Context, Vec<SExpr>, SExpr, SExpr) -> SExpr;
21
22
// Closure arguments: SMT context, arguments to the term
23
type CustomAssumption = dyn Fn(&easy_smt::Context, Vec<SExpr>) -> SExpr;
24
25
pub struct Config {
26
pub term: String,
27
pub names: Option<Vec<String>>,
28
pub distinct_check: bool,
29
30
pub custom_verification_condition: Option<Box<CustomCondition>>,
31
pub custom_assumptions: Option<Box<CustomAssumption>>,
32
}
33
34
impl Config {
35
pub fn with_term_and_name(term: &str, name: &str) -> Self {
36
Config {
37
term: term.to_string(),
38
distinct_check: true,
39
custom_verification_condition: None,
40
custom_assumptions: None,
41
names: Some(vec![name.to_string()]),
42
}
43
}
44
}
45
46