-
Notifications
You must be signed in to change notification settings - Fork 85
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
How does the static analyzer work? #370
Comments
I assume you already found the instructions to run MIRAI in general in the README of the repo under If you are beyond that point, please try to set the env variable |
PS. Also please note that if you are using the experimental feature of using MIRAI together with annotations from the contracts crate, you must refer to the contracts crate in your Cargo.toml using |
Thanks. Now, I can see the analysis. Just one other issue is that how can we define none deterministic abstract values. For instance, in the code snippet of the question, if we receive
The body of pub fn main() {
let args: Vec<String> = env::args().collect();
let num = &args[1];
let number: usize = if let Ok(n) = num.parse() {n} else {0};
let mut x = [Box::new(2), Box::new(3)];
update(&mut x, number, 8);
println!("{:?}", x);
} What type should I use for |
The basic problem here is that there is no built in model for std.env.args. This is probably something that we should fix in MIRAI itself. |
Thank you for you reply. Apart from let number = NonDeter<usize>::from(if let Ok(n) = num.parse() {n} else {0}); Currently, how can we provide proofs for universal quantifiers? I mean, how it is possible to prove that a function (in this case, |
Currently the only way to create a non determinist value is by using result!(). This is not what you want because it can only be used inside a model. It should be easy enough to add a function like the one you want to mirai_annotations. As for quantifiers: there is currently no support for them and they are not coming in the next few months. Our current focus is on bug finding and not on verification. Contributions are very welcome, of course. |
See #398 for support on how to create a non deterministic value. |
I couldn't find the instructions for enabling the static analyzer in the documentation. For example, I want the compiler to raise an error in the following example:
Is it possible?
The text was updated successfully, but these errors were encountered: