19
CHF 4 SAT CMPT 417

CHF 4 SAT - cs.sfu.ca

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

CHF 4 SAT

CMPT 417

We now allow large conjunctions to disjunctions-

Observe : ¢pnQ)nR) = LPNCQNRD. can write (pnQiR) as also equivalent .

More generally:&t (Air Azn . . - n Ar) LEA,and Lt Az and . . . dFAn

& f- (A , v Azv . . - v An)⇒ a FA, or at Azor . - - at An.

Eg: (A , n Az n As n - - - n An) (P u Q u R vs v T)

We also use notation : A {A. , Az. . . . 3 = (Air Az n - - - )

¥sAi = VLAI lies}etc.

TerminologyLiteral : atom a negated atom P

,'P.Q.IQ . . .

clause : disjunction of literals (Pr Q virus)cube : conjunction of literals ( Pn Qn > Res)

CHF Formula : Conjunction of clauses .

(PrQuip) n(RriQ)n(Put R)

DNF Formula : Disjunction of cubes

(pnQnR) v GPnnR)v(QniR)

We may use setnotation for CNF :

{{ P.QiRHP.ws} I CLPRQVIR) n (Pri Q))

Eat : Every formula has a logically equivalent CHF formulaand a logically equivalent DNF formula .

These can be constructed from the truth table :

= (p n ( nprr))

p r 9 clauses cubes- --- -

T T T - ( p n r)T F F Gpvr) -

F T F ( pur) -

FFF(pi

CNF (Pvr)n( prir)n Cprr)DNFI Cpnr)

tact : For every r , there are formulas In and 4h st .- the smallest CHF = to 4in has 2

"

clauses- the smallest DNF = to win has 2

"

cubes

4n= ( p , nQ.) v ( pzn Qe) r (Psn QD . . . ( pun Qu).

Problem : SAT Solvers take input in CNF,

so we need an effiewt way to

transform to CNF

SAIInstance : A propositional CHF formula

Q

Question : Is 9 satisfiable?

E ✓ ( Npr :o) n (purrs)n Grip) n Gsu :p) Lp ,girl

X ↳ of n↳ v±)n # ±) lip ,

Site of a clause is its # of literals

4 is K- CHF if : . it is in CHF , and• has no clause largerthan K .

k¥4or anyke H ) : ,

Instance: K - CHF formula 9

Question : Is 4 satisfiabhe .

Factsk - SAT is NP-complete , for each K73

2- SAT 4 1- SAT have linear - time algorithms.

.

1-SAT: ( p ) . (g) n Gr) n (s) n (g) n (t) nfs)

Deciding if aCHF formula is a tautology has a

linear - time algorithm .

( prog) n . . .

( prgrr rig)

Efficieuttraustormatimsonformi.la#CNF-o3C-HF- Can eliminate a long clause by introducing a new atom

:

④{(d ' ✓Elf " II r

- - " ) i l ) el ) . . . ①

Career -tip ne-iXL InC)②( where t, is

"new

' )•

• ① is satisfie ble iff ② is.

. As long as there is a clause of length > 3 :

- eliminate a long clause as in (* )

- linear time,linear increase in site ,

• # new variables linear in site .

Negation .

is NNF = negations only on atoms> (price) tip nQ)x ✓

Linear - time algorithm to transform apropositional formula to NNF.

Repeat :replace a sub formula ' far B) with GAMB)

"" ' ( AnB) with GAnB)

" " 7nA with A

Tseitin's Polytime transformation to CNE-

F-for four))

i.

Claim '.

⇒ at t ⇒ at 4

2) PE9 ⇒ some extension of Bsatisfies M .

Resolutionproofspes. Rule: (LrA)GLvB)_ A. Bare

(Ar B) arbitrarydisjunction,

• Observe : { Ur A) ,Glr B)3 FCARB) oftitera.lyResolution Derivation-Sequence IT -_ (9,4 , . . . ,

Cm) of clauses is

a resolution derivation of Cfrom 17

if :. Cm=C

• for each Ci , either CiEP

or Ci is the resolvautflj.lkwith jik hi .

F5E read - dem . of Cp) from{(pvQuR7 , GRUQ) ,(PVIQI}(Pr Qv R) GRVQ) .

(D)-

.

Prop. 2 . If there is a resolution derivation-

of C fromT then TEC .

Consider : (p)(. \ is unsatisfiede.

C) . sometimes write D fall .

Beth: A resolutionrefutati of IT is a resolutionderivation of D from 17 .

( if D)

¥(p r Q u R) GR r s) ( ir r Q r s) 4 QI G s)

(profs) ¥1GR)↳

(Prov Rus) fsv Tru - V ) (PRQ) favs)-

T(prQvRv Tv dvr ) pvs)

(Prov s) (proves)- (PVQ) Gap)

(prQ) F)

lonstructingaRefutationonasemant.IT#Semantic Tree faT={ CPRQ) , (Pvr) ,R,GRvs)

.GS#)i...o/iPDLp70FTl*p)tip) I

{RQ7&↳piQp.im/7YiQ)GRQ) - n.LPIR) (RR)

( RQ1R)o/\oLRQiRY 4RRQ#¥RiQYbag) A LR11

4BR TIPIRQ.is)to;D tR

Prof. If Tisunsatisfiable , then These resolution refutation .

lonstructingaRefutationonasemant.IT#Semantic Tree faT={ CPRQ) , ✓ R)

, GQVR) .GR vs) ,GsriQ) ,- . -

Yip•

-

↳ aa

{RQ7 ftp.QQ#RX4piN\ "

.

{ RQ1M 's @LRQIRYKRR.QA RRiQY

^tip,RiQ,s) TIRRQ.is)

Prof : If Tisunsatisfiable , then These resolution refutation .

B-acktrackingAIgorith-mfaSATBTIT.NLif 14) = false fou C threturn

'

UN SAT'

else if I is total

return'SAT

'

elsed- a literal from 4 sit . I (e) undefined

if BT6P ,I used}) returns ' SAT '

return ' SAT'

elsereturn BTLR , tubes)

}

start with BT1R,0 ) .

[we are representing a partial t.cn .as a set of literals .

Observation :

• For unsatisfiedhe F :

• the tree of recursive calls induced

by BTCR ,0) is a semantic tree ta T

• At each call BTCT ,a) , d is the p.to .

labelling the corresponding tree node .

• So : BTCT ,0) implicitly constructs a

resolution refutation of P .

→-

End.