Software has been under scrutiny by the verification community from various angles in the recent past. There are two major algorithmic approaches to ensure the correctness of and to eliminate bugs from such systems: software model checking and static analy
TheatomicpropositionsthatareusedaslabelsontheCFGaregenerated,asmentionedbefore,intwosteps.Inthecaseofuninitializedvariableanalysis,theprocedurein-troducesthreelabelsforeachvariable.E.g.,thedeclarationofvariableainline2ofthecodefragment,forexample,leadstotheintroductionofthelabels:decla,usedaandassigneda.Eachoftheselabelswillbeanatomicproposi-tioninthemodelcheckingframework.
Next,wedescribetheassociatedtreepatternsforeachproposition.Propositiondecla,usedtolabeldeclarationsofvariablea,isassociatedwithpattern↓ Decl[Var:a].Onlynode26intheCFGmatchesthispattern,correspondingtothedeclarationinline2ofthesourcecode,andwillbela-belleddecla.
Propositionusedawilllabelnodesthatusethevari-ablea.Thesearenodeswhichareeither(i)labelledPlus,PostincorPreinc,andhaveachildlabelledVar:a,or(ii)nodeslabeledModifwitharighthand-sidechildVar:a.
Thecorresponding patternis↓(Plus∪Postinc∪Preinc∪...)[Var:a]↓Modif[Var:a[attr=”rhs”]].Node98inFigure3(a)matchesthispattern.However,thisnodeisnotpartoftheCFG.Hence,webacktracktothenearestances-torwhichispartoftheCFG,inthiscasenode72,andlabelituseda.Node72correspondstoline11inthecodefrag-ment.
Finally,forpropositionassignedawelookfornodesthatmodifyavariablewhichhavelabelssuchasModif,PostincorPreincandaleft-hand-sidesuccessorVar:a.Thiscorrespondstothepattern↓ (Modif∪Postinc∪Preinc)[Var:a[attr=”lhs”]].Node86willbelabeledassigneda,becauseitisthenearestancestorofanodethatmatchesthispattern.ThedescribedprocessresultsinthelabelledCFGdepictedinFigure3(b).
MODULEmain
VARlocation:{loc26,loc34,...,loc12}next(location)case
location=location=...
location=...esac
:=
loc26:{loc34};loc34:{loc39};
loc63:{loc78,loc72};
DEFINE
decla:=locationin{loc26};useda:=locationin{loc86};assigna:=locationin{loc72};SPECAGdecla=>(A usedaWassigna)
Figure4.NuSMVcode(fragment)
onwhichaisused,butnotassignedanyvaluebe-forehand.TheprototypetoolGoannawillwarntheuserwith:“Warning:Variable‘a’mightbeuninitialized”andautomaticallyproducesacoun-terexamplewiththesequenceoflinenumbers2,3,5,6,7,11.Notethatthisanalysispointstoapotentialbug.Thereareotherpropertiesthat,ifviolated,pointtode nitebugs.

