Programming Languages

Invariants are constraints on software components which restrict their behavior in some desirable way, but whose maintenance entails some kind of proof obligation discharge. Such constraints may act not only over the input and output domains, as in a purely functional setting, but also over the underlying state space, as in the case of reactive components. This talk introduces an approach for reasoning about invariants which is both compositional and calculational: compositional because it is based on rules which break the complexity of such proof obligations across the structures involved; calculational because such rules are derived thanks to an algebra of invariants encoded in the language of binary relations. A main tool of this approach is the pointfree transform of the predicate calculus, which opens the possibility of changing the underlying mathematical space so as to enable agile algebraic calculation. The development of a theory of invariant preservation requires a broad, but uniform view of computational processes embodied in software components able to take into account data persistence and continued interaction. Such is the plan for this talk: we first introduce such processes as arrows, and then invariants as their types. 1 Components as Arrows Probably the most elementary model of a computational process is that of a function f : I −→ O, which specifies a transformation rule between two structures I and O. In a (metaphorical) sense, this may be dubbed as the ‘engineer’s view’ of reality: here is a recipe to build gnus from gnats. Often, however, reality is not so simple. For example, one may know how to produce ‘gnus’ from ‘gnats’ but not in all cases. This is expressed by observing the output of f in a more refined context: O is replaced by O + 1 and f is said to be a partial function. In other situations one may recognise that there is some context information about ‘gnats’ that, for some reason, should be hidden from input. It may be the case that such information is huge to be give as a parameter to f , or shared by other functions as well. It might also be the case that building gnus would eventually modify the environment, thus influencing latter production of more ‘gnus’. For U a denotation of such context information, the signature of f becomes f : I −→ (O × U) . In both cases f can be typed as f : I −→ T O, F.H. de Carvalho Junior and L.S. Barbosa (Eds.): SBLP 2012, LNCS 7554, pp. 1–5, 2012. c © Springer-Verlag Berlin Heidelberg 2012

[1]  David A. Wagner,et al.  A Class of Polynomially Solvable Range Constraints for Interval Analysis without Widenings and Narrowings , 2004, TACAS.

[2]  Philippe Coussy,et al.  Bitwidth-aware high-level synthesis for designing low-power DSP applications , 2010, 2010 17th IEEE International Conference on Electronics, Circuits and Systems.

[3]  Richard P. Gabriel,et al.  Gregor Kiczales, Jim des Rivières, and Daniel G. Bobrow, The Art of the Metaobject Protocol , 1993, Artif. Intell..

[4]  Manuel Fähndrich,et al.  Pentagons: a weakly relational abstract domain for the efficient validation of array accesses , 2008, SAC '08.

[5]  Jácome Cunha,et al.  Extension and implementation of ClassSheet models , 2012, 2012 IEEE Symposium on Visual Languages and Human-Centric Computing (VL/HCC).

[6]  Vivek Sarkar,et al.  ABCD: eliminating array bounds checks on demand , 2000, PLDI '00.

[7]  Scott A. Mahlke,et al.  Bitwidth cognizant architecture synthesis of custom hardwareaccelerators , 2001, IEEE Trans. Comput. Aided Des. Integr. Circuits Syst..

[8]  Jens Palsberg,et al.  Register allocation by puzzle solving , 2008, PLDI '08.

[9]  Jan Bosch,et al.  A taxonomy of variability realization techniques , 2005, Softw. Pract. Exp..

[10]  Mark Stephenson,et al.  Bidwidth analysis with application to silicon compilation , 2000, PLDI '00.

[11]  Fernando Magno Quintão Pereira,et al.  Dynamic Elimination of Overflow Tests in a Trace Compiler , 2011, CC.

[12]  Fernando Magno Quintão Pereira,et al.  The Design and Implementation of a Non-Iterative Range Analysis Algorithm on a Production Compiler , 2011 .

[13]  Jason R. C. Patterson,et al.  Accurate static branch prediction by value range propagation , 1995, PLDI '95.

[14]  Patrick Cousot,et al.  Why does Astrée scale up? , 2009, Formal Methods Syst. Des..

[15]  Flemming Nielson,et al.  Principles of Program Analysis , 1999, Springer Berlin Heidelberg.

[16]  Mark N. Wegman,et al.  Efficiently computing static single assignment form and the control dependence graph , 1991, TOPL.

[17]  Jan Reineke,et al.  Polynomial Precise Interval Analysis Revisited , 2009, Efficient Algorithms.

[18]  Patrick Cousot,et al.  Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints , 1977, POPL.

[19]  Zhiru Zhang,et al.  Bitwidth-aware scheduling and binding in high-level synthesis , 2005, Proceedings of the ASP-DAC 2005. Asia and South Pacific Design Automation Conference, 2005..

[20]  Rahul Gupta,et al.  Optimal Bitwise Register Allocation Using Integer Linear Programming , 2006, LCPC.

[21]  Axel Simon Value-Range Analysis of C Programs: Towards Proving the Absence of Buffer Overflow Vulnerabilities , 2008 .

[22]  Marcelo d'Amorim,et al.  Tainted Flow Analysis on e-SSA-Form Programs , 2011, CC.

[23]  Hakjoo Oh,et al.  Access Analysis-Based Tight Localization of Abstract Memories , 2011, VMCAI.

[24]  Carlos José Pereira de Lucena,et al.  On the Reuse and Maintenance of Aspect-Oriented Software: An Assessment Framework , 2003, SBES.

[25]  Rajiv Gupta,et al.  Bitwidth aware global register allocation , 2003, POPL.

[26]  Hakjoo Oh,et al.  Design and implementation of sparse global analyses for C-like languages , 2012, PLDI.

[27]  Bertrand Jeannet,et al.  Widening with Thresholds for Programs with Complex Control Graphs , 2011, ATVA.

[28]  Christian Prehofer,et al.  Feature-Oriented Programming: A Fresh Look at Objects , 1997, ECOOP.

[29]  Jácome Cunha,et al.  Discovery-based edit assistance for spreadsheets , 2009, 2009 IEEE Symposium on Visual Languages and Human-Centric Computing (VL/HCC).

[30]  Vikram S. Adve,et al.  LLVM: a compilation framework for lifelong program analysis & transformation , 2004, International Symposium on Code Generation and Optimization, 2004. CGO 2004..

[31]  David A. Wagner,et al.  A class of polynomially solvable range constraints for interval analysis without widenings , 2005, Theor. Comput. Sci..