3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-29 20:05:51 +00:00
Commit graph

95 commits

Author SHA1 Message Date
Nikolaj Bjorner
516ca06c28 levels take 1
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-09-10 15:40:25 +02:00
Nikolaj Bjorner
cfe4b30419 admit inequalities as premises
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-09-09 17:06:32 +02:00
Jakob Rath
ba8fa1f072 update polynomial superposition 2021-09-08 14:01:41 +02:00
Nikolaj Bjorner
a6643955e6 forbidden interval update
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-09-07 17:00:46 +02:00
Nikolaj Bjorner
4c7ec75868 add replay
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-09-07 14:58:56 +02:00
Jakob Rath
9f387f5738
Polysat: conflict resolution updates (#5534)
* variable elimination / saturation sketch

* conflict resolution updates
2021-09-03 10:17:06 -07:00
Jakob Rath
dc547510db
Polysat: conflict resolution wip (#5529)
* conflict_core doesn't need gc() anymore

* update comments, ensure_bvar for new constraints

* Make sure constraints can only be created through constraint_manager

* fix constraint::display if no boolean variable is assigned

* Move clause into separate file

* Add conflict_core binary resolution

* conflict_core additions

* reactivate conflict resolution outer loop

* wip

* seems commented includes break CI build
2021-09-01 09:10:10 -07:00
Nikolaj Bjorner
978bd9e560 remove scoped
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-08-31 08:55:48 -07:00
Jakob Rath
dde8fb0c37
Polysat updates (#5524)
* Move boolean resolution into conflict_core

* Move store() into dedup functionality

* comments

* Call gc()

* Add inference_engine sketch
2021-08-31 08:16:45 -07:00
Nikolaj Bjorner
d1118cb178 cc
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-08-30 11:45:41 -07:00
Nikolaj Bjorner
7cff3d4236 more code review
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-08-30 11:37:08 -07:00
Nikolaj Bjorner
7ea1bf12b6 add code review to constraint
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-08-30 11:11:55 -07:00
Jakob Rath
0c1e44da77
Polysat: constraint refactor cont'd, deduplicate constraints (#5520)
* Assign boolean variables only to long-lived constraints, and deduplicate constraints when they are created

* scoped_signed_constraint

* update other classes

* fix

* Don't use scoped_ptr<constraint> with dedup()
2021-08-30 10:00:27 -07:00
Jakob Rath
ebaea2159e
Polysat: use constraint_literal and begin move to core-based conflict representation (#5489)
* Rename solver_scope for fixplex tests

(otherwise the wrong constructor is called for polysat's solver_scope)

* Update conflict_core

* simplify

* Be clearer about constraint_literal lifetime

* remove old comment

* Remove status (positive/negative) from constraint

* Use constraint_literal in the solver

* Fix build (constraint -> get_constraint)
2021-08-18 11:02:46 -07:00
Jakob Rath
8a773d2bee
Polysat updates (#5444)
* Simplify adding lemmas

* Remove misleading constructor from tmp_assign.

The idea is that tmp_assign is only created on the stack and
short-lived.  Instead of having a convenience constructor that takes a
constraint_ref, it's clearer to have an explicit .get() at the call
site.

* Remove some log messages

* bugfix

* fix

* Add stub for conflict_core

* wip

* Add example by Clemens
2021-07-30 11:14:19 -07:00
Nikolaj Bjorner
04ce8ca5ef u256, separate viable_set
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-07-04 23:47:12 -07:00
Nikolaj Bjorner
0520180846 na
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-07-02 03:49:23 -07:00
Nikolaj Bjorner
9e69e1614e na
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-07-02 03:33:51 -07:00
Nikolaj Bjorner
788de7d614 na
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-07-02 02:48:45 -07:00
Jakob Rath
3436b52c4a
Polysat: refactor constraints (#5372)
* Refactor: remove sign and dep from constraint

* fix some bugs

* improve log messages

* Add missing premises to lemma

* Rename getter in an attempt to fix linux build
2021-06-25 11:04:25 -07:00
Nikolaj Bjorner
db242c28c6 make it C++17 friendly
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-06-23 15:20:59 -07:00
Jakob Rath
20a5baeb70
Polysat: expand conflict explanation rules (#5366)
* update example to match slides

* Add normalized view of inequalities

* workaround

* Add a conflict explanation rule

* unit clauses should be asserted at the base level

* Add src constraint to interval

* support non-strict case in first rule

* print conflict constraints only once

* update second rule

* update third rule as well
2021-06-23 10:12:39 -07:00
Nikolaj Bjorner
dec37aee34 na
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-06-22 21:01:17 -07:00
Nikolaj Bjorner
63f3c841d8 remove var_constraint to get rid of bdd dependencies
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-06-21 16:14:30 -07:00
Jakob Rath
3e1cfcd538
Polysat: conflict explanation prototype (#5353)
* display constraint's extra info in one place

* Add stub for conflict explainer

* Add helper functions to check whether constraint is active at base level

* Add helper class tmp_assign

* Add clause_builder; it skips unnecessary literals during clause creation

* some fixes

* Use clause_builder for forbidden intervals

* remove old comments

* fixes/comments in solver

* print redundant clauses

* First pass at conflict_explainer

* remove unused model class

* Choose value for k

* also print min/max k
2021-06-17 10:35:32 -05:00
Jakob Rath
1fe7dc40fe
Polysat: add simpler monotonicity unit test + minor changes (#5348)
* Add simpler versions of monotonicity puzzle

* band-aid fix to conflicts during revert_decision

* minor changes
2021-06-15 12:18:37 -05:00
Jakob Rath
8757f04d20
Polysat: disjunctive lemmas (#5311)
* Add macro to disable linear solver for development

* Move new_* and add_* to header

* Add ref_vector_core::push_back(ref<T>&&)

* Attempt to simplify lifetime handling

* Make operator bool() explicit

* clause improvements

* display boolean assignment

* clause::resolve

* bug fixes

* more fixes

* final case of backtrack
2021-05-28 13:53:08 -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
Nikolaj Bjorner
88bbe9d54e na
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-05-15 10:12:11 -07:00
Nikolaj Bjorner
683ce27c8f linear solver
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-05-14 17:10:01 -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
f83705bf9f
Polysat: first pass at forbidden intervals (not yet fully integrated into solver) (#5227)
* Add interval class

* Take dependency as const reference

* Compute forbidden intervals for ule-constraints

* Add class for evaluated interval

* We need the evaluated bounds as well

* Don't add constraint to cjust multiple times (hack, to be improved later)

* typo

* More interval helpers

* Add constraint::ult factory function

* Fix forbidden interval condition

* Add solver::has_viable

* Add conflict explanation using forbidden intervals (not yet fully integrated into solver)
2021-04-29 10:12:54 -07:00
Nikolaj Bjorner
60972de562 use assert instead of explicit check
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-04-28 08:48:24 -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
572197aede add some code review comments, stubs for ule
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-04-16 12:43:23 -07:00
Nikolaj Bjorner
9df7e9a029 add outline for ule constraints, change bit to var constraints
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-04-16 12:31:11 -07:00
Nikolaj Bjorner
e970fe5034 sketch bit-constraints
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-04-15 23:04:25 -07:00
Nikolaj Bjorner
dce9740a38 na
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-04-15 21:53:27 -07:00
Nikolaj Bjorner
2eadcd586a add new file for eq_constraint
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-04-15 14:34:01 -07:00
Nikolaj Bjorner
c733789467 move more equality functionality
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-04-15 14:24:50 -07:00
Nikolaj Bjorner
5163492d5b move constraint handler functionality to self-contained / separate classes.
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-04-15 13:08:25 -07:00
Nikolaj Bjorner
0d78a10630 na
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-04-15 12:11:33 -07:00
Nikolaj Bjorner
57486f0b3d split into parts, add stats
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-04-14 04:05:35 -07:00