Formalizing Soundness of Contextual Effects
A contextual effect system generalizes standard type and effect systems: where a standard effect system computes the effect of an expression e, a contextual effect system additionally computes the prior and future effect of e, which characterize the behavior of computation prior to and following, respectively, the evaluation of e. This paper describes the formalization and proof of soundness of contextual effects, which we mechanized using the Coq proof assistant. Contextual effect soundness is an unusual property because the prior and future effect of a term e depends not on e itself (or its evaluation), but rather on the evaluation of the context in which e appears. Therefore, to state and prove soundness we must “match up” a subterm in the original typing derivation with the possibly-many evaluations of that subterm during the evaluation of the program, in a way that is robust under substitution. We do this using a novel typed operational semantics. We conjecture that our approach could prove useful for reasoning about other properties of derivations that rely on the context in which that derivation appears.
Unable to display preview. Download preview PDF.
- 1.Aydemir, B., Charguéraud, A., Pierce, B.C., Pollack, R., Weirich, S.: Engineering formal metatheory. In: POPL (2008)Google Scholar
- 2.The Coq proof assistant., http://coq.inria.fr
- 3.Hicks, M., Foster, J.S., Pratikakis, P.: Lock Inference for Atomic Sections. In: TRANSACT (2006)Google Scholar
- 4.Igarashi, A., Kobayashi, N.: Resource Usage Analysis. In: POPL (2002)Google Scholar
- 5.Lucassen, J.M.: Types and Effects: Towards the Integration of Functional and Imperative Programming. PhD thesis, MIT Laboratory for Computer Science, MIT/LCS/TR-408 (August 1987)Google Scholar
- 6.Neamtiu, I., Hicks, M., Foster, J.S., Pratikakis, P.: Contextual Effects for Version-Consistent Dynamic Software Updating and Safe Concurrent Programming. Technical Report CS-TR-4920, Dept. of Computer Science, University of Maryland (November 2007)Google Scholar
- 7.Neamtiu, I., Hicks, M., Foster, J.S., Pratikakis, P.: Contextual effects for version-consistent dynamic software updating and safe concurrent programming. In: POPL (2008)Google Scholar
- 9.Skalka, C., Smith, S., Horn, D.V.: Types and trace effects of higher order programs. Journal of Functional Programming (July 2007)Google Scholar
- 10.Smith, F., Walker, D., Morrisett, G.: Alias types. In: Smolka, G. (ed.) ESOP 2000 and ETAPS 2000. LNCS, vol. 1782. Springer, Heidelberg (2000)Google Scholar
- 12.Walker, D., Crary, K., Morrisett, G.: Typed memory management in a calculus of capabilities. In: TOPLAS, July 2000, vol. 24(4), pp. 701–771 (2000)Google Scholar