Abstract
The calculus of relations has been widely used in program specification and reasoning. It is very tempting to use such specifications as running prototypes of the desired program, but, even considering finite domains, the inherent partiality and non-determinism of relations makes this impractical and highly inefficient. To tame partiality we prescribe the usage of invariants, represented by coreflexives, to characterize the exact domains and codomains of relational specifications. Such invariants can be used as pre-condition checkers to avoid runtime errors. Moreover, we show how such invariants can be used to narrow the non-deterministic execution of relational specifications, making it viable for a relevant class of problems. In particular, we show how the proposed techniques can be applied to execute specifications of bidirectional transformations, a domain where partiality and non-determinism are paramount.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Abramov, S., Glück, R.: The Universal Resolving Algorithm: Inverse Computation in a Functional Language. In: Backhouse, R., Oliveira, J.N. (eds.) MPC 2000. LNCS, vol. 1837, pp. 187–212. Springer, Heidelberg (2000)
Backhouse, R., Hoogendijk, P., Voermans, E., van der Woude, J.: A relational theory of datatypes (December 1992), draft of book in preparation, http://www.cs.nott.ac.uk/~rcb/MPC/papers
Bird, R., de Moor, O.: Algebra of Programming. International Series in Computer Science, vol. 100. Prentice-Hall (1996)
Cunha, A., Visser, J.: Transformation of structure-shy programs with application to XPath queries and strategic functions. Sci. Comput. Program. 76(6), 512–539 (2011)
Foster, N., Greenwald, M., Moore, J., Pierce, B., Schmitt, A.: Combinators for bidirectional tree transformations: A linguistic approach to the view-update problem. TOPLAS 2007 29(3) (2007)
Foster, N., Pilkiewicz, A., Pierce, B.: Quotient lenses. In: ICFP 2008, pp. 383–396. ACM (2008)
Hanus, M.: Multi-paradigm Declarative Languages. In: Dahl, V., Niemelä, I. (eds.) ICLP 2007. LNCS, vol. 4670, pp. 45–75. Springer, Heidelberg (2007)
Hidaka, S., Hu, Z., Inaba, K., Kato, H., Matsuda, K., Nakano, K.: Bidirectionalizing graph transformations. In: ICFP 2010, pp. 205–216. ACM (2010)
Hu, Z., Mu, S.C., Takeichi, M.: A programmable editor for developing structured documents based on bidirectional transformations. Higher-Order and Symbolic Computation 21(1-2), 89–118 (2008)
Liu, D., Hu, Z., Takeichi, M.: Bidirectional interpretation of XQuery. In: PEPM 2007, pp. 21–30. ACM (2007)
Macedo, N., Pacheco, H., Cunha, A.: Relations as executable specifications: Taming partiality and non-determinism using invariants. Technical Report TR-HASLab:03:2012, University of Minho (July 2012), http://www.di.uminho.pt/~nfmmacedo/publications/invariants-tr.pdf
Matsuda, K., Hu, Z., Nakano, K., Hamana, M., Takeichi, M.: Bidirectionalization transformation based on automatic derivation of view complement functions. In: ICFP 2007, pp. 47–58. ACM (2007)
Mu, S.-C., Hu, Z., Takeichi, M.: An Algebraic Approach to Bi-directional Updating. In: Chin, W.-N. (ed.) APLAS 2004. LNCS, vol. 3302, pp. 2–20. Springer, Heidelberg (2004)
Mu, S.-C., Oliveira, J.N.: Programming from Galois Connections. In: de Swart, H. (ed.) RAMICS 2011. LNCS, vol. 6663, pp. 294–313. Springer, Heidelberg (2011)
Oliveira, J.N.: Transforming Data by Calculation. In: Lämmel, R., Visser, J., Saraiva, J. (eds.) GTTSE 2007. LNCS, vol. 5235, pp. 134–195. Springer, Heidelberg (2008)
Oliveira, J.N.: Extended Static Checking by Calculation Using the Pointfree Transform. In: Bove, A., Barbosa, L.S., Pardo, A., Pinto, J.S. (eds.) LerNet ALFA Summer School 2008. LNCS, vol. 5520, pp. 195–251. Springer, Heidelberg (2009)
Pacheco, H., Cunha, A.: Generic Point-free Lenses. In: Bolduc, C., Desharnais, J., Ktari, B. (eds.) MPC 2010. LNCS, vol. 6120, pp. 331–352. Springer, Heidelberg (2010)
Pacheco, H., Cunha, A.: Calculating with lenses: Optimising bidirectional transformations. In: PEPM 2011, pp. 91–100. ACM (2011)
Schmidt, G.: Relational Mathematics. Encyclopedia of Mathematics and its Applications, vol. 132. Cambridge University Press (2010)
Voigtländer, J.: Bidirectionalization for free! (Pearl). In: POPL 2009, pp. 165–176. ACM (2009)
Voigtländer, J., Hu, Z., Matsuda, K., Wang, M.: Combining syntactic and semantic bidirectionalization. In: ICFP 2010, pp. 181–192. ACM (2010)
Wang, M., Gibbons, J., Matsuda, K., Hu, Z.: Gradual Refinement: Blending Pattern Matching with Data Abstraction. In: Bolduc, C., Desharnais, J., Ktari, B. (eds.) MPC 2010. LNCS, vol. 6120, pp. 397–425. Springer, Heidelberg (2010)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2012 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Macedo, N., Pacheco, H., Cunha, A. (2012). Relations as Executable Specifications: Taming Partiality and Non-determinism Using Invariants. In: Kahl, W., Griffin, T.G. (eds) Relational and Algebraic Methods in Computer Science. RAMICS 2012. Lecture Notes in Computer Science, vol 7560. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-33314-9_10
Download citation
DOI: https://doi.org/10.1007/978-3-642-33314-9_10
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-33313-2
Online ISBN: 978-3-642-33314-9
eBook Packages: Computer ScienceComputer Science (R0)