Skip to content

Commit

Permalink
add doc
Browse files Browse the repository at this point in the history
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
  • Loading branch information
NikolajBjorner committed Dec 15, 2022
1 parent 7afcaa5 commit aed3d76
Show file tree
Hide file tree
Showing 4 changed files with 114 additions and 26 deletions.
34 changes: 28 additions & 6 deletions src/tactic/arith/lia2card_tactic.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,38 @@ Module Name:
lia2card_tactic.h
Abstract:
Extract 0-1 integer variables used in
cardinality constraints and replace them by Booleans.
Author:
Nikolaj Bjorner (nbjorner) 2013-11-5
Notes:
Tactic Documentation:
## Tactic lia2card
### Short Description
Extract 0-1 integer variables used in
cardinality and pseudo-Boolean constraints and replace them by Booleans.
### Example
```z3
(declare-const x Int)
(declare-const y Int)
(declare-const z Int)
(assert (<= 0 x))
(assert (<= 0 y))
(assert (<= 0 z))
(assert (>= 1 x))
(assert (>= 1 y))
(assert (>= 1 z))
(assert (>= (+ (* 5 x) (* -2 z) (* 3 y) 1) 4))
(apply lia2card)
```
### Notes
* The tactic does not (properly) support proofs or cores.
--*/
#pragma once
Expand Down
24 changes: 23 additions & 1 deletion src/tactic/arith/nla2bv_tactic.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Module Name:
Abstract:
Convert quantified NIA problems to bounded bit-vector arithmetic problems.
Author:
Expand All @@ -16,6 +15,29 @@ Module Name:
Notes:
Ported to tactic framework on 2012-02-28
Tactic Documentation:
## Tactic nla2bv
### Short Description
Convert quantified NIA problems to bounded bit-vector arithmetic problems.
### Example
```z3
(declare-const x Int)
(declare-const y Int)
(declare-const z Int)
(assert (= (* x x y) (* 2 z y y)))
(apply nla2bv)
```
### Notes
* The tactic creates an under-approximation (a stronger set of formulas)
--*/
#pragma once

Expand Down
31 changes: 24 additions & 7 deletions src/tactic/arith/normalize_bounds_tactic.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,34 @@ Module Name:
normalize_bounds_tactic.h
Abstract:
Replace x with x' + l, when l <= x
where x' is a fresh variable.
Note that, after the transformation 0 <= x'.
Author:
Leonardo de Moura (leonardo) 2011-10-21.
Revision History:
Tactic Documentation:
## Tactic normalize-bounds
### Short Description
Replace $x$ with $x' + l$, when $l \leq x$
where $x'$ is a fresh variable.
Note that, after the transformation $0 \leq x'$.
### Example
```z3
(declare-const x Int)
(declare-const y Int)
(declare-const z Int)
(assert (<= 3 x))
(assert (<= (+ x y) z))
(apply normalize-bounds)
```
### Notes
* supports proofs and cores
--*/
#pragma once
Expand Down
51 changes: 39 additions & 12 deletions src/tactic/arith/recover_01_tactic.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,56 @@ Module Name:
recover_01_tactic.h
Abstract:
Author:
Leonardo de Moura (leonardo) 2012-02-17.
Tactic Documentation:
## Tactic recover-01
### Short Description
Recover 01 variables from propositional constants.
Recover 01 variables
### Long Description
Search for clauses of the form
Search for clauses of the form
```
p or q or x = 0
~p or q or x = k1
p or ~q or x = k2
~p or ~q or x = k1+k2
```
Then, replaces
x with k1*y1 + k2*y2
p with y1=1
q with y2=1
where y1 and y2 are fresh 01 variables
Then, replaces
The clauses are also removed.
Author:
* `x` with `k1*y1 + k2*y2`
* `p` with `y1 = 1`
* `q` with `y2 = 1`
Leonardo de Moura (leonardo) 2012-02-17.
where `y1` and `y2` are fresh 01 variables.
The clauses are also removed.
### Example
```z3
(declare-const p Bool)
(declare-const q Bool)
(declare-const x Int)
(assert (or p q (= x 0)))
(assert (or (not p) q (= x 3)))
(assert (or p (not q) (= x 6)))
(assert (or (not p) (not q) (= x 9)))
(apply recover-01)
```
### Notes
Revision History:
* does not support proofs, does not support cores
--*/
#pragma once
Expand Down

0 comments on commit aed3d76

Please sign in to comment.