Preprocessing in Incremental SATAlexander Nadel1, Vadim Ryvchin1,2, and Ofer Strichman2
1 – Intel, Haifa, Israel2 – 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()o Done to extend SAT assignment
The problem in combining SatELite 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 Approaches1. No preprocessing at all2. Full preprocessing
• After each invocation return the eliminated clauses• Redo preprocessing
3. 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
PreprocessSolve // might run in-process
Incremental Preprocessing
For each eliminated variable in elimination order: if (*) // decide heuristically
Re-Eliminate else Re-IntroducePreprocessSolve // might run in-process
Incremental Preprocessing
Remove subsumptions.For each eliminated variable in elimination order: if (*) // decide heuristically
Re-Eliminate else Re-IntroducePreprocessSolve // 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
v1
v2
v3
v4
v5
…
S1
S2
S3
S4
S5
Clauses containing v3 but not v1 nor v2 may contain v4, v5, …
Start
v1
v2
v3
v4
v5
…
S1
S2
S3
S4
S5
Δ𝑛Δ ′
Step 1 – Examine v1
v1
v2
v3
v4
v5
…
S1
S2
S3
S4
S5 Re-Elimination
Δ𝑛Δ ′
Step 1 – Re-Eliminate v1
v1
v2
v3
v4
v5
…
S1 = S1U
S2
S3
S4
S5
Δ ′𝑣1Δ ′ Δ ′ (S1 U
Step 2
v1
v2
v3
v4
v5
…
S1 = S1 U
S2
S3
S4
S5
Δ ′
Step 2 – Examine v2
v1
v2
v3
v4
v5
…
S1 = S1 U
S2
S3
S4
S5
Δ ′
Re-Elimination
Step 2 – Re-Eliminate v2
v1
v2
v3
v4
v5
…
S1 = S1 U
S2 = S2 U
S3
S4
S5
Δ ′𝑣 2Δ ′ Δ ′ (S2 U
Step 3
v1
v2
v3
v4
v5
…
S1 = S1 U
S2 = S2 U
S3
S4
S5
Δ ′
Step 3 – Examine v3
v1
v2
v3
v4
v5
…
S1 = S1 U
S2 = S2 U
S3
S4
S5
Δ ′
Re-Introduction
Step 3 – Re-Introduce v3
v1
v2
v3
v4
v5
…
S1 = S1 U
S2 = S2 U
S3
S4
S5
S3Δ ′ Δ ′
Step 3 – Re-Introduce v3
v1
v2
v4
v5
…
S1 = S1 U
S2 = S2 U
S4
S5
S3Δ ′ Δ ′
May contain v4 and/or v5
Our Example1. Input: 2. Preprocessing and Solution
• Elimination of .•
3. Incremental call with )
𝑎 𝑆1=𝑐1∧𝑐2
Δ ′ Δ1
Our Example – Re-Elimination)
Perform Re-Elimination of variable :
= c4 Ʌ c5
𝑎 𝑆1=𝑐1∧𝑐2
Our Example – Re-Elimination) )
Perform Re-Elimination of variable :
Δ ′ 𝑐5 𝑐4∧𝑐5𝑎 𝑆1=𝑐1∧𝑐2∧𝑐5
Δ ′ Δ ′𝑎 𝑅𝑒𝑠𝑎(𝑆𝑎∪ Δ′𝑎)
Our Example – Re-Elimination) )
After Re-Elimination of variable :
Δ ′ 𝑐4∧𝑐6𝑎 𝑆1=𝑐1∧𝑐2∧𝑐5
Our Example – Re-Elimination) )
So the new formula will look like:
Solve UNSAT
Our Example1. Input: 2. Preprocessing and Solution
• Elimination of .•
3. Incremental call with )
𝑎 𝑆1=𝑐1∧𝑐2
Δ ′ Δ1
Our Example – Re-Introduction)
Perform Re-Introduction of variable :
= c4 Ʌ c5
𝑎 𝑆1=𝑐1∧𝑐2
Our Example – Re-Introduction)
Perform Re-Introduction of variable :
Δ ′ c1 Ʌ c2 𝑐4∧𝑐5𝑎 𝑆1=𝑐1∧𝑐2
Δ ′ 𝑆𝑎
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-subsumption between and : • Subsumption of and by • Re-Introduction of : returning and , 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?
o 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
Experimental Results
Experimental Results
Method Time-outs Avg. Total run-timeFull-preprocessing 68 2465.5
No-preprocessing 42 1784.7
Incremental-preprocessing 2 1221.3
Look-ahead 0 1064.9
Incremental vs. No preprocessing
Incremental vs. Full preprocessing
Incremental vs. Look-ahead
Thank You!