



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The c2bp tool, an automatic predicate abstractor for c code developed by microsoft research and uc berkeley. The tool handles the complex constructs of c, such as pointers, recursion, and structs, and provides a modular abstraction of procedures. It operates on an intermediate representation of the code and uses a provably sound algorithm to produce a boolean program that preserves the temporal properties of the original program. The tool has been successfully applied to verify properties of device drivers and other software systems.
Typology: Study notes
1 / 7
This page cannot be seen from the preview
Don't miss anything!




S^ o^ ft w^ a^ r e P^ r Tools o^ d^ u c^ tiv ity do { //get the write lock AcquireLock(&dev->lock); nPacketsOld = nPackets; request = dev->WriteListHeadVa; if( dev->WriteListHeadVarequest && request->status = request->Next; ){ ReleaseLock(&dev->lock); irp = request->irp; if(request->status irp->IoStatus.Status > 0){ = STATUS_SUCCESS; }^ irp->IoStatus.Information^ =^ request->Status; else{ irp->IoStatus.Status = STATUS_UNSUCCESSFUL; }^ irp->IoStatus.Information^ =^ request->Status; SmartDevFreeBlock(request); IoCompleteRequest(irp, IO_NO_INCREMENT); nPackets++; } } while ( nPackets != nPacketsOld ); ReleaseLock(&dev->lock); Question: Is locking protocol respected?
do { //get the write lock AcquireLock(&dev->lock); nPacketsOld = nPackets; request = dev->WriteListHeadVa; if( dev->WriteListHeadVarequest && request->status = request->Next; ){ ReleaseLock(&dev->lock); irp = request->irp; if(request->status irp->IoStatus.Status > 0){ = STATUS_SUCCESS; }^ irp->IoStatus.Information^ =^ request->Status; else{ irp->IoStatus.Status = STATUS_UNSUCCESSFUL; }^ irp->IoStatus.Information^ =^ request->Status; SmartDevFreeBlock(request); IoCompleteRequest(irp, IO_NO_INCREMENT); nPackets++; } } while (nPackets != nPacketsOld); ReleaseLock(&dev->lock);
do { AcquireLock(); b = true; if () { ReleaseLock(); b = b? false : ; } } while ( !b ); ReleaseLock(); do { //get the write lock AcquireLock(&dev->lock); nPacketsOld = nPackets; request = dev->WriteListHeadVa; if( dev->WriteListHeadVarequest && request->status = request->Next; ){ ReleaseLock(&dev->lock); irp = request->irp; if(request->status irp->IoStatus.Status > 0){ = STATUS_SUCCESS; }^ irp->IoStatus.Information^ =^ request->Status; else{ irp->IoStatus.Status = STATUS_UNSUCCESSFUL; }^ irp->IoStatus.Information^ =^ request->Status; SmartDevFreeBlock(request); IoCompleteRequest(irp, IO_NO_INCREMENT); nPackets++; } } while (nPackets != nPacketsOld); ReleaseLock(&dev->lock);
Boolean program Predicate Abstraction (C2bp) Model Checking (Bebop) [PASTE 2001, Spin 2000] Predicate Discovery (Newton)
no yes
n no side effects, no procedure calls
Statement in P: Predicates in E: y = y+1; {x==y} Weakest Precondition: wp(y=y+1, x==y) = x==y+ Strengthenings: S(x==y+1) = false S(x!=y+1)) = x==y Abstraction of s in B: b = b? false : *;
Weakest Precondition: wp(*p=3, x==5) = x==5 What if *p and x alias? We use Das’s pointer analysis [PLDI 2000] to prune disjuncts representing infeasible alias scenarios. Correct Weakest Precondition: (p==&x && 3==5) || (p!=&x && x==5) Statement in P: Predicates in E: *p = 3; {x==5}
n a signature is produced for each procedure in isolation n procedure calls are abstracted given the callees’ signatures
prev = NULL; newl = NULL; while (curr) { next = curr->next; if (curr->val > v) { if (prev) prev->next = next; curr->next = newl; L: newl = curr; } else prev = curr; curr = nextCurr; } prev == NULL curr == NULL prev->val > v curr->val > v (curr!=NULL) && ( prev==NULL || (prev->val <= v) && (curr->val >v) ) implies (prev != curr) at label L