手机版

Shape analysis through predicate abstraction and model check(8)

发布时间:2021-06-05   来源:未知    
字号:

Abstract. We propose a new framework, based on predicate abstraction and model checking, for shape analysis of programs. Shape analysis is used to statically collect information — such as possible reachability and sharing — about program stores. Rather t

reach[A;F](x,b,M):itispossibletoreachaddressbfromaddressxin0ormoresteps.Thewpisgivenby

reach[Ai;F](x,b,M)∨(¬A(i)∧reach[Ai;F](x,i,M)∧reach[Ai;F](c,b,M)) reachp[A;F](x,b,M):itispossibletoreachaddressbfromaddressxin1ormoresteps.Thisisde nedbyalloc(x)∧( k:F (x,k,A):¬A(k)∧reach[A;F](M(k),b,M)),withwp:

reachp[Ai;F](x,b,M)∨(reach[Ai;F](c,b,M)∧¬A(i)∧reach[Ai,F](x,i,M)) dshared[A;F](x,y,M):thereexistsanon-nullnodereachablefrombothxandy.Thisisde nedby( v:v=NULL:reach[A;F](x,v,M)∧reach[A;F](y,v,M)),withwp:

dshared[Ai;F](x,y,M)∨

(¬A(i)∧reach[Ai;F](x,i,M)∧dshared[Ai;F](y,c,M))∨

(¬A(i)∧reach[Ai;F](y,i,M)∧dshared[Ai;F](x,c,M))∨

(¬A(i)∧(c=NULL)∧reach[Ai;F](x,i,M)∧reach[Ai;F](y,i,M))

cyclic[A;F](x,M):xreachesanodethatisinvolvedinacycle.Thisisde nedby( v:reach[A;F](x,v,M)∧reachp[A;F](v,v,M)),withwp:

cyclic[Ai;F](x,M)∨

(¬A(i)∧reach[Ai;F](x,i,M)∧cyclic[Ai;F](c,M))∨

(¬A(i)∧reach[Ai;F](x,i,M)∧reach[Ai;F](c,i,M))

Fig.5.WeakestpreconditionsforshapepredicatesforM =M[i←c].Inthesefor-mulas,weuseAitorepresentA∪{i}

apreludetocomputingwpisgivenbyreach[valM(A);F](valM(e1),valM(e2),M).

Asanexample,intheprogramfromSection1,considerthepredicatereach[;n](x,k),andtheassignmentx:=t,wheretandxareoftypeList.Thetranslatedpredicateisgivenbyreach[;n](valM(x),valM(k),M),whiletheassignmentresultsinthememoryupdateM =M[α(x)←valM(t)].Sub-stitutingM forMgivesreach[;n](valM (x),valM (k),M )).Thissimpli es,usingthewpforreach,toreach[α(x);n](valM(t),valM(k),M)∨(true∧reach[;n](valM(t),α(x),M)∧reach[;n](valM(t),valM(k),M)).Fromthedef-thattcanneverreachtheaddressofx.Thus,theunderlinedtermsimpli estofalse,andtheresultis:reach[α(x);n](valM(t),valM(k),M).Theavoidingaddressα(x)issuper uousforthesamereason,soitcanberemoved,givingtheresult(inprogramsyntax)asreach[;n](t,k).

Shape analysis through predicate abstraction and model check(8).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
×
二维码
× 游客快捷下载通道(下载后可以自由复制和排版)
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能出现无法下载或内容有问题,请联系客服协助您处理。
× 常见问题(客服时间:周一到周五 9:30-18:00)