Fast SAT through Incremental Unit Propagation Truth Maintenance and the ITMS Brian C. Williams Oct. 30th, 2002 16.412J/6.834J 9/20/2000 copyright Brian Williams
copyright Brian Williams Outline Motivation: Fast Mode Estimation and Reconfiguration Review of unit propagation Incremental unit propagation as truth maintenance 9/20/2000 copyright Brian Williams
Reconfiguring for a Failed Engine Oxidizer tank Fuel tank Open four valves Valve fails stuck closed Fire backup engine 9/20/2000 copyright Brian Williams
Diagnosis and Reconfiguration Performance on Cassini Number of components: 80 Number of clauses: 11,101 9/20/2000 copyright Brian Williams
copyright Brian Williams Outline Motivation: Fast Mode Estimation and Reconfiguration Review of unit propagation Incremental unit propagation as truth maintenance 9/20/2000 copyright Brian Williams
Unit Propagation Examples C1: Not A or B C2: Not C or A C3: Not B or C C4: A A True B True C True C4 C1 C3 9/20/2000 copyright Brian Williams
Unit Propagation Examples C1: Not A or B C2: Not C or A C3: Not B or C C4: A C4’: Not B A True B True C True C4 C1 C3 C4’ A False B False C False C2 C1 9/20/2000 copyright Brian Williams
copyright Brian Williams Unit Propagation true false t r q C2: ¬ p ¬ t C1 : ¬r q p p procedure propagate(C) // C is a clause if all literals in C are false except l, and l is unassigned then assign true to l and record C as a support for l and for each clause C’ mentioning “not l”, propagate(C’) end propagate 9/20/2000 copyright Brian Williams
copyright Brian Williams Unit Propagation true false t r q C2: ¬ p ¬ t true C1 : ¬r q p p procedure propagate(C) // C is a clause if all literals in C are false except l, and l is unassigned then assign true to l and record C as a support for l and for each clause C’ mentioning “not l”, propagate(C’) end propagate 9/20/2000 copyright Brian Williams
copyright Brian Williams Unit Propagation true false t r q C2: ¬ p ¬ t true C1 : ¬r q p p procedure propagate(C) // C is a clause if all literals in C are false except l, and l is unassigned then assign true to l and record C as a support for l and for each clause C’ mentioning “not l”, propagate(C’) end propagate 9/20/2000 copyright Brian Williams
copyright Brian Williams Unit Propagation true false t r q C2: ¬ p ¬ t true C1 : ¬r q p p procedure propagate(C) // C is a clause if all literals in C are false except l, and l is unassigned then assign true to l and record C as a support for l and for each clause C’ mentioning “not l”, propagate(C’) end propagate 9/20/2000 copyright Brian Williams
copyright Brian Williams Unit Propagation true false false t r q C2: ¬ p ¬ t true C1 : ¬r q p p procedure propagate(C) // C is a clause if all literals in C are false except l, and l is unassigned then assign true to l and record C as a support for l and for each clause C’ mentioning “not l”, propagate(C’) end propagate 9/20/2000 copyright Brian Williams
copyright Brian Williams DPLL Example Example: C1: Not A or B C2: Not C or A C3: Not B or C A Propagate: C = F B = F A = F Propagate: B = T C = T A = T F T 9/20/2000 copyright Brian Williams
DPLL Procedure [Davis, Putnam Logmann, Loveland, 1962] DPLL(phi,A) Input: A cnf theory phi, an assignment A to propositions in phi Output: A decision of whether phi is satisfiable. 1. propagate(phi); 2. If a clause is violated return(false); 3. Else if all propositions are assigned return(true); 4. Else Q = some unassigned proposition in phi; 6. Return (DPLL(phi, A[Q = True]) or 7. DPLL(phi, A[Q = False]) 9/20/2000 copyright Brian Williams
copyright Brian Williams Outline Motivation: Fast Mode Estimation and Reconfiguration Review of unit propagation Incremental unit propagation as truth maintenance LTMS ITMS 9/20/2000 copyright Brian Williams
copyright Brian Williams Satisfiability with Incremental Unit Propagation (aka Truth Maintenance) When adding an assignment incrementally introduce additional unit propagations (already done for DPLL) When removing an assignment (backtracking), only remove propagations of that assignment. 9/20/2000 copyright Brian Williams
Propagating Incrementally: Adding Clause C1 true false false t r q C2: ¬ p ¬ t true C1 : ¬r q p p procedure propagate(C) // C is a clause if all literals in C are false except l, and l is unassigned then assign true to l and record C as a support for l and for each clause C’ mentioning “not l”, propagate(C’) end propagate 9/20/2000 copyright Brian Williams
Undoing Propagation Incrementally: Deleting Clause D q true s C: ¬ p ¬ t D: ¬r q p p A: ¬ s ¬ p procedure unsupport(D) // D is a clause if D supports some proposition p then delete p’s support and truth assignment; for each support C containing p // Delete consequences unsupport(C); for each clause A containing p // Resupport p then propagate(A); end unsupport 9/20/2000 copyright Brian Williams
Undoing Propagation Incrementally: Deleting Clause D q true s C: ¬ p ¬ t D: ¬r q p p A: ¬ s ¬ p procedure unsupport(D) // D is a clause if D supports some proposition p then delete p’s support and truth assignment; for each support C containing p // Delete consequences unsupport(C); for each clause A containing p // Resupport p then propagate(A); end unsupport 9/20/2000 copyright Brian Williams
Undoing Propagation Incrementally: Deleting Clause D q s C: ¬ p ¬ t D: ¬r q p p A: ¬ s ¬ p procedure unsupport(D) // D is a clause if D supports some proposition p then delete p’s support and truth assignment; for each support C containing p // Delete consequences unsupport(C); for each clause A containing p // Resupport p then propagate(A); end unsupport 9/20/2000 copyright Brian Williams
Undoing Propagation Incrementally: Deleting Clause D q s C: ¬ p ¬ t D: ¬r q p p A: ¬ s ¬ p procedure unsupport(D) // D is a clause if D supports some proposition p then delete p’s support and truth assignment; for each support C containing p // Delete consequences unsupport(C); for each clause A containing p // Resupport p then propagate(A); end unsupport 9/20/2000 copyright Brian Williams
Undoing Propagation Incrementally: Deleting Clause D q s C: ¬ p ¬ t D: ¬r q p p A: ¬ s ¬ p procedure unsupport(D) // D is a clause if D supports some proposition p then delete p’s support and truth assignment; for each support C containing p // Delete consequences unsupport(C); for each clause A containing p // Resupport p then propagate(A); end unsupport 9/20/2000 copyright Brian Williams
Undoing Propagation Incrementally: Deleting Clause D q s C: ¬ p ¬ t D: ¬r q p p A: ¬ s ¬ p procedure unsupport(D) // D is a clause if D supports some proposition p then delete p’s support and truth assignment; for each support C containing p // Delete consequences unsupport(C); for each clause A containing p // Resupport p then propagate(A); end unsupport 9/20/2000 copyright Brian Williams
Undoing Propagation Incrementally: Deleting Clause D q true s C: ¬ p ¬ t D: ¬r q p p A: ¬ s ¬ p procedure unsupport(D) // D is a clause if D supports some proposition p then delete p’s support and truth assignment; for each support C containing p // Delete consequences unsupport(C); for each clause A containing p // Resupport p then propagate(A); end unsupport 9/20/2000 copyright Brian Williams
copyright Brian Williams Cassini Performance Number of components: 80 Number of clauses: 11101 no TMS TMS 9/20/2000 copyright Brian Williams
Unit Propagation in Real-Time: LTMS Significant, unnecessary re-labeling during each switch Outliers dominate ability to react. 9/20/2000 copyright Brian Williams
Unit Propagation in Real-Time: LTMS Significant, unnecessary re-labeling during each switch Outliers dominate ability to react. 9/20/2000 copyright Brian Williams
Example: DS-1 Bus Communication PDE SRU PDU GDE PASM DSEU PEPE Commands BC 1553 bus Flight Computer Data Clauses that describe the bus controller (bc): C1: ¬ nci ¬ a nco C2: ¬ ia nco C3: ¬ ok a C4: ¬ rf ia C5: ¬ uf ia C6: ¬ ok ¬ rf C7: ¬ ok ¬ uf C8: ¬ rf ¬ uf C9: ¬ a ¬ ia BC health: ok, rf, uf No input cmd: nci BC activity: a, ia No output cmd: nco 9/20/2000 copyright Brian Williams
LTMS’ Conservative Re-Support Strategy Delete C10 then add C11 C7: ¬ ok ¬ pf nci C1: ¬ nci ¬ a nco pf a C10: ok C3: ¬ ok a C9: ¬ a ¬ ia ok ia nco Performing Unit Propagation Also show one step example C8: ¬ rf ¬ pf C6: ¬ ok ¬ rf rf ~ 300 C4: ¬ rf ia C2: ¬ ia nco 9/20/2000 copyright Brian Williams Support has ~ 300 consequences
LTMS’ Conservative Re-Support Strategy Delete C10 then add C11 C7: ¬ ok ¬ pf nci C1: ¬ nci ¬ a nco pf a C3: ¬ ok a C9: ¬ a ¬ ia ok ia nco Performing Unit Propagation Also show one step example C8: ¬ rf ¬ pf C6: ¬ ok ¬ rf rf ~ 300 C4: ¬ rf ia C2: ¬ ia nco 9/20/2000 copyright Brian Williams Trace support and delete ~ 300 consequences
LTMS’ Conservative Re-Support Strategy Delete C10 then add C11 C7: ¬ ok ¬ pf nci C1: ¬ nci ¬ a nco pf a C3: ¬ ok a C9: ¬ a ¬ ia ok ia nco Performing Unit Propagation Also show one step example C8: ¬ rf ¬ pf C6: ¬ ok ¬ rf rf ~ 300 C4: ¬ rf ia C2: ¬ ia nco 9/20/2000 copyright Brian Williams Trace support and delete ~ 300 consequences
LTMS’ Conservative Re-Support Strategy Delete C10 then add C11 C7: ¬ ok ¬ pf nci C1: ¬ nci ¬ a nco pf a C3: ¬ ok a C9: ¬ a ¬ ia ok ia nco Performing Unit Propagation Also show one step example C8: ¬ rf ¬ pf C6: ¬ ok ¬ rf rf ~ 300 C4: ¬ rf ia C2: ¬ ia nco 9/20/2000 copyright Brian Williams Trace support and delete ~ 300 consequences
LTMS’ Conservative Re-Support Strategy Delete C10 then add C11 C7: ¬ ok ¬ pf nci C1: ¬ nci ¬ a nco pf a C3: ¬ ok a C9: ¬ a ¬ ia ok ia nco Performing Unit Propagation Also show one step example C8: ¬ rf ¬ pf C6: ¬ ok ¬ rf rf ~ 300 C4: ¬ rf ia C2: ¬ ia nco 9/20/2000 copyright Brian Williams Trace support and delete ~ 300 consequences
LTMS’ Conservative Re-Support Strategy Delete C10 then add C11 C7: ¬ ok ¬ pf nci C1: ¬ nci ¬ a nco pf a C3: ¬ ok a C9: ¬ a ¬ ia ok ia nco Performing Unit Propagation Also show one step example C8: ¬ rf ¬ pf C6: ¬ ok ¬ rf rf C4: ¬ rf ia C2: ¬ ia nco 9/20/2000 copyright Brian Williams Trace support and delete ~ 300 consequences
LTMS’ Conservative Re-Support Strategy Delete C10 then add C11 C7: ¬ ok ¬ pf nci C1: ¬ nci ¬ a nco pf a C3: ¬ ok a C9: ¬ a ¬ ia ok ia nco Problem 2: Blocking by logical inconsistency Solution *** C8: ¬ rf ¬ pf C6: ¬ ok ¬ rf rf C4: ¬ rf ia C2: ¬ ia nco C11: rf 9/20/2000 copyright Brian Williams Add C11 and propagate consequences, ...
LTMS’ Conservative Re-Support Strategy Delete C10 then add C11 C7: ¬ ok ¬ pf nci C1: ¬ nci ¬ a nco pf a C3: ¬ ok a C9: ¬ a ¬ ia ok ia nco Problem 2: Blocking by logical inconsistency Solution *** C8: ¬ rf ¬ pf C6: ¬ ok ¬ rf rf C4: ¬ rf ia C2: ¬ ia nco C11: rf 9/20/2000 copyright Brian Williams Add C11 and propagate consequences, ...
LTMS’ Conservative Re-Support Strategy Delete C10 then add C11 C7: ¬ ok ¬ pf nci C1: ¬ nci ¬ a nco pf a C3: ¬ ok a C9: ¬ a ¬ ia ok ia nco Problem 2: Blocking by logical inconsistency Solution *** C8: ¬ rf ¬ pf C6: ¬ ok ¬ rf rf C4: ¬ rf ia C2: ¬ ia nco C11: rf 9/20/2000 copyright Brian Williams Add C11 and propagate consequences, ...
LTMS’ Conservative Re-Support Strategy Delete C10 then add C11 C7: ¬ ok ¬ pf nci C1: ¬ nci ¬ a nco pf a C3: ¬ ok a C9: ¬ a ¬ ia ok ia nco Problem 2: Blocking by logical inconsistency Solution *** C8: ¬ rf ¬ pf C6: ¬ ok ¬ rf Resup ~300 rf C4: ¬ rf ia C2: ¬ ia nco C11: rf 9/20/2000 copyright Brian Williams Add C11 and propagate consequences, ~300 unchanged.
copyright Brian Williams Outline Motivation: Fast Mode Estimation and Reconfiguration Review of unit propagation Incremental unit propagation as truth maintenance LTMS ITMS – a repair-based approach 9/20/2000 copyright Brian Williams
ITMS: Re-Support via Local Cycle Detection To Avoid Cycles, Avoid Back Edges Number literals by depth of support. Back edges point to lower numbers. 4 C1: ¬ nci ¬ a nco nci a 2 C3: ¬ ok a C10: ok Performing Unit Propagation Also show one step example 5 ok 1 ia 3 nco 2 Sup ~300 rf 9/20/2000 C11: rf copyright Brian Williams C4: ¬ rf ia C2: ¬ ia nco
ITMS: Re-Support via Local Cycle Detection Number literals by depth of support. Back edges point to lower numbers. 4 C1: ¬ nci ¬ a nco nci a 2 C3: ¬ ok a C10: ok Performing Unit Propagation Also show one step example 5 ok 1 ia 3 nco 2 Sup ~300 rf 9/20/2000 C11: rf copyright Brian Williams C4: ¬ rf ia C2: ¬ ia nco
copyright Brian Williams Add Before Delete nci C1: ¬ nci ¬ a nco a C10: ok C3: ¬ ok a C9: ¬ a ¬ ia Performing Unit Propagation Also show one step example ok ia nco C6: ¬ ok ¬ rf ~300 literals rf 9/20/2000 C11: rf copyright Brian Williams C4: ¬ rf ia C2: ¬ ia nco
Add Before Delete -> Propagation blocked nci C1: ¬ nci ¬ a nco a C10: ok C3: ¬ ok a C9: ¬ a ¬ ia Performing Unit Propagation Also show one step example ok ia nco C6: ¬ ok ¬ rf ~300 literals rf 9/20/2000 C11: rf copyright Brian Williams C4: ¬ rf ia C2: ¬ ia nco
Idea: Roll back Consequences of C10 Just Enough to Let C11 Through nci C1: ¬ nci ¬ a nco a C10: ok C3: ¬ ok a C9: ¬ a ¬ ia ok ia nco Performing Unit Propagation Also show one step example C6: ¬ ok ¬ rf ~300 literals rf C4: ¬ rf ia C2: ¬ ia nco C11: rf 9/20/2000 copyright Brian Williams
Idea: Roll back Consequences of C10 Just Enough to Let C11 Through nci C1: ¬ nci ¬ a nco a C10: ok C3: ¬ ok a C9: ¬ a ¬ ia ok ia nco Performing Unit Propagation Also show one step example C6: ¬ ok ¬ rf ~300 literals rf C4: ¬ rf ia C2: ¬ ia nco C11: rf 9/20/2000 copyright Brian Williams
Idea: Roll back Consequences of C10 Just Enough to Let C11 Through nci C1: ¬ nci ¬ a nco a C10: ok C3: ¬ ok a C9: ¬ a ¬ ia ok ia nco Performing Unit Propagation Also show one step example C6: ¬ ok ¬ rf ~300 literals rf C4: ¬ rf ia C2: ¬ ia nco C11: rf 9/20/2000 copyright Brian Williams
ITMS: Roll Back by Repairing Conflicts Flip rf in conflict C11 C7: ¬ ok ¬ pf nci C1: ¬ nci ¬ a nco 4 pf 2 a 2 C10: ok C3: ¬ ok a C9: ¬ a ¬ ia ok 1 ia 5 nco 3 C8: ¬ rf ¬ pf C6: ¬ ok ¬ rf rf C11: rf C2: ¬ ia nco 2 C4: ¬ rf ia 9/20/2000 copyright Brian Williams
ITMS: Roll Back by Repairing Conflicts Flip ia in conflict C4 C7: ¬ ok ¬ pf nci C1: ¬ nci ¬ a nco 4 pf 2 a 2 C10: ok C3: ¬ ok a C9: ¬ a ¬ ia ok 1 ia 5 nco 3 C8: ¬ rf ¬ pf C6: ¬ ok ¬ rf rf C11: rf C2: ¬ ia nco 1 C4: ¬ rf ia 9/20/2000 copyright Brian Williams
ITMS: Roll Back by Repairing Conflicts Ready to resupport nco Flip ok in conflict C6 C7: ¬ ok ¬ pf nci C1: ¬ nci ¬ a nco 4 pf 2 a 2 C10: ok C3: ¬ ok a C9: ¬ a ¬ ia ok 1 ia 5 nco 2 C8: ¬ rf ¬ pf C6: ¬ ok ¬ rf rf C11: rf C2: ¬ ia nco 1 C4: ¬ rf ia 9/20/2000 copyright Brian Williams
ITMS: Roll Back by Repairing Conflicts Remove consequences of ok trying local resupport C7: ¬ ok ¬ pf nci C1: ¬ nci ¬ a nco 4 pf 2 a 2 C10: ok C3: ¬ ok a C9: ¬ a ¬ ia ok 1 ia 5 nco 2 C8: ¬ rf ¬ pf C6: ¬ ok ¬ rf rf C11: rf C2: ¬ ia nco 1 C4: ¬ rf ia 9/20/2000 copyright Brian Williams
ITMS: Roll Back by Repairing Conflicts Propagate consequences of ok C7: ¬ ok ¬ pf nci C1: ¬ nci ¬ a nco 4 pf a C10: ok C3: ¬ ok a C9: ¬ a ¬ ia ok 1 ia 5 nco 2 C8: ¬ rf ¬ pf C6: ¬ ok ¬ rf rf C11: rf C2: ¬ ia nco 1 C4: ¬ rf ia 9/20/2000 copyright Brian Williams
ITMS: Roll Back by Repairing Conflicts Finally delete C10 C7: ¬ ok ¬ pf nci C1: ¬ nci ¬ a nco 4 pf 2 a 2 C10: ok C3: ¬ ok a C9: ¬ a ¬ ia ok 1 ia 5 nco 2 C8: ¬ rf ¬ pf C6: ¬ ok ¬ rf rf C11: rf C2: ¬ ia nco 2 C4: ¬ rf ia 9/20/2000 copyright Brian Williams
ITMS significantly decreases extra label changes 9/20/2000 copyright Brian Williams
Comparing the ITMS to the LTMS 9/20/2000 copyright Brian Williams