-
Notifications
You must be signed in to change notification settings - Fork 122
fresh_const (and friends) are broken #2
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
Comments
Simplified failing test: #[test]
fn test_fresh_int_const() {
let _ = env_logger::try_init();
let cfg = Config::new();
let ctx = Context::new(&cfg);
let x = ctx.fresh_int_const("x");
let zero = ctx.from_i64(0);
let solver = Solver::new(&ctx);
solver.assert(&x.gt(&zero));
assert!(solver.check());
let model = solver.get_model();
let xv = model.eval(&x).unwrap().as_i64().unwrap();
assert_eq!(xv, 1);
} Output:
|
This C code example has the same problem. |
As can be seen in this example the fresh const is not even part of the model, so I guess that's not how Output from the example:
|
I'll try to look at this some today as well! Thanks! |
It is interesting to look at
|
@jrakow and @cdisselkoen : Do either of you have any idea about this? |
This is also fixed on master. Somewhere in the AST refactoring it probably got fixed. |
Nevermind! Updated my z3 from 4.5 to 4.8 and now it's broken again. Seems like something changed in the API. I'll do some digging. |
Filed an issue with the z3 folks: Z3Prover/z3#2489 |
As per the Z3 issue above, the problem has been confirmed to be a Z3 bug, and has been fixed on master. This is definitively not a bug in the bindings but in Z3 itself so I think we should close this issue. |
Sounds good to me. Thanks for looking into that! |
merge prove-rs
Add Let simplification in smt2utils
Currently the semver test fails due to a version mismatch in the result.
I rewrote the test using
ctx.numbered_int_const
instead ofctx.fresh_int_const
and it now passes (changes in https://gist.github.com/badboy/e126802b474d7de60d5d73e47531b01c/revisions)I had a similar problem in my own code and also used
numbered_int_const
there.The text was updated successfully, but these errors were encountered: