420 likes | 547 Views
P reprocessing in i ncremental SAT. Alexander Nadel 1 , Vadim Ryvchin 1,2 , and Ofer Strichman 2 1 – Intel, Haifa, Israel 2 – Technion, Haifa, Israel. SAT’12, Trento, Italy. Introduction. Incremental SAT is at the core of a variety of applications
E N D
Preprocessingin incremental SAT Alexander Nadel1, Vadim Ryvchin1,2, and Ofer Strichman2 1 – Intel, Haifa, Israel 2 – Technion, Haifa, Israel SAT’12, Trento, Italy
Introduction • Incremental SAT is at the core of a variety of applications • Preprocessing is essential for SAT’s performance • … but is not compatible with incremental SAT • We propose a way to make them compatible • thus increasing the capacity of SAT-based tools and algorithms
Incremental SAT • Initial Formula: • First incremental Call: • Nth incremental call: • – Input formula at call • – New input clauses added at call
SatELite Preprocessing • Main techniques: • Variable elimination • Subsumption/Self-subsuming resolution • Variable Elimination: • If > save() else save() • Done to extend SAT assignment • The problem in combiningSatELite with incremental SAT: • Eliminated variables might reappear in new input clauses
The Problem ------------------------------------------------------------------------------- Elimination of variable : Now Solver returns: SAT: ------------------------------------------------------------------------------- Incremental call: Solver returns: But: – is not satisfied by .
Previous Approaches • No preprocessing at all • Full preprocessing • After each invocation return the eliminated clauses • Redo preprocessing • Look Ahead: • Do not eliminate “problematic” variables • Preprocessing is essential for performance • In many cases look ahead is not possible
Definitions • – Input formula at call • – Formula at the end of call • Formula comprises clauses managed by the solver • – Saved clauses for eliminated variable • – New input clauses added at call • – initially , modified by incremental preprocessing • –all clauses in containing
Incremental Preprocessing Preprocess Solve // might run in-process
Incremental Preprocessing For each eliminated variable in elimination order: if (*) // decide heuristically Re-Eliminate else Re-Introduce Preprocess Solve // might run in-process
Incremental Preprocessing Remove subsumptions. For each eliminated variable in elimination order: if (*) // decide heuristically Re-Eliminate else Re-Introduce Preprocess Solve // might run in-process
Incremental Preprocess • Re-Elimination (for example: of ): • Perform resolutions between newly added clauses and saved ones () • Add the resolvents to the formula () • Remove clauses () • Update previously saved clauses () • Re-Introduction (for example: of ): • Move (all clauses saved for ) back to the formula ()
Data structure for Eliminated Variables – Saved clauses containing variable … Clauses containing v3 but not v1 nor v2 may contain v4, v5,… S5 v5 S4 v4 S3 v3 S2 v2 v1 S1
Start … S5 v5 S4 v4 S3 v3 S2 v2 v1 S1
Step 1 – Examine v1 … S5 v5 Re-Elimination S4 v4 S3 v3 S2 v2 v1 S1
Step 1 – Re-Eliminate v1 (S1 U … S5 v5 S4 v4 S3 v3 S2 v2 v1 S1 = S1U
Step 2 … S5 v5 S4 v4 S3 v3 S2 v2 v1 S1 = S1 U
Step 2 – Examine v2 … S5 v5 Re-Elimination S4 v4 S3 v3 v2 S2 v1 S1 = S1 U
Step 2 – Re-Eliminate v2 (S2 U … S5 v5 S4 v4 S3 v3 v2 S2 = S2 U v1 S1 = S1 U
Step 3 … S5 v5 S4 v4 S3 v3 S2 = S2 U v2 v1 S1 = S1 U
Step 3 – Examine v3 … S5 v5 Re-Introduction S4 v4 v3 S3 S2 = S2 U v2 v1 S1 = S1 U
Step 3 – Re-Introduce v3 S3 … S5 v5 S4 v4 v3 S3 S2 = S2 U v2 v1 S1 = S1 U
Step 3 – Re-Introduce v3 S3 … May contain v4 and/or v5 S5 v5 S4 v4 S2 = S2 U v2 v1 S1 = S1 U
Our Example • Input: • Preprocessing and Solution • Elimination of. • Incremental call with )
Our Example – Re-Elimination ) PerformRe-Elimination of variable : = c4 Ʌ c5
Our Example – Re-Elimination )) PerformRe-Elimination of variable :
Our Example – Re-Elimination )) After Re-Elimination of variable :
Our Example – Re-Elimination )) So the new formula will look like: Solve UNSAT
Our Example • Input: • Preprocessing and Solution • Elimination of. • Incremental call with )
Our Example – Re-Introduction ) PerformRe-Introduction of variable : = c4 Ʌ c5
Our Example – Re-Introduction ) PerformRe-Introduction of variable : c1Ʌ c2
Our Example – Re-Introduction ) After Re-Introduction of variable :
Our Example – Re-Introduction ) So the new formula will look like: Solve UNSAT
Additional Improvements • Variable elimination creates many resolvent clauses. • If we Re-Introduce , can we delete ’s resolvents? • No, it affects correctness • We can remove only resolvents that did not participate in subsumptions
Example • Elimination of: • Self-subsumption between and: • Self-subsumptionbetween and: • Subsumption ofandby • Re-Introduction of : returningand, removal of • So what left are . • ,
Assumptions • How to deal with assumption variables? • Regular preprocessing: • Freeze them (do not eliminate these variables). • Incremental preprocessing: • Freeze them (the same). • But what if variable was eliminated before? • Must Re-Introduce. • What if there are a lot of assumptions • Our previous talk
Experimental Results • Benchmark Set: • Implementation on top of Fiver (a new SAT solver under development at Intel). • Large Bounded Model-checking instances from Intel divided into 4 different families. • 206 different instances • Timeout: 4000sec • Machines: • Intel® Xeon® 4Ghz 32Gb of memory