Generating customized verifiers for automatically generated code

Ewen Denney, Bernd Fischer
2008 Proceedings of the 7th international conference on Generative programming and component engineering - GPCE '08  
Program verification using Hoare-style techniques requires many logical annotations. We have previously developed a generic annotation inference algorithm that weaves in all annotations required to certify safety properties for automatically generated code. It uses patterns to capture generator-and property-specific code idioms and property-specific meta-program fragments to construct the annotations. The algorithm is customized by specifying the code patterns and integrating them with the
more » ... program fragments for annotation construction. However, this is difficult since it involves tedious and error-prone low-level term manipulations. Here, we describe an approach that automates this customization task using generative techniques. It uses a small annotation schema compiler that takes a collection of high-level declarative annotation schemas tailored towards a specific code generator and safety property, and generates all customized analysis functions and glue code required for interfacing with the generic algorithm core, thus effectively creating a customized annotation inference algorithm. The compiler raises the level of abstraction and simplifies schema development and maintenance. It also takes care of some more routine aspects of formulating patterns and schemas, in particular handling of irrelevant program fragments and irrelevant variance in the program structure, which reduces the size, complexity, and number of different patterns and annotation schemas required. The improvements described here make it easier and faster to customize the system to a new safety property or a new generator, and we demonstrate this by customizing it to certify frame safety of space flight navigation code that was automatically generated from Simulink models by MathWorks' Real-Time Workshop. 0,0 ; . . . A[0,m]:= a 0,m ; A[1,0 ]:= a 1,0 ; . . . A[n,m]:= an,m; (a) for i:= 0 to n do for j:= 0 to m do A[i,j]:= a; (b) for i:= 0 to n -1 do for j:= 0 to m do A[i * n +j]:= a; (c)
doi:10.1145/1449913.1449926 dblp:conf/gpce/DenneyF08 fatcat:hu3y2xmkovhc5flhygmkxokody