cs21111logic

cs21111logic
WeChat:yj4399_
Sina Visitor System

  1. Quantified Boolean FormulasContents11.1Quantified Boolean Formulas...........................15311.1.1Syntax and Semantics...........................15411.1.2Free and Bound Variables.........................15611.1.3Truth and Satisfiability...........................15711.1.4Monotonic and Equivalent Replacement Theorems............15811.1.5Substitutions................................15911.2Normal Forms...................................16011.2.1Prenex Form................................16111.2.2Conjunctive Normal Forms.........................16311.3Checking Satisfiability of Quantified Boolean Formulasby Splitting.....16411.4The DLL Algorithm for Quantified Boolean Formulas.............16811.5OBDD-Based Algorithms for Quantified Boolean Formulas..........170Exercises......................................171Inthischapterwe discussan extensionof propositionalformulas,known asquantifiedboolean formulas.Quantified boolean formulashave the same expressive poweras propositionalformulas,but ingeneralallow for a more succinct representationof problems.Quantifiedbooleanformulascanbeusedtopresentfinite-statecombinatorialproblems,suchasplanningorgames.Inaddition,theyareextensivelyusedinsymbolicmodelcheckingalgorithmsstudiedlaterinthisbook.11.1Quantified Boolean FormulasInthissectionwe introducequantifiedbooleanformulasasanextensionof propositionalformulasand discusstheirsyntaxand semantics.We generalize thenotionsof validityandTime 19:26draftDecember 1,2020

  2. cs21111logic_第1张图片

    15411.1Quantified Boolean Formulassatisfiabilitytoquantifiedbooleanformulasandshow that,unlikepropositionalformulas,checking a truth value of a formula in an interpretationisashard as satisfiabilityor validitychecking.Then we discuss in length the notionsof freeand bound variablesand difficultiescreatedby bound variablesindefiningthe notionof substitutionof aformula for a booleanvariable.11.1.1Syntax and SemanticsInthischapterwe willrefertobooleanvariablessimplyasvariables.Quantifiedbooleanformulasextend propositionalformulasby allowing quantificationon variables.DEFINITION11.1(QuantifiedBoolean Formula)The definition ofquantified booleanformulasisobtainedfrom Definition3.1on page30 of propositionalformulasbyaddingthefollowingitems:(6)Ifpisa booleanvariableandFisaformula,then∀pFand∃pFareformulas.The symbol∀iscalledtheuniversalquantifierand∃iscalled theexistentialquantifier.Wealsocallquantifiersexpressions∀pand∃p.Ifa formulaFcontains∀p(respectively∃p),we say thatpisuniversallyquantified(respectively,existentiallyquantified)inF.❏Intuitively,∀pFmeans thatFistruefor allpossiblevaluesforp,i.e.,both whenpistrueandpisfalse.Likewise,∃pFmeans thatFistruefor somepossiblevalueforp.As inthecaseof propositionalformulas,we willoftenomitparenthesesinformulas.For theconnectivesused inquantifiedbooleanformulaswe willuse thesame prioritiesasinFigure 3.1on page 30,but additionallyassume that the quantifiershave the same priorityasnegation¬.For example,theformula∀p¬p→qrepresents(∀p¬p)→q.ThesemanticsofquantifiedBooleanformulasisdefinedbyextendingthesemanticsof propositionalformulastoquantifiers.Todefinethisextension,letusintroduceanewnotation.LetIbe aninterpretation,pan variable,andba booleanvalue.Then byI[p←b]we denote the interpretationdefinedasfollows:I[p←b](q)def=I(q),ifp6=q;b,ifp=q.ItiseasytoseethatI[p←b](p)=bandthatI[p←b]agreeswithIonallvariablesdifferentfromp.1DEFINITION11.2(Truth)The notionof truthforquantifiedbooleanformulasisobtainedfrom Definition3.2on page31of truthof propositionalformulasby addingthefollowingitems.1The definitionofI[p←b]isnearlyidenticaltothatofI+ (p7→b),exceptthatwe do not requirethatIbe undefinedonp.December 1, 2020draftTime 19:26

  3. cs21111logic_第2张图片

    CHAPTER 11.QUANTIFIED BOOLEAN FORMULAS155(7)I(∀pF)=1if andonly ifI[p←0](F)=1andI[p←1](F)=1.(8)I(∃pF)=1if andonly ifI[p←0](F)=1orI[p←1](F)=1.As in the caseof propositionalformulas,we will writeIF,ifFistrueinI.❏In other words,theformula∀pFistrueinIiffor allboolean valuesbwe haveI[p←b]=1,and theformula∃pFistrueinIifthereexistsa boolean valuebsuch thatI[p←b]=1.So∀pFisinformally read as “for allp,F”,and∃pFisread as“there existspsuch thatF”.The notionsofsatisfiability,validityandequivalenceare defined in thesame way as forpropositionalformulas.We can evaluate a quantifiedboolean formula in an interpretationusing Definition 11.2of truth,but the evaluation isnot asstraightforwardasin the caseof propositionalformulas.EXAMPLE11.3Letusconsideranexample:evaluationof theformula∀p∃q(p↔q)intheinterpretationI={p7→1,q7→0}.Letusintroduceanotationwhichisconvenientforthisexample.Foranytwobooleanvaluesb1,b2denotebyIb1b2theinterpretation{p7→b1,q7→b2}.In thisnotationIcan bedenoted asI10.By the definition,we haveI10∀p∃q(p↔q)⇔I00∃q(p↔q)I10∃q(p↔q)and⇔I00p↔qI01p↔qorandI10p↔qI11p↔qorThis evaluatestotrue,sotheformula istrueinI10.Thisformula evaluationprocesscan bedepictedasan AND-OR tree as follows:I10∀p∃q(p↔q)∧I00∃q(p↔q)∨I10∃q(p↔q)∨I00p↔qI01p↔qI10p↔qI11p↔qNote the essentialdifference between the evaluations of propositional and quantified booleanformulas.To evaluateaquantifiedbooleanformula,we buildand AND-OR tree,which isunnecessary for propositionalformulas.In fact,evaluation of quantified boolean formulas isa PSPACE-complete problem,while propositionalformulas can be evaluated in polynomialtime.Observe what happenswhen we evaluate∀p∃q(p↔q)inadifferentinterpretation.Itisnothardtoseethattheresultwillbe thesame.Indeed,letusextendthenotationIb1b2Time 19:26draftDecember 1,2020

  4. cs21111logic_第3张图片

    15611.1Quantified Boolean Formulasby usingwildcardsforb1,b2.If we useforbi,itmeans that we do not know the valuebiinI.For example,Istandsforan arbitraryinterpretation(boththevaluesb1andb2areunknown).We haveI∀p∃q(p↔q)⇔I0∃q(p↔q)I1∃q(p↔q)and⇔I00p↔qI01p↔qorandI10p↔qI11p↔qorTherefore,the formula∀p∃q(p↔q)istrueinallinterpretationsI,hence it isvalid.❏11.1.2Free and Bound VariablesThe truthvalueof apropositionalformulaFinaninterpretationdepends,ingeneral,onthetruthvaluesof allvariablespoccurringinF.As one canseefrom Example 11.3,forquantifiedbooleanformulasthesituationisdifferent:thetruthvalueofFinIdoesnotdependon thevaluesinIof variablesoccurringinquantifiers,calledthebound variablesinF.DEFINITION11.4(Subformula,Polarity,Free and Bound Occurrences)The notion of subformula for quantifiedbooleanformulasisobtained from thatof Definition3.7on page35forpropositionalformulasby adding the followingitem:(6)The formulaF1isthe immediate subformula of theformulas∀pF1and∃pF1.The notions ofpositionandpolarityfor quantifiedboolean formulasareobtainedfrom thatofDefinition4.10onpage50byaddingthefollowingitem.LetF|π=GandGhastheform∀pG1or∃pG1.Thenπ.1isapositioninF,F|π.1def=G1andpol(F, π.1)def=pol(F, π).We will usethenotionsofpositiveandnegativeoccurrencesof subformulasinthesame way aswe did for propositionalformulas,seeDefinition4.10 on page50.Letpbe a booleanvariable andF|π=p.We say that the occurrence ofpat thepositionπinFisboundifπcanbe representedasaconcatenationof twostringsπ1π2suchthatF|π1hastheform∀pGor∃pGforsomeG.OtherwisetheoccurrenceofpinFissaid tobefree.Ifavariablephassome free(respectively,bound)occurrencesinF,we callpafree(respectivelybound)variable ofF.A quantifiedboolean formulaFiscalledclosedifithas nofreevariables.❏As an example,considertheformulap→ ∀q∃p(q↔p)∨r.The variablephasbothfreeand bound occurrencesinit:thefirstoccurrenceofpisfree,whilethelastoneisbound.Thevariableqhasonlyboundoccurrencesintheformulas,andthevariableronlyfreeDecember 1, 2020draftTime 19:26

  5. cs21111logic_第4张图片

    CHAPTER 11.QUANTIFIED BOOLEAN FORMULAS157occurrences.Therefore,pandrare thefreevariablesof thisformula,whilepandqarethebound ones.Inthesequelwe willdenoteby∀∃asymbolwhichstandsforeither∀or∃.Whenwe useseveraloccurrencesof thissymbolinthesame context,alloccurrenceswillstandforthesamequantifier,i.e.,either∀or∃butnot both.We may alsousesubscripts∀∃itodistinguishbetween differentquantifiers.Thenotionsof freeandboundoccurrencesofvariablesarebestillustratedwhen theformula isrepresentedina tree-likeform.An occurrenceofa variablepisbound,ifabovethisoccurrenceinthe treethereisa node∀∃p.Consider,forexample,theparsetreefortheformulap→ ∀q∃p(q↔p)∨r:→p∨∀qr∃p↔qpItcan easilybe seenthat,forexample,theoccurrenceof thevariableqina leaf of thetreeisbound,sinceabove it thetreecontains∀q.11.1.3Truth and SatisfiabilityBy straightforwardinductionon thedefinitionof truth,itisnot hardtoargue that thevalueof aquantifiedboolean formulas onlydependson thevaluesofitsfreevariables.LEMMA11.5LetI1andI2be two interpretationswhich agree on all freevariablesofF,i.e.,forallfreevariablespofFwe haveI1(p)=I2(p).ThenI1Fif and onlyifI2F.PROOF.The proof is by induction onF.We will only consider the case whenFhas the form∀pG,other cases are similar.LetVbe the set of allfreevariables ofF.Then the set of free variablesofGisa subset ofV∪ {p}.Therefore, for everyboolean valueb I1[p←b]agreeswithI2[p←b]on allfree variablesofG,thisfactwillbe used when we apply the induction hypothesis below.We haveI1∀pG⇔(bythe definitionof truth)I1[p←0](G)=1andI1[p←1](G)=1⇔(usingthe induction hypothesis)I2[p←0](G)=1andI2[p←1](G)=1⇔(bythe definitionof truth)I2∀pG.❏Time 19:26draftDecember 1,2020

  6. cs21111logic_第5张图片

    15811.1Quantified Boolean FormulasThis lemma impliesthe followingconsequenceforclosedformulas.LEMMA11.6Forclosedquantifiedbooleanformulasthenotionsof truth,validityandsatisfiabilitycoincideinthefollowingsense:forevery interpretationIand closed formulaFthefollowingpropositionsareequivalent:(i)IF;(ii)Fissatisfiable;and (iii)Fisvalid.PROOF.Evidently,ifFisvalid,thenIF,andifIFthenFissatisfiable.Thereforeisenough toprove thatsatisfiabilityofFimpliesitsvalidity.Suppose thatFissatisfiable,thenforsome interpretationI1we haveI1F.TakeanarbitraryinterpretationI2.SinceFhasnofreevariables,thenI1andI2agree on allfree variablesofF.By Lemma 11.5 we haveI2F.SinceI2was arbitrary,the formulaFisvalid.❏Ingeneral,satisfiabilityand validityof quantifiedbooleanformulascaneasilybe seena specialcaseof satisfiability(or,equivalently,validity)of closed formulas.LEMMA11.7LetFbe aquantified booleanformulawithfreevariablesp1,...,pn.ThenFissatisfiable(respectively,valid)if andonlyif theformula∃p1...∃pnF(respectively,∀p1...∀pnF)issatisfiable.❏11.1.4Monotonic and Equivalent Replacement TheoremsOur next aimistoestablishanaloguesof theequivalentand monotonicreplacementtheorems.MonotonicReplacementTheorem 4.13canbereformulatedliterallyforquantifiedboolean formulas.THEOREM11.8(Monotonic Replacement)LetF1beasubformulaof aformulaG1andF1→F2bevalid.LettheformulaG2beobtainedfromG1byreplacementof oneormore positive(respectively,negative)occurrencesofF1byF2.Then the formulaG1→G2(respectivelyG2→G1)isvalid.PROOF.Later.❏Inotherwords,thetruthvalueof aformulaismonotoniconsubformulasoccurringpositivelyand anti-monotonicon subformulasoccurringnegatively.In a similarway we can prove an analogueof Equivalent Replacement Theorem 3.9.THEOREM11.9(EquivalentReplacement)LetF1beasubformulaof aformulaG1andF1≡F2.Let theformulaG2beobtained fromG1byreplacementof oneor moreoccurrencesofF1byF2.ThenG1≡G2.❏Note that MonotonicReplacement Lemma 4.12 on page 54 does not hold for quantifiedbooleanformulasbecauseof thebound variables.Indeed,considertheinterpretationI={p7→1,q7→1}.ThenIq→p.We alsohaveI∀p(q)butnotI∀p(p).ThisDecember 1, 2020draftTime 19:26

  7. cs21111logic_第6张图片

    CHAPTER 11.QUANTIFIED BOOLEAN FORMULAS159example also shows that Lemma 3.8 on equivalent replacementdoes not hold for quantifiedboolean formulas,sinceIp↔qbutI2∀p(p)↔ ∀p(q).11.1.5SubstitutionsInsomealgorithmsofthischapter,we willhavetoreplaceformulasbyotherformulas.When we replacesubformulasinquantifiedbooleanformulas,a specialcareisrequiredtodealwith bound variables.Freeoccurrencesof abooleanvariablepinaformulaFcorrespondtoa“parameter”ofF.For example,theformula∃q(¬p↔q)expressesthatthereisa booleanvaluewhichisequivalenttothenegationofp.In thisformulapcan beconsidereda parameter.We canreplacepby a formula,e.g.,p1∧p2,and obtaina formulawhich expressesthatthereisatruth valueequivalent to thenegation ofp1∧p2,namely∃q(¬(p1∧p2)↔q).Thus, replacement ofpby aformulacanberegardedassubstitutionof anexpressionforaparameter.We cannot,however, immediately formalize substitutionofvariablesby formulas assimplyreplacement of variables,astwo kindsof problemsarisefrom such a naive formalization.The firstproblem appearswhen we trytoreplacea boundvariable:theresultmay benotaformulaatall.For example,ifwe replacein∃q(¬p↔q)thevariableqby¬qweobtaintheexpression∃¬q(¬p↔ ¬q)which isnot a formula at all.Thissuggeststhatonlyfreeoccurrencesof variablescan bereplaced.However, thisrestrictionisnot enough.The secondproblem ariseswhen thesubstitutedformula containsfreevariableswhichbecome bound after the substitution.To illustratethisproblem,consideragaintheformula∃q(¬p↔q).Evidently,ifwe substitutea formulaFforp,we expect toobtaina formulawhich expressesthatthereexistsa booleanvalueqequivalenttothenegationofF.Let ustryto replacepby a formulaFwith free occurrence ofq,for example,byqitself.We obtaintheformula∃q(¬q↔q).Thisformula meansthatthereexistsa booleanvalueequivalentto itsown negation,which is not what we intended.Even worse,the formula∃q(¬p↔q)isvalidwhile theformula∃q(¬q↔q)isunsatisfiable.The problem in thiscasewas createdby the factthata freevariableofFbecomes bound after after we substituteFforp.Let usintroducea notionthatguaranteesthata substitutionpreservesthe meaningof a formula.DEFINITION11.10(Formula Free for a Variable)LetFandGbequantifiedbooleanformulas andpbe a variable.We say thatGisfreeforpinFifafterthereplacementinFofallfreeoccurrencesofpbyGno freeoccurrenceof avariableinGbecomes bound.Morestrictly,thiscan be formulatedasfollows.GisnotfreeforpinFif thereexistpathsπ1,π2and aformulaF1suchthatF|π1.π2=p,theoccurrenceofpatthepositionπ1.π2inFisfree,F|π1=∀∃qF1,andqisa freevariableofG.❏For example,the formulaqisnotfreeforpin∃q(¬p↔q).Ingeneral,a formulaGisfreeforpin∃q(¬p↔q)if andonly ifqisnot a freevariableofG.IfF, Garequantifiedbooleanformulasandpisavariable,we writeFGptodenotetheformulaobtainedbyreplacinginFallfreeoccurrencesofpbyG.When we use thisnotation,we alwaysassume thatGisfreeforpinF.Time 19:26draftDecember 1,2020

  8. cs21111logic_第7张图片

    16011.2Normal FormsWhat if weneedtosubstitutea formulaGforavariablepinFsoastopreservethemeaning of parameters,butGisnotfreeforpinF?Inthiscasewe can changeFintoanequivalentformulaF′sothatGisfreeforpinF′,and thensubstituteGforpinF′.Theaim of thetransformationchangingFintoF′istoreplacebound variablesinF′which arefreeinGby other bound variables.Thisoperationiscalledrenaming bound variables.Wewillgivequitearestrictivedefinitionof renamingbound variables,sincethedefinitioninitsmost generalform israthercomplex.However,thisrestrictivedefinitionisenoughforour purpose.DEFINITION11.11(Renaming Bound Variables)We saythataformulaF′isobtainedfromaformulaFbyrenamingboundvariablesifF′canbeobtainedfromFbyasequenceofthefollowingsteps.Let∀∃pGbeasubformulaofFandqbeavariablenotoccurringinF.Replace∀∃pGinFby∀∃q(Gqp).❏EXAMPLE11.12ConsidertheformulaF=∀p(∃p¬p∨p∨ ∃p(p→p)).We can applyrenamingof boundvariablestoitinthefollowingway.First,we renametheoccurrencesof thevariablepboundbytheoutermostquantifier∀pintoanew variableq.We obtaintheformula∀q(∃p¬p∨q∨ ∃p(p→p)).Next,we renamepin∃p¬ptoanew variabler.We obtaintheformula∀q(∃r¬r∨q∨ ∃p(p→p)).Thisformulalookssimplerthantheoriginalone sinceitisclear which quantifiersbind which occurrencesof variablesinit.Such formulas arecalledrectifiedand will bedefinedbelow.❏LEMMA11.13Let aformulaF′beobtained froma formulaFby renamingbound variables.ThenF≡F′.PROOF.Later❏DEFINITION11.14(Rectified Formula)A formulaFiscalledrectifiedif(i)novariableappearsboth freeand boundinF,and (ii)foreveryvariablep,theformulaFcontainsatmost one occurrence of quantifiers∀pand∃pbindingp.❏For example,theformula∃p¬p→ ∃p¬pisnotrectified,sinceitcontaintwoquantifiersbindingp.The formula∃p¬p→pisnotrectifiedsincephasbothfreeand boundoccurrencesinit.Evidently,both(i)and(ii)inDefinition11.14canbeachievedbyrenamingbound variables.Therefore,we have the followingresult.LEMMA11.15Every formulacan betransformed intoan equivalentrectifiedformulabyrenaming bound variables.❏11.2Normal FormsIn thissectionwe consider two normalformsof quantifiedbooleanformulas.For propositionalformulas,we introduced the notionsof CNF and clausal form.For quantified booleanDecember 1, 2020draftTime 19:26

  9. cs21111logic_第8张图片

    CHAPTER 11.QUANTIFIED BOOLEAN FORMULAS161formulas,we willfirstintroduceanotionof prenexform,thatis,a form inwhich all quantifiersareput infront of a quantifier-freeformula.The use of prenex normalforms makes itpossibletogeneralizethesplittingalgorithmtoquantifiedboolean formulasina relativelystraightforwardway inSection11.3.Then we introducethenotionof conjunctivenormalform(CNF)analogoustothenotionofCNF forpropositionalformulas.ItwillbeusedinSection11.4todefineaDLL procedureforquantifiedbooleanformulas.We donotconsiderthenotionof clausalnormalform here.Infact,onecanrepresentthestructurepreservingclausalnormal form transformationasan equivalence-preservingtransformationon quantifiedboolean formulas,seeExercise11.16.11.2.1Prenex FormIn thissectionwe introduce a classof quantifiedboolean formulas,calledprenex formulas.Prenex formulasare obtained byputtingquantifiersinfrontof apropositionalformula.DEFINITION11.16(PrenexForm)A quantified boolean formulaFissaid tobe inprenexform,orsimplyaprenex formulaif ithastheform∀∃1p1...∀∃npnG,whereGisa propositionalformula.A formulaFisaprenex formof aformulaGifFisprenex andF≡G.❏Forexample,theformula∃p∀q(p→q)isprenex,whiletheformula∃p(p→∀rr)isnot,sinceithasaquantifier∀rintherangeof→.Foreveryformulaoftheform∀∃1p1...∀∃npnG,we willreferto∀∃1p1...∀∃npnasaquantifierprefix.In thesequelwe will write∨∧todenote∧or∨inthesame way as we used∀∃todenote∀or∃.For example,p∨∧qmay denote eitherp∧qorp∨q.The following algorithm convertsformulaswithout equivalencesintotheirprenex form.We will show laterhow one can getridof equivalencesin quantifiedboolean formulas.ALGORITHM11.17(Prenexing)LetFbeaformula.ByLemma 11.15we canrenamebound variablesinFtomake it rectified,sowe assume thatFisrectified.The transformationofFintoitsprenexnormalform ismade usingtherewriterulesofFigure11.1.TherulesareappliedtoFuntilwe obtain a normalform,i.e.,no ruleisapplicable.❏EXAMPLE11.18Considerthefollowingrectifiedformula:∃q(q→p)→ ¬∀r(r→p)∨p.The PrenexingAlgorithm appliedtothisformula yields∃q(q→p)→ ¬∀r(r→p)∨p⇒∀q((q→p)→ ¬∀r(r→p)∨p)⇒∀q((q→p)→∃r¬(r→p)∨p)⇒∀q((q→p)→∃r(¬(r→p)∨p))⇒∀q∃r((q→p)→ ¬(r→p)∨p).Time 19:26draftDecember 1,2020

  10. cs21111logic_第9张图片

    16211.2Normal FormsPrenexingrules:∀∃pF1∨∧...∨∧Fn⇒∀∃p(F1∨∧...∨∧Fn)∀pF1→F2⇒ ∃p(F1→F2)∃pF1→F2⇒ ∀p(F1→F2)F1→ ∀pF2⇒ ∀p(F1→F2)F1→ ∃pF2⇒ ∃p(F1→F2)¬∀pF⇒ ∃p¬F¬∃pF⇒ ∀p¬FFigure 11.1:PrenexingrulesThe quantifierspushed out at eachtransformationstepareshadedinthispicture.Note thata differentsequence of transformation can result in a different (but equivalent)prenex form.For example,∃q(q→p)→ ¬∀r(r→p)∨p⇒∃q(q→p)→∃r¬(r→p)∨p⇒∃q(q→p)→∃r(¬(r→p)∨p)⇒∃r(∃q(q→p)→ ¬(r→p)∨p)⇒∃r∀q((q→p)→ ¬(r→p)∨p).Therefore,thesetofrewriterulesforprenexingisnotconfluent.However,theresultingprenex formula isequivalent to theoriginalone,seeLemma 11.19.❏Notethatitisessentialthattheformulausedintheprenexingalgorithmberectified.For example,taketheformulaFdef=∃p(p)∧p.Thisformulaisnotrectified.Thefirstprenexingruleappliedtothisformulayields∃p(p∧p).Thisformulaisnot equivalenttoF.LEMMA11.19All rulesof Figure11.1are equivalence-preservingwhen applied torectified formulas.PROOF.Later.❏Note alsothateachof theprenexingrulesrewritesa rectifiedformulaintoarectifiedone.Note also that there isno prenexing rules for equivalence.One cannot define simple prenexingrulesforequivalence.Indeed,theformula∀pF1↔F2is,ingeneral,neither equivalentto∀p(F1↔F2),nor to∃p(F1↔F2).Equivalencesmust be eliminatedfrom theformulabeforeprenexing.THEOREM11.20LetFbea rectifiedformulawithout occurrencesof equivalences.ThenthePrenexingAlgorithmterminateson theinputFand returnsa prenex formofF.PROOF.Termination isobvious.The equivalenceofFand anormal form obtained bythealgorithm followsimmediately from Lemma 11.19.Itremains to notethatany normal form isa prenexformula.❏December 1, 2020draftTime 19:26

  11. cs21111logic_第10张图片

    CHAPTER 11.QUANTIFIED BOOLEAN FORMULAS16311.2.2Conjunctive Normal FormsInthissectionwe introduceanotionofconjunctivenormalformofquantifiedbooleanformulas.Conjunctivenormalformisusedinmany systemsimplementingsatisfiabilitycheckingforsuch formulas.DEFINITION11.21(CNF)A quantified boolean formulaFisinconjunctivenormal form,orsimplyCNF,ifitiseither⊥,or⊤,orhastheform∀∃1p1...∀∃npnF1,wheren≥0andF1isapropositionalformulainconjunctivenormalform.A formulaGiscalledaconjunctivenormalformof aformulaFifGisequivalenttoFandGisinconjunctivenormal form.❏In other words,a formula isinCNF if it isprenex and itspropositionalpartisinCNF.One canobtainasimpleCNF transformationalgorithmbycombiningStandardCNFTransformationAlgorithm5.4onpage62andthePrenexingAlgorithm.However,onehastobecareful,sincethePrenexingAlgorithmissubjecttosomerestrictions:firstly,itdoesnotwork withformulascontainingequivalences,secondly,itcanbeincorrectonformulaswhich arenot rectified.The firstproblem iseasytoovercome,sincetherewriterulesusedfortheCNF transformationeliminateequivalencesanyhow.Tocopewiththesecond problem,one hastorename bound variablesinnewly obtained formulasassoon astheseformulasare notrectified,seeExample 11.23below.ALGORITHM11.22(CNF Transformation)An algorithmtransformingformulastotheirCNFs is given by the union of the rewrite rule systems of Figure 5.2 on page 63for obtainingCNF of a propositionalformulaandof Figure11.1forobtainingprenexform of rectifiedformulas.Ifatany stagewe obtainaformula thatisnotrectified,we alsoapplyrenamingof bounded variablestoobtaina rectifiedformula.Given an inputformulaG,we apply therewriterulestoitasfollows.IfGisrectified,thenwe simply apply any applicablerewriterule.Otherwise,we rename bound variablesinGtoobtaina rectifiedformula.❏EXAMPLE11.23Consider the followingformula:∀p(∀q(q∨p)↔p).Let us transform thisformula into CNF. We cannot apply any prenexing rule to this formula,becausethequantifier∀qisinthescopeof equivalence↔.So we usetherewriteruleforremoving equivalenceobtaining∀p((∀q(q∨p)→p)∧(p→ ∀q(q∨p))).Thisformulaisnotrectifieddespitethattheoriginalformulawas rectified,sowe havetorename bound variablesinittoobtaina rectifiedone:∀p((∀q(q∨p)→p)∧(p→ ∀r(r∨p))).Time 19:26draftDecember 1,2020

  12. cs21111logic_第11张图片

    16411.3Checking Satisfiability of Quantified Boolean Formulas by SplittingNow we can apply prenexing rulestoobtain a prenexformula:∀p((∀q(q∨p)→p)∧(p→∀r(r∨p)))⇒∀p((∀q(q∨p)→p)∧∀r(p→(r∨p)))⇒∀p∀r((∀q(q∨p)→p)∧(p→(r∨p)))⇒∀p∀r(∃q((q∨p)→p)∧(p→(r∨p)))⇒∀p∀r∃q(((q∨p)→p)∧(p→(r∨p))).To obtainaformulainCNF, itremainstoapplytherewriterulesused toobtainCNF of apropositionalformula:∀p∀r∃q(((q∨p)→p)∧(p→(r∨p)))⇒∀p∀r∃q(((¬(q∨p)∨p)∧(p→(r∨p))))⇒∀p∀r∃q(((¬q∧ ¬p)∨p)∧(p→(r∨p)))⇒∀p∀r∃q(((¬q∧ ¬p)∨p)∧(¬p∨r∨p))⇒∀p∀r∃q((¬q∨p)∧(¬p∨p)∧(¬p∨r∨p)).The resultingformula is in CNF.❏THEOREM11.24(CNF)LetGbea quantifiedbooleanformula.ThenthealgorithmterminatesonGand returnsa CNF ofG.PROOF.Later❏11.3Checking Satisfiability of QuantifiedBoolean FormulasbySplittingIn thisand the next sectionswe will modify the splitting algorithm and the DLL algorithm todeal with quantified boolean formulas.The new algorithms are similar to their propositionalanalogues,exceptfortwopoints.Firstly,theuniversallyquantifiedvariablesaretreateddifferentlyfromtheexistentiallyquantifiedones.Secondly,we cannotanymoresplitonvariablesin anarbitraryorder.Before formulatinga satisfiability-checkingalgorithm,we willmake a few simplifyingassumptions.ThesplittingalgorithmforpropositionalformulasisbasedonLemma 4.4:I¬p,thenFisequivalenttoF⊥pinI,andsimilarlyforIp.We needasimilarlemma for quantifiedbooleanformulas,butwe alsohavetotreatquantifiedvariables.ByLemma 11.7satisfiability-checkingforarbitraryquantifiedbooleanformulascanbereducedtosatisfiability-checkingforclosedquantifiedbooleanformulas.By Lemma 11.6,forclosedformulasthenotionsof truthinaninterpretationandsatisfiabilitycoincide,sothereisno need to deal withinterpretationsatall.The followinglemma isa syntacticanalogueof Lemma 4.4 which servesasa basisforthesplittingalgorithm.December 1, 2020draftTime 19:26

  13. cs21111logic_第12张图片

    CHAPTER 11.QUANTIFIED BOOLEAN FORMULAS165Simplificationrulesfor⊤:¬⊤⇒ ⊥⊤ ∧F1∧...∧Fn⇒F1∧...∧Fn⊤ ∨F1∨...∨Fn⇒ ⊤F→ ⊤⇒ ⊤⊤ →F⇒FF↔ ⊤⇒F⊤ ↔F⇒F∀p⊤⇒ ⊤∃p⊤⇒ ⊤Simplification rulesfor⊥:¬⊥⇒ ⊤⊥ ∧F1∧...∧Fn⇒ ⊥⊥ ∨F1∨...∨Fn⇒F1∨...∨FnF→ ⊥⇒ ¬F⊥ →F⇒ ⊤F↔ ⊥⇒ ¬F⊥ ↔F⇒ ¬F∀p⊥⇒ ⊥∃p⊥⇒ ⊥Figure 11.2:Simplificationrulesforquantified booleanformulasLEMMA11.25(i)Aclosed formula∀pFistrue if and onlyif theformulasF⊥pandF⊤paretrue.(ii)Aclosed formula∃pFistrueif andonlyif atleastoneof theformulasF⊥pandF⊤pistrue.PROOF.Later❏The splittingalgorithmforpropositionalformulasisbased on two ideas:splittingintoF⊥pandF⊤pandsimplificationof formulascontaining⊥and⊤.When we extendittoquantifiedbooleanformulas,we willhavetoextend boththetreatment of splittingand thesimplificationrules.For the latter,we add simplificationrulesforquantifierstothe rulesofFigure4.5on page46.The extendedsetof rulesisgiveninFigure11.2.Itisnot hardtoprovethattheserewriterulesareequivalence-preserving,i.e.,theright-handsideof everyruleisequivalent toitsleft-handsize.Let usintroducea usefulnotation.LetF=∀∃1p1...∀∃npnGbe a prenex formula suchthatGisa propositionalformula.We call theoutermost prefixofFthe longest subsequence∀∃1p1...∀∃npkof∀∃1p1...∀∃npnsuchthat∀∃1=...=∀∃k.For example,theoutermostprefix of any formula of the form∀p1∃p2∃p3G′is∀p1.The outermost prefix of∃p∃q(p∧q)is∃p∃q.ALGORITHM11.26(Splitting)The splittingalgorithmforquantifiedbooleanformulasisshown in Figure 11.3.The algorithm is parametrized by a functionselectsignedvariable(G),whereGisaclosedprenexformula.Thisfunctionreturnsapair(p, b)suchthatpisavariableoccurringintheoutermostprefixofGandbisabooleanvalue.Thefunctionsimplify(F)simplifiestheformulaFusingtherulesof Figure 11.2.The input to the algorithm isa closed rectifiedprenexformula.❏Letusmakeafewcommentsaboutthisalgorithm.Thevariablepselectedbythefunctionselectsignedvariableisusedforsplitting.When the quantifier∀∃is∀,we usetheequivalence∀pG′≡(G′)G1p∧(G′)G2p.We alwayshave{G1,G2}={⊥,⊤},sothefunctionselectsignedvariablenot onlyselectsthe variablep,but alsodecideswhich oneTime 19:26draftDecember 1,2020

  14. cs21111logic_第13张图片

    16611.3Checking Satisfiability of Quantified Boolean Formulas by Splittingproceduresplitting(G)input:closedrectifiedprenexformulaGoutput:0or1parameters:functionselectsignedvariablebeginG:=simplify(G)ifG=⊥thenreturn0ifG=⊤thenreturn1LetGhave the form∀∃p1...∀∃pkG1(p, b):=selectsignedvariable(G)LetG′be obtainedfromGby deleting∀∃pfrom itsoutermost prefixifb=0then(G1,G2):=(⊥,⊤)else(G1,G2):=(⊤,⊥)case(splitting((G′)G1p),∀∃)of(0,∀)⇒return0(0,∃)⇒returnsplitting((G′)G2p)(1,∀)⇒returnsplitting((G′)G2p)(1,∃)⇒return1endFigure 11.3:The splittingalgorithm for quantified booleanformulasof theformulas⊥,⊤should betriedfirst.If(G′)G1pevaluatesto0,then∀pG′evaluatesto0too,sothere isno need toevaluate(G′)G2p.The case when∀∃is∃issimilar.As inthecaseof thesplittingalgorithmforpropositionalformulas,thebehaviourofthisalgorithm isbest illustratedby a treewhose nodes are labelled by formulasGsuch thatsplitting(G)iscalled.Thistreeiscalledthesplittingtree.The arcsinthe splittingtreearelabelledby signedatomsp=0orp=1selectedby thefunctionselectsignedvariable.The booleanvalue0(respectively1)isused when we try(G′)⊥p(respectively,(G′)⊤p)first.Unlikethepropositionalcase,therearetwokindsof nodes:AND-nodes(additionallylabelledby∧)and OR-nodes(additionallylabelledby∨).They correspondrespectivelytothecaseswhen∀∃=∀and∀∃=∃inthealgorithm.When we have an AND-node (respectively,OR-node)inthetree,theresultistheconjunction(respectively,thedisjunction)oftheresultscollectedon the branches.Consider two examples.EXAMPLE11.27Considerthe(true)formula∀p∃q(p↔q).Two differentsplittingtreesforthisformula aregiven below.December 1, 2020draftTime 19:26

  15. cs21111logic_第14张图片

    CHAPTER 11.QUANTIFIED BOOLEAN FORMULAS167∀p∃q(p↔q)∧∃q(¬q)∨∃q(q)∨p=0p=1⊤q=0⊤q=1∀p∃q(p↔q)∧∃q(q)∨∃q(¬q)∨p=1p=0⊥q=0⊤q=1⊥q=1⊤q=0As one can see from thisexample,theorder of selectingbranchescan influencethesizeofthesplittingtree(butnot theresult!).❏EXAMPLE11.28Considerthe(false)formula∃q∀p(p↔q).A splittingtreeforthisformula isgiven below.∃q∀p(p↔q)∨∀p(¬p)∧∀p(p)∧q=0q=1⊥p=1⊥p=0Itfollowsfrom these examples that,in general,one cannot select arbitraryvariablestosplitupon,sincetheresultcan thenbecome incorrect.The splitvariablesmust be selectedfromtheoutermost quantifier prefix∀∃p1...∀∃pk.❏ItfollowsfromMonotonicReplacementTheorem 11.8thatforvariableshavingonlyoccurrences of the same polarity,itisnot necessary to consider two truth values,which givesusananalogueof thepureatom rule.However,thisanalogueisnot sostraightforwardasforpropositionalformulas.Consider,forexample,theformulaF=∃p(p).Thisformulaistrue.The variablephasonlya positiveoccurrenceinit,sotogetthevalue1,we havetoreplacethisoccurrenceby⊤.Considernow theformulaG=∀p(p).Thisformulaisfalse,buttogetthevalue0we have toreplacepby⊥ratherthan by⊤.As in thecaseofpropositionalformulas,itissufficienttoconsiderasinglevalueforp,butnow thisvaluedependsnot only onthe polarity,but alsoon thequantifierbindingp.The pureatomruleforquantifiedbooleanformulasisbasedonthefollowinglemmawhich generalizesPure Atom Lemma 4.15on page 54.LEMMA11.29(PureAtom)Letpbe abooleanvariableandFbe a formula.(1)If alloccurrencesofpinFarepositive,then∃pFisequivalenttoF⊤pand∀pFisequivalenttoF⊥p.Time 19:26draftDecember 1,2020

  16. cs21111logic_第15张图片

    16811.4The DLL Algorithm for Quantified Boolean Formulas(2)If alloccurrencesofpinFarenegative,then∃pFisequivalenttoF⊥pand∀pFisequivalenttoF⊤p.PROOF.Later . . ..❏Consider,forexample,theformula∃p∀q(p→q).The variablephasonlynegativeoccurrencesin∀q(p→q),so by thePure Atom Lemma this formula is equivalent to∀q(⊥ →q).By simplifyingthisformula,we obtain⊤without even consideringany truth valueforq.11.4The DLL Algorithm for Quantified Boolean FormulasAs in thecaseof propositionalformulas,theclausalanalogueof thesplittingalgorithmisobtainedby consideringformulasinCNF and addingunitpropagation.We willalsorefertoitastheDLL algorithm.However,unitpropagationforDLLformulasisdifferentfromthatforpropositionalformulasinthecaseof universallyquantifiedvariables.To illustratethedifference,considerthesimpleformula∀p(p).Ifwe applyunitpropagationtothesetof clauses{p},we obtaintheemptysetof clauses,which issatisfiablewhiletheformula∀ppisunsatisfiable.Therefore,unitpropagationdoesnotworkcorrectlyforthisexampleand shouldbe modified.The differencewithunitpropagationinthecaseof propositionalsatisfiabilitycomesfromthefactthatpisuniversallyquantified,soanyformulaoftheform∀p(p∧F)isunsatisfiable.Incontrast,anyformula∃p(p∧F)isequivalenttoF⊤p,soforexistentiallyquantifiedvariablesunitpropagationcanbedefinedasinthecaseofpropositionalsatisfiability.DEFINITION11.30(Unit Propagation)LetSbea setof clausesandQbe asequenceofquantifiers∀∃1p1......∀∃npn.We saythata setof clausesS′isobtainedfromSbyunitpropagationwithrespecttoQifS′isobtainedfromSbyrepeatedlyperformingthefollowingtransformation:ifScontainsa unitclauseconsistingof oneliteralLof theformpor¬p,then(1)ifQcontains∀pthen replaceSby the set{✷};(2)otherwise dothefollowing:(a)remove fromSevery clauseof theformL∨C′;(b)replace inSevery clauseof theformL˜∨C′by the clauseC′.❏ALGORITHM11.31(DLL for quantifiedboolean formulas)The algorithm isshown in Figure 11.4.The functionselectliteralselectsa literalpor¬psuch thatpoccursinthe outermost quantifier prefixof∀∃p1...∀∃pn.To evaluate a closed rectifiedformulaGof the form∀∃1p1...∀∃npnG,whereGisa propositionalformulaC1∧...∧Cmin CNF, we run the algorithmon thesequenceof quantifiers(∀∃1p1...∀∃npnand set of clauses{C1,...,Cm}).❏December 1, 2020draftTime 19:26

  17. cs21111logic_第16张图片

    CHAPTER 11.QUANTIFIED BOOLEAN FORMULAS169procedureDLL(Q, S)input:sequence of quantifiersQ=∀∃1p1...∀∃npn,setof clausesSoutput:0or1parameters:functionselectliteralbeginS:=propagate(Q, S)ifSisemptythenreturn1ifScontains✷thenreturn0L:=selectliteral(∀∃1p1...∀∃npn,S)Letpbe the variableofLLetQ1be obtainedby deleting∀∃1pfromQcase(DLL(Q1,S∪ {L}),∀∃1)of(0,∀)⇒return0(0,∃)⇒returnDLL(Q1,S∪ {L˜})(1,∀)⇒returnDLL(Q1,S∪ {L˜})(1,∃)⇒return1endFigure 11.4:The DLL algorithm for quantifiedboolean formulasEXAMPLE11.32Consider the followingformula in CNF:∃p∀q∃r((p∨q∨ ¬r)∧(p∨ ¬q∨r)∧(¬p∨q∨r)∧(¬p∨q∨ ¬r)).TheDLL algorithmonthisformulaisillustratedinFigure11.5.Thesplittingstepsaredenotedbysolidlines,whiletheunitpropagationstepsbydashedlines.Theformulaistrue.❏One can add the pure literalruletotheDLL algorithm for quantified booleanformulasusingLemma 11.29.Inadditiontothepureliteralrule,thealgorithmalsoadmitsanotherrulewhich can be applied to eliminatesome literalsinclauses.ConsideraquantifierprefixQ.Introducean order>Qonvariablesasfollows:p >qifpoccursbeforeqinQ.Forexample,whenQ=∀p∃q∀r,we havep>Qq>Qr.Thisorderisnaturallyextendedtoapartialorderonliterals:fortwoliteralsL1,L2withvariablesp1,p2respectively,we haveL1> L2ifp1> p2.For example,forthe prefixQasabove,we havep>Q¬q,¬p>Q¬q,and¬p >Qqbecausep>Qq.We callaliteralLuniversal(respectively,existential)inQ,ifQcontains∀p(respectively,∃p)andpoccurs inL.For example for the prefixQasabove,the universal literalsin thisprefix arep,¬p, r,¬r,while theexistentialones areq,¬q.LEMMA11.33(UniversalLiteralDeletion)LetG=Q(C1∧...∧Cn)be a closed rectifiedCNF formula,whereQisitsquantifierprefix.SupposethatsomeCiisnotatautology,Time 19:26draftDecember 1,2020

  18. cs21111logic_第17张图片

    17011.5OBDD-Based Algorithms for Quantified Boolean Formulas∃p∀q∃rp∨q∨ ¬rp∨ ¬q∨r¬p∨q∨r¬p∨q∨ ¬r∀q∃r¬pp∨q∨ ¬rp∨ ¬q∨r¬p∨q∨r¬p∨q∨ ¬rp=0∨∀q∃rq∨ ¬r¬q∨r∧∃r¬qq∨ ¬r¬q∨rq=0∃rqq∨ ¬r¬q∨rq=1∃r1∃r1Figure 11.5:DLL algorithm on the formula of Example 11.32containsa literalLuniversalinQ,and thisliteralissmaller w.r.t.>Qthanany existentialliteralinCi.Then removal ofLfromCidoes not changethetruthvalueofG.PROOF.Later . . .❏Consideran example.Suppose thatQ=∀p∃q∀r∃s.Then any literalcontainingrcanberemoved from every non-tautologicalclausewhich does not contains.This lemma also implies that, if there existsa clauseCicontaining only literalsuniversalinQ,thentheformulaGisunsatisfiable.Indeed,allliteralsof thisclausecan be removedby Lemma 11.33, so we obtain the empty clause.11.5OBDD-Based AlgorithmsforQuantifiedBooleanFormulasThe expressivepower of quantifiedbooleanformulasisthesame astheexpressivepowerof propositionalformulas.This means that for every quantifiedbooleanformulaFone caneffectivelyfindapropositionalformulaGequivalenttoF.IngeneralGcannotbe foundDecember 1, 2020draftTime 19:26

  19. cs21111logic_第18张图片

    CHAPTER 11.QUANTIFIED BOOLEAN FORMULAS171inpolynomialtime,unlessNP=PSPACE, but the observationabout theequivalenceof theexpressivepowersof propositionaland quantifiedbooleanformulasshowsthatquantifiedboolean formulas can berepresentedby OBDDs.One can built OBDDs from quantified boolean formulas using OBDD Construction Algorithm 10.14 on page 144 modified for quantified boolean formula.The only change to thealgorithm is that closedformulasFare evaluated to0or1using any satisfiability-checkingalgorithmforquantifiedbooleanformula.Thereexists,however,adifferentalgorithmforbuildinganOBDD basedonquantifierelimination.We willdescribesuchanalgorithmbelow,sinceitwillalsobe usefulfor model checking proceduresdefinedinthe subsequentchapters.Quantifiereliminationtakesaquantifiedbooleanformulaandreturnsanequivalentpropositionalformula.We areinterestedinperformingquantifiereliminationdirectlyonOBDDs.Thatis,we willdefineanalgorithmwhich,givenanOBDDdforaformulaF,computesanOBDD for a formula∃p1...∃pnFor∀p1...∀pnF,where{p1,...,pn}isasubset of variablesofF.As any other OBDD algorithm, the quantifier elimination algorithm analyzes the OBDDdforFtop-down,butbuildstheresultingOBDD bottom-up.As anyotherOBDD algorithm,itworksonaglobaldagDcontainingatleasttheinputOBDD forF,butmaybesome otherOBDDs.For simplicity,we onlypresentanalgorithmwhicheliminatesexistentialquantifiers,thereadercaneasilybuildasimilaralgorithmforeliminatinguniversalquantifiers.As onecanguess,thealgorithmforeliminatingexistentialquantifiersisverysimilartothealgorithmforbuildingthedisjunctionof OBDDs,seeFigure10.12onpage 151.ALGORITHM11.34(Quantifier EliminationinOBDDs)An algorithm for quantifier eliminationinOBDDs isgiveninFigure11.6.InthisalgorithmDisaglobaldagwhichsatisfiesallconditions1–6of thedefinitionof BDDsandwhich containsOBDDs rootedatn1,...,nmassubdags.The functionmaxvariable(n1,...,nm)returnsthemaximalvariableoccurringintheOBDDs rooted atn1,...,nm.❏THEOREM11.35Letn1,...,nmbe nodes representing formulasF1,...,Fm,respectively.Thenexelim({p1,...,pk},{n1,...,nm})returns anodenrepresentinga formula equivalent to∃p1...∃pk(F1∨...∨Fm).❏ExercisesEXERCISE11.1Show how to derive Equivalent Replacement Theorem fromMonotonic Replacement Theorem for formulas without↔.❏EXERCISE11.2Draw parse treesfor thefollowing formulas:(1)∀p(p→ ∃q(q∧ ¬p)∨q)↔p∧ ∀q(r→p).Time 19:26draftDecember 1,2020

  20. cs21111logic_第19张图片

    17211.5OBDD-Based Algorithms for Quantified Boolean Formulasprocedureexelim({p1,...,pk},{n1,...,nm})parameters:a dagDcontainingn1,...,nmand0,1asnodesinput:nodesn1,...,nmrepresentingF1,...,FminDoutput:a nodenrepresenting∃p1...∃pk(F1∨...∨Fm)in(modified)Dbeginifm= 0thenreturn0ifm= 1andk= 0thenreturnn1ifsomeniis0thenreturnexelim({p1,...,pk},{n1,...,ni−1,ni+1,...,nm})ifsomeniis1thenreturn1p:=maxvariable(n1,...,nm)foralli= 1...mifniislabelledbypthen(li,ri):=(neg(ni),pos(ni))else(li,ri):=(ni,ni)ifp∈ {p1,...,pk}thenreturnexelim({p1,...,pk}− {p},{l1,...,lm,r1,...,rm})elsek1:=exelim({p1,...,pk},{l1,...,lm})k2:=exelim({p1,...,pk},{r1,...,rm})ifk1=k2thenreturnk1returnintegrate(k1,p,k2,D)endFigure11.6:An algorithm for eliminatingexistentialquantifiersinOBDDs(2)∀p(p→ ∃q(q→ ∀r(p∨q∨r))).(3)(∀p(∃rr→p)→q)∧(∀q(∃rr→q)→p).❏EXERCISE11.3For each of theformulas of Exercise11.2,underline free occurrences of variablesinit.Which of these formulas areclosed?❏EXERCISE11.4Which of theformulasof Exercise11.2,arerectified?Rectifythenon-rectifiedformulas by renaming bound variables in them.❏EXERCISE11.5Transform the following formulas intoprenex form:(1)∀p¬p∨ ∀p p→ ¬p;(2)∀p p→ ∃p p.❏EXERCISE11.6Transform the following formulas into CNF:December 1, 2020draftTime 19:26

  21. cs21111logic_第20张图片

    CHAPTER 11.QUANTIFIED BOOLEAN FORMULAS173(1)∀p(p↔(∀q∃r(q→p∧r)));(2)∀q(∀p(p→q)→ ∀p(¬q→p));(3)∀q(∀p(¬q→p)→ ∀p(p→q)).❏EXERCISE11.7Evaluate the following formulasusing the SplittingAlgorithm:(1)∃r∀q∃p(p↔((p→r)↔q));(2)∀r∀q∃p(p↔((p→r)↔q));(3)∀q(∀p(p→q)→ ∀p(¬q→p));(4)∀q(∀p(¬q→p)→ ∀p(p→q)).❏EXERCISE11.8ForeachformulaofExercise11.7,makeatableconsistingofitssubformulas,theirpositionsand polarities.❏EXERCISE11.9For each of the following formulas, show howone can simplifytheformula usingPure Atom Lemma 11.29.(1)∀p(p→ ∃q∃r((q∧ ¬r)∨ ¬p));(2)∀q(∀p(¬q→p)→ ∀p(p→q)).❏EXERCISE11.10Design analgorithm foreliminatinguniversalquantifiersinOBDDs, similar toAlgorithm 11.34.❏EXERCISE11.11Evaluate the formulas of Example 11.7 using the following algorithm.First,buildan OBDD which represents the propositional part of theformula.Then apply quantifier eliminationtotheOBDD until all quantifiers are eliminated.❏EXERCISE11.12Consider the following formula in CNF:∀s∃p∀q∃r((¬p∨q∨r∨s)∧(¬p∨q∨ ¬r∨s)∧(p∨q)∧(p∨q∨ ¬r∨ ¬s)).Evaluate thisformula usingonly the pure literalruleand unit propagation.❏EXERCISE11.13For eachof thefollowing formulas inCNF,evaluatetheformula usingonlythepure literalrule,universal literaldeletion,and unit propagation.(1)∀p∃q∀s∃r((p∨q∨s)∧(p∨ ¬q∨ ¬r)∧(p∨ ¬q∨r∨ ¬s));(2)∃p∀q∃r∀s((p∨q∨s)∧(¬p∨ ¬q∨r)∧(¬q∨ ¬r∨s)).❏EXERCISE11.14Consider the following formula in CNF:∃p∃q∀r∃s((p∨ ¬r)∧(¬q∨r)∧(¬p∨q∨s)∧(¬p∨q∨r∨ ¬s)).Evaluate thisformula usingonly universal literaldeletion and unit propagation.❏EXERCISE11.15Evaluate eachof thefollowing formulasusing DLL:Time 19:26draftDecember 1,2020

  22. cs21111logic_第21张图片

    17411.5OBDD-Based Algorithms for Quantified Boolean Formulas(1)∀s∃p∀q∃r((¬p∨q∨r∨s)∧(¬p∨q∨ ¬r∨s)∧(p∨q)∧(p∨q∨ ¬r∨ ¬s));(2)∀p∃q∀s∃r((p∨q∨s)∧(p∨ ¬q∨ ¬r∨ ¬s)∧(p∨ ¬q∨r∨ ¬s));(3)∃p∃q∀r∃s((p∨ ¬r)∧(¬q∨r)∧(¬p∨q∨s)∧(¬p∨q∨r∨ ¬s)).❏EXERCISE11.16The structure-preserving clausalform transformation for propositional formulasintroducednewbooleanvariablesasnamesforsubformulas.Ifwe applyittoaformulaF,theobtained clausal formGis,ingeneral, not equivalent toF.Suppose thatp1,...,pnare allnew variablesintroduced duringthe transformation ofFintoitsclausalformG.Show thatFisequivalenttothequantified boolean formula∃p1...∃pnG.❏EXERCISE11.17Extend the splitting algorithm to work with non-prenex formulas.❏EXERCISE11.18A formulaFhas the following OBDD.pqqrr10Apply the quantifier elimination algorithm tothisOBDD to obtain(1)theOBDD for the formula∃p∃rF;(2)theOBDD for the formula∃qF.❏December 1, 2020draftTime 19:26

你可能感兴趣的:(逻辑回归)