3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-07-16 01:16:39 +00:00
Commit graph

19 commits

Author SHA1 Message Date
Nikolaj Bjorner
5ad486901e na
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-05-21 18:03:05 -07:00
Jakob Rath
28996429df
Polysat disjunctive lemmas (WIP) (#5275)
* Extend search state by boolean literals

* Only resolve against positive equality

* mk_dep_ref

* Make clause non-owning

* scoped_clause

* Use scoped_clause

* minor

* scoped_ptr move assignment

* WIP: internal handling of disjunctive constraints

* leaf_value

* disjunctive constraints continued

* Fix bool_lit

* Actually add constraints to storage

* Some fixes

* more fixes

* constraint should have a bool_lit instead of a bool_var

* propagate(bool_lit)

* updates

* interface changes

* small fixes

* Make sat::dimacs_lit's constructor explicit

(otherwise, calling operator<< with sat::literal is ambiguous)

* Use sat::literal

* Print test name at the beginning

* Convention: constraint corresponds to the positive boolean literal

* Make constraint ownership more explicit

* clause stores literals
2021-05-21 13:50:25 -07:00
alexandernutz
49e9782238
Fixedpoint unit tests and transcribed bv puzzle (#5291)
* simple fixed point arithmetic tests

* transcribe puzzle
2021-05-21 09:24:25 -07:00
alexandernutz
8a5addd891
make the two monotonicity tests into one using push/pop; fix division modelling (#5220)
* make the two monotonicity tests into one using push/pop

* whitespace...

* proper division modelling for monotonicity test -- overflow checks still missing, though

* double bitwidth for overflow checking in monotonicity example
2021-05-20 10:00:13 -07:00
Jakob Rath
fd1758ffab
Polysat: check test results, forbidden intervals for coefficient -1 (#5241)
* Use scoped_ptr for condition

* Check solver result in unit tests

* Add test for unusual cjust

* Add solver::get_value

* Broken assertion

* Support forbidden interval for coefficient -1
2021-05-04 09:33:55 -07:00
Jakob Rath
f7e476a4a0
Polysat: fixes in solver, forbidden intervals for eq_constraint (#5240)
* Rename to neg_cond

* Add some logging utilities

* Implement case of forbidden interval covering the whole domain

* Implement diseq_narrow

* Do not activate constraint if we are in a conflict state

* comments

* Assert that lemma isn't undefined

* Update revert_decision to work in the case where narrowing causes propagation

* Fix case of non-disjunctive lemma from forbidden intervals

* Conflict should not leak outside user scope

* Add guard to decide(), some notes

* Add test case

* Add constraints to watchlist of unassigned variable during propagation

* Move common propagation functionality into base class

* Combine eq/diseq narrow

* Compute forbidden interval for equality constraints by considering them as p <=u 0 (or p >u 0 for disequalities)
2021-05-03 09:30:17 -07:00
Jakob Rath
0c4824f194
Polysat: forbidden intervals updates (#5230)
* Pop assign_eh

* Fix scoped_ptr_vector constructors, add detach()

* Need to copy the returned lemma

* Add test

* Basic inequality tests

* Return disjunctive lemma to caller
2021-04-30 08:41:50 -07:00
Jakob Rath
9e505d60f0
Separate constraint creation from activation; add sign/polarity to constraints (#5217)
* Separate constraint creation from activation

* Basic recursive handling of disjunctive lemmas for unit tests

* Set learned constraint to true immediately

* Preliminary support for negated constraints
2021-04-26 09:55:58 -07:00
Nikolaj Bjorner
fc60690742 tidy, initial polysat
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-04-20 12:21:50 -07:00
alexandernutz
bc695a5a97
monotonicity unit tests (#5202)
* monotonicity unit tests

* indentation
2021-04-20 09:09:17 -07:00
Jakob Rath
f72e30e539
Add BDD utilities; use them for narrowing/propagation of linear equality constraints (#5192)
* Add a few helper methods for encoding sets of integers as BDDs

* Use BDD functions in solver

* Add bdd::find_int

* Use bdd::find_int in solver

* Add narrowing for linear equality constraints

* Simplify code for linear propagation

* Add test for later

* Narrowing can only handle linear constraints with a single variable

* Need to push_cjust
2021-04-16 08:44:18 -07:00
Nikolaj Bjorner
549b984c88 move to self-contained trail instructions
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-04-15 17:38:36 -07:00
Jakob Rath
cb9dda19dd
Polysat (#5187)
* test_l2 works now

* Linear propagation: test whether a is odd

* Linear propagation with even coefficients (wip)
2021-04-15 08:37:14 -07:00
Nikolaj Bjorner
9a2b7677bf na
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-04-14 22:03:28 -07:00
Nikolaj Bjorner
a45687d5db add very basic unit tests
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-04-14 05:03:44 -07:00
Nikolaj Bjorner
2f7069a8b7 move include path in test
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-04-14 04:06:50 -07:00
Nikolaj Bjorner
52d37f131d na
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-04-12 11:20:38 -07:00
Nikolaj Bjorner
bd04b5e8bd add testing stubs
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-04-12 11:20:36 -07:00
Nikolaj Bjorner
23ae7e59d6 add unit test stub
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-04-12 11:20:35 -07:00