3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-06 14:13:23 +00:00

updated doc

This commit is contained in:
Nikolaj Bjorner 2022-12-15 19:23:32 -08:00
parent 13920c4772
commit 0768a2ead1
4 changed files with 69 additions and 25 deletions

View file

@ -5,21 +5,37 @@ Module Name:
bv1_blaster_tactic.h bv1_blaster_tactic.h
Abstract: Author:
Leonardo (leonardo) 2011-10-25
Tactic Documentation:
## Tactic bv1-blast
### Short Description
Reduce bit-vector expressions into bit-vectors of size 1 (notes: only equality, extract and concat are supported).
### Long Description
Rewriter for "blasting" bit-vectors of size n into bit-vectors of size 1. Rewriter for "blasting" bit-vectors of size n into bit-vectors of size 1.
This rewriter only supports concat and extract operators. This rewriter only supports concat and extract operators.
This transformation is useful for handling benchmarks that contain This transformation is useful for handling benchmarks that contain
many BV equalities. many BV equalities.
Remark: other operators can be mapped into concat/extract by using _Remark_: other operators can be mapped into concat/extract by using
the simplifiers. the simplifiers.
Author: ### Example
Leonardo (leonardo) 2011-10-25 ```z3
(declare-const x (_ BitVec 8))
Notes: (declare-const y (_ BitVec 4))
(declare-const z (_ BitVec 4))
(assert (= (concat y z) x))
(apply bv1-blast)
```
--*/ --*/
#pragma once #pragma once

View file

@ -48,7 +48,6 @@ struct bv_bound_chk_rewriter_cfg : public default_rewriter_cfg {
m_bv_ineq_consistency_test_max = p.bv_ineq_consistency_test_max(); m_bv_ineq_consistency_test_max = p.bv_ineq_consistency_test_max();
m_max_memory = p.max_memory(); m_max_memory = p.max_memory();
m_max_steps = p.max_steps(); m_max_steps = p.max_steps();
} }
ast_manager & m() const { return m_m; } ast_manager & m() const { return m_m; }

View file

@ -5,14 +5,14 @@
bv_bound_chk_tactic.h bv_bound_chk_tactic.h
Abstract:
Author: Author:
Mikolas Janota Mikolas Janota
Revision History: ### Notes
* does not support proofs, does not support cores
--*/ --*/
#pragma once #pragma once

View file

@ -7,12 +7,6 @@ Module Name:
Abstract: Abstract:
Reduce the number of bits used to encode constants, by using signed bounds.
Example: suppose x is a bit-vector of size 8, and we have
signed bounds for x such that:
-2 <= x <= 2
Then, x can be replaced by ((sign-extend 5) k)
where k is a fresh bit-vector constant of size 3.
Author: Author:
@ -20,6 +14,41 @@ Author:
Notes: Notes:
Tactic Documentation:
## Tactic reduce-bv-size
### Short Description
Rry to reduce bit-vector sizes using inequalities.
### Long Description
Reduce the number of bits used to encode constants, by using signed bounds.
Example: suppose $x$ is a bit-vector of size 8, and we have
signed bounds for $x$ such that:
```
-2 <= x <= 2
```
Then, $x$ can be replaced by `((sign-extend 5) k)`
where `k` is a fresh bit-vector constant of size 3.
### Example
```z3
(declare-const x (_ BitVec 32))
(assert (bvsle (bvneg (_ bv2 32)) x))
(assert (bvsle x (_ bv2 32)))
(assert (= (bvmul x x) (_ bv9 32)))
(apply (and-then simplify reduce-bv-size))
```
### Notes
* does not support proofs, nor unsat cores
--*/ --*/
#pragma once #pragma once