Conversation
API migration:
- Cargo feature `static-link-z3` was renamed `bundled`.
- AST types lost their lifetime parameter:
`z3::ast::Int<'a>` → `z3::ast::Int`
- All AST constructors no longer take `&Context`:
`Int::from_i64(&ctx, 0)` → `Int::from_i64(0)`
`BV::new_const(&ctx, name, n)` → `BV::new_const(name, n)`
`Real::from_real(&ctx, 1, 2)` → `Real::from_real(1, 2)`
`Bool::from_bool(&ctx, true)` → `Bool::from_bool(true)`
- Variadic ops drop the `&Context` argument:
`Int::add(&ctx, &[&a, &b])` → `Int::add(&[a.clone(), b.clone()])`
Same for `Bool::and` / `Bool::or` / `Real::add` / etc.
The slice element bound changed to `T: Into<Self> + Clone`,
so we clone where we previously passed `&T`.
- Binops are now methods on the receiver instead of free functions:
`Int::lt(l, r)` → `l.lt(r)`
`Bool::ite(&cond, &a, &b)` → `cond.ite(&a, &b)`
- `Solver::new(&ctx)` → `Solver::new()` (no args).
- `Context::new(&cfg)` is gone; wrap solver work in
`z3::with_z3_config(&cfg, || { ... })`, which scopes a
thread-local context for the closure body.
- `_eq` is deprecated in favor of `eq` (still works with a warning).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(Code by Claude)
API migration:
static-link-z3was renamedbundled.z3::ast::Int<'a>→z3::ast::Int&Context:Int::from_i64(&ctx, 0)→Int::from_i64(0)BV::new_const(&ctx, name, n)→BV::new_const(name, n)Real::from_real(&ctx, 1, 2)→Real::from_real(1, 2)Bool::from_bool(&ctx, true)→Bool::from_bool(true)&Contextargument:Int::add(&ctx, &[&a, &b])→Int::add(&[a.clone(), b.clone()])Same forBool::and/Bool::or/Real::add/ etc. The slice element bound changed toT: Into<Self> + Clone, so we clone where we previously passed&T.Int::lt(l, r)→l.lt(r)Bool::ite(&cond, &a, &b)→cond.ite(&a, &b)Solver::new(&ctx)→Solver::new()(no args).Context::new(&cfg)is gone; wrap solver work inz3::with_z3_config(&cfg, || { ... }), which scopes a thread-local context for the closure body._eqis deprecated in favor ofeq(still works with a warning).