Abstract
Semantics is traditionally concerned with program equivalence, in which all pairs of programs which are not equivalent are treated the same, and simply dubbed as incomparable. In recent years, various forms of program metrics have been introduced such that the distance between non-equivalent programs is measured as an element of an appropriate quantale. By letting the underlying quantale vary as the type of the compared programs become more complex, the recently introduced framework of differential logical relations allows for a new contextual form of reasoning. In this paper, we show that all this can be generalised to effectful higher-order programs, in which not only the values, but also the effects computations produce can be appropriately distanced in a principled way. We show that the resulting framework is flexible, allowing various forms of effects to be handled, and that it provides compact and informative judgments about program differences.
Supplemental Material
- Martín Abadi, Luca Cardelli, and Pierre-Louis Curien. 1993. Formal Parametric Polymorphism. Theor. Comput. Sci., 121, 1&2 (1993), 9–58. https://doi.org/10.1016/0304-3975(93)90082-5 Google Scholar
Digital Library
- Harold Abelson and Gerald J. Sussman. 1996. Structure and Interpretation of Computer Programs, Second Edition. MIT Press.Google Scholar
Digital Library
- Alejandro Aguirre, Gilles Barthe, Marco Gaboardi, Deepak Garg, and Pierre-Yves Strub. 2019. A relational logic for higher-order programs. J. Funct. Program., 29 (2019), e16. https://doi.org/10.1017/S0956796819000145 Google Scholar
Cross Ref
- Mario Alvarez-Picallo and C.-H. Luke Ong. 2019. Change Actions: Models of Generalised Differentiation. In Proc. of FOSSACS 2019. 45–61. https://doi.org/10.1007/978-3-030-17127-8_3 Google Scholar
Cross Ref
- Roland Carl Backhouse and Paul F. Hoogendijk. 1993. Elements of a Relational Theory of Datatypes. In Formal Program Development - IFIP TC2/WG 2.1 State-of-the-Art Report. 7–42.Google Scholar
- Paolo Baldan, Filippo Bonchi, Henning Kerstan, and Barbara König. 2018. Coalgebraic Behavioral Metrics. Log. Methods Comput. Sci., 14, 3 (2018), https://doi.org/10.23638/LMCS-14(3:20)2018 Google Scholar
Cross Ref
- M. Barr. 1970. Relational algebras. Lect. Notes Math., 137 (1970), 39–55.Google Scholar
Cross Ref
- Gilles Barthe, Thomas Espitau, Benjamin Grégoire, Justin Hsu, and Pierre-Yves Strub. 2018. Proving expected sensitivity of probabilistic programs. Proc. ACM Program. Lang., 2, POPL (2018), 57:1–57:29. https://doi.org/10.1145/3158145 Google Scholar
Digital Library
- Gilles Barthe, Marco Gaboardi, Emilio Jesús Gallego Arias, Justin Hsu, César Kunz, and Pierre-Yves Strub. 2014. Proving Differential Privacy in Hoare Logic. In Proc. of CSF 2014. 411–424. https://doi.org/10.1109/CSF.2014.36 Google Scholar
Digital Library
- Gilles Barthe, Marco Gaboardi, Emilio Jesús Gallego Arias, Justin Hsu, Aaron Roth, and Pierre-Yves Strub. 2015. Higher-Order Approximate Relational Refinement Types for Mechanism Design and Differential Privacy. In Proc. of POPL 2015. 55–68. https://doi.org/10.1145/2676726.2677000 Google Scholar
Digital Library
- Gilles Barthe, Marco Gaboardi, Benjamin Grégoire, Justin Hsu, and Pierre-Yves Strub. 2016. Proving Differential Privacy via Probabilistic Couplings. In Proc. of LICS 2016. 749–758. https://doi.org/10.1145/2933575.2934554 Google Scholar
Digital Library
- Gilles Barthe, Boris Köpf, Federico Olmedo, and Santiago Zanella Béguelin. 2013. Probabilistic Relational Reasoning for Differential Privacy. ACM Trans. Program. Lang. Syst., 35, 3 (2013), 9:1–9:49. https://doi.org/10.1145/2492061 Google Scholar
Digital Library
- Nick Benton. 2004. Simple relational correctness proofs for static analyses and program transformations. In Proc. of POPL 2004. 14–25. https://doi.org/10.1145/964001.964003 Google Scholar
Digital Library
- Richard S. Bird and Oege de Moor. 1997. Algebra of programming. Prentice Hall.Google Scholar
- Brett Boston, Adrian Sampson, Dan Grossman, and Luis Ceze. 2015. Probability type inference for flexible approximate programming. In Proc. of OOPSLA 2015. 470–487. https://doi.org/10.1145/2814270.2814301 Google Scholar
Digital Library
- Yufei Cai, Paolo G. Giarrusso, Tillmann Rendel, and Klaus Ostermann. 2014. A theory of changes for higher-order languages: incrementalizing λ -calculi by static differentiation. In Proc. of PLDI ’14. 145–155. https://doi.org/10.1145/2594291.2594304 Google Scholar
Digital Library
- Michael Carbin, Deokhwan Kim, Sasa Misailovic, and Martin C. Rinard. 2012. Proving acceptability properties of relaxed nondeterministic approximate programs. In Proc. of PLDI 2012. 169–180. https://doi.org/10.1145/2254064.2254086 Google Scholar
Digital Library
- Michael Carbin, Sasa Misailovic, and Martin C. Rinard. 2013. Verifying quantitative reliability for programs that execute on unreliable hardware. In Proc. of OOPSLA 2013. 33–52. https://doi.org/10.1145/2509136.2509546 Google Scholar
Digital Library
- Konstantinos Chatzikokolakis, Daniel Gebler, Catuscia Palamidessi, and Lili Xu. 2014. Generalized Bisimulation Metrics. In Proc. of CONCUR 2014. 32–46. https://doi.org/10.1007/978-3-662-44584-6_4 Google Scholar
Cross Ref
- Swarat Chaudhuri, Sumit Gulwani, and Roberto Lublinerman. 2010. Continuity analysis of programs. In Proc. of POPL 2010. 57–70. https://doi.org/10.1145/1706299.1706308 Google Scholar
Digital Library
- Swarat Chaudhuri, Sumit Gulwani, Roberto Lublinerman, and Sara NavidPour. 2011. Proving programs robust. In Proc. of SIGSOFT/FSE’11. 102–112. https://doi.org/10.1145/2025113.2025131 Google Scholar
Digital Library
- Ezgi Çiçek, Gilles Barthe, Marco Gaboardi, Deepak Garg, and Jan Hoffmann. 2017. Relational cost analysis. In Proc. of POPL 2017. 316–329. https://doi.org/10.1145/3009837.3009858 Google Scholar
Digital Library
- Maria Manuel Clementino, Dirk Hofmann, and Walter Tholen. 2004. One Setting for All: Metric, Topology, Uniformity, Approach Structure. Appl. Categorical Struct., 12, 2 (2004), 127–154. https://doi.org/10.1023/B:APCS.0000018144.87456.10 Google Scholar
Cross Ref
- Raphaëlle Crubillé and Ugo Dal Lago. 2015. Metric Reasoning about λ -Terms: The Affine Case. In Proc. of LICS 2015. 633–644. https://doi.org/10.1109/LICS.2015.64 Google Scholar
Digital Library
- Raphaëlle Crubillé and Ugo Dal Lago. 2017. Metric Reasoning About λ -Terms: The General Case. In Proc. of ESOP 2017. 341–367. https://doi.org/10.1007/978-3-662-54434-1_13 Google Scholar
Digital Library
- Ugo Dal Lago and Francesco Gavazzo. 2019. Effectful Normal Form Bisimulation. In Proc. of ESOP 2019. 263–292. https://doi.org/10.1007/978-3-030-17184-1_10 Google Scholar
Cross Ref
- Ugo Dal Lago and Francesco Gavazzo. 2019. On Bisimilarity in Lambda Calculi with Continuous Probabilistic Choice. In Proc. of MFPS 2019. 121–141. https://doi.org/10.1016/j.entcs.2019.09.007 Google Scholar
Digital Library
- Ugo Dal Lago and Francesco Gavazzo. 2020. Differential Logical Relations Part II: Increments and Derivatives. In Proc. of ICTCS 2020. 101–114.Google Scholar
- Ugo Dal Lago and Francesco Gavazzo. 2021. Differential logical relations, part II increments and derivatives. Theoretical Computer Science, issn:0304-3975 https://doi.org/10.1016/j.tcs.2021.09.027 Google Scholar
Digital Library
- Ugo Dal Lago and Francesco Gavazzo. 2021. Resource Transition Systems and Full Abstraction for Linear Higher-Order Effectful Programs. In Proc. of FSCD 2021 (LIPIcs, Vol. 195). 23:1–23:19. https://doi.org/10.4230/LIPIcs.FSCD.2021.23 Google Scholar
Cross Ref
- Ugo Dal Lago and Francesco Gavazzo. 2022. A Relational Theory of Effects and Coeffects. Proc. ACM Program. Lang., 6, POPL (2022), 36:1–36:32. https://doi.org/10.1145/3498692 Google Scholar
Digital Library
- Ugo Dal Lago, Francesco Gavazzo, and Paul Blain Levy. 2017. Effectful applicative bisimilarity: Monads, relators, and Howe’s method. In Proc. of LICS 2017. 1–12. https://doi.org/10.1109/LICS.2017.8005117 Google Scholar
Cross Ref
- Ugo Dal Lago, Francesco Gavazzo, and Ryo Tanaka. 2017. Effectful Applicative Similarity for Call-by-Name Lambda Calculi. In Proc. of ICTCS 2017. 87–98.Google Scholar
- Ugo Dal Lago, Francesco Gavazzo, and Ryo Tanaka. 2020. Effectful applicative similarity for call-by-name lambda calculi. Theor. Comput. Sci., 813 (2020), 234–247. https://doi.org/10.1016/j.tcs.2019.12.025 Google Scholar
Digital Library
- Ugo Dal Lago, Francesco Gavazzo, and Akira Yoshimizu. 2019. Differential Logical Relations, Part I: The Simply-Typed Case. In Proc. of ICALP 2019. 111:1–111:14. https://doi.org/10.4230/LIPIcs.ICALP.2019.111 Google Scholar
- Ugo Dal Lago, Davide Sangiorgi, and Michele Alberti. 2014. On coinductive equivalences for higher-order probabilistic functional programs. In Proc. of POPL 2014. 297–308. https://doi.org/10.1145/2535838.2535872 Google Scholar
Digital Library
- Loris D’Antoni, Marco Gaboardi, Emilio Jesús Gallego Arias, Andreas Haeberlen, and Benjamin C. Pierce. 2013. Sensitivity analysis using type-based constraints. In Proc. of F[email protected] 2013. 43–50. https://doi.org/10.1145/2505351.2505353 Google Scholar
Digital Library
- B.A. Davey and H.A. Priestley. 1990. Introduction to lattices and order. Cambridge University Press.Google Scholar
- A.A. de Amorim, M. Gaboardi, J. Hsu, S. Katsumata, and I. Cherigui. 2017. A semantic account of metric preservation. In Proc. of POPL 2017. 545–556. https://doi.org/10.1145/3009837.3009890 Google Scholar
Digital Library
- Arthur Azevedo de Amorim, Marco Gaboardi, Justin Hsu, and Shin-ya Katsumata. 2019. Probabilistic Relational Reasoning via Metrics. In Proc. of LICS 2019. 1–19. https://doi.org/10.1109/LICS.2019.8785715 Google Scholar
Cross Ref
- Y. Deng. 2015. Semantics of Probabilistic Processes: An Operational Approach. Springer Berlin Heidelberg.Google Scholar
- Josee Desharnais, Vineet Gupta, Radha Jagadeesan, and Prakash Panangaden. 2004. Metrics for labelled Markov processes. Theor. Comput. Sci., 318, 3 (2004), 323–354. https://doi.org/10.1016/j.tcs.2003.09.013 Google Scholar
Digital Library
- W. Du, Y. Deng, and D. Gebler. 2016. Behavioural Pseudometrics for Nondeterministic Probabilistic Systems. In Proc. of SETTA 2016. 67–84. https://doi.org/10.1007/978-3-319-47677-3_5 Google Scholar
Cross Ref
- Vladimir Estivill-Castro and Derick Wood. 1992. A Survey of Adaptive Sorting Algorithms. ACM Comput. Surv., 24, 4 (1992), 441–476. https://doi.org/10.1145/146370.146381 Google Scholar
Digital Library
- Bob Flagg and Ralph Kopperman. 1997. Continuity Spaces: Reconciling Domains and Metric Spaces. Theor. Comput. Sci., 177, 1 (1997), 111–138. https://doi.org/10.1016/S0304-3975(97)00236-3 Google Scholar
Digital Library
- Marco Gaboardi, Andreas Haeberlen, Justin Hsu, Arjun Narayan, and Benjamin C. Pierce. 2013. Linear dependent types for differential privacy. In Proc. of POPL. 357–370. https://doi.org/10.1145/2429069.2429113 Google Scholar
Digital Library
- Francesco Gavazzo. 2018. Quantitative Behavioural Reasoning for Higher-order Effectful Programs: Applicative Distances. In Proc. of LICS 2018. 452–461. https://doi.org/10.1145/3209108.3209149 Google Scholar
Digital Library
- Francesco Gavazzo. 2019. Coinductive Equivalences and Metrics for Higher-order Languages with Algebraic Effects. Ph. D. Dissertation. University of Bologna, Italy. http://amsdottorato.unibo.it/9075/Google Scholar
- Daniel Gebler, Kim G. Larsen, and Simone Tini. 2016. Compositional bisimulation metric reasoning with Probabilistic Process Calculi. Log. Methods Comput. Sci., 12, 4 (2016), https://doi.org/10.2168/LMCS-12(4:12)2016 Google Scholar
Cross Ref
- P.G. Giarrusso. 2018. Optimizing and incrementalizing higher-order collection queries by AST transformation. Ph. D. Dissertation. University of Tübingen.Google Scholar
- Robert Harper. 2016. Practical Foundations for Programming Languages (2nd. Ed.). Cambridge University Press.Google Scholar
- D. Hoffman. 2015. A cottage industry of lax extensions. Categories and General Algebraic Structures with Applications, 3, 1 (2015), 113–151.Google Scholar
- D. Hofmann. 2007. Topological theories and closed objects. Adv. Math., 215 (2007), 789–824. https://doi.org/10.1016/j.aim.2007.04.013 Google Scholar
Cross Ref
- 2014. Monoidal Topology. A Categorical Approach to Order, Metric, and Topology, D. Hofmann, G.J. Seal, and W. Tholen (Eds.) (Encyclopedia of Mathematics and its Applications). Cambridge University Press.Google Scholar
- Shin-ya Katsumata, Tetsuya Sato, and Tarmo Uustalu. 2018. Codensity Lifting of Monads and its Dual. Log. Methods Comput. Sci., 14, 4 (2018), https://doi.org/10.23638/LMCS-14(4:6)2018 Google Scholar
Cross Ref
- A. Kurz and J. Velebil. 2016. Relation lifting, a survey. J. Log. Algebr. Meth. Program., 85, 4 (2016), 475–499. https://doi.org/10.1016/j.jlamp.2015.08.002 Google Scholar
Cross Ref
- Kim Guldstrand Larsen and Arne Skou. 1989. Bisimulation Through Probabilistic Testing. In Proceedings of POPL 1989. 344–352. https://doi.org/10.1145/75277.75307 Google Scholar
Digital Library
- F.W. Lawvere. 1973. Metric spaces, generalized logic, and closed categories. Rend. Sem. Mat. Fis. Milano, 43 (1973), 135–166.Google Scholar
Cross Ref
- P.B. Levy, J. Power, and H. Thielecke. 2003. Modelling Environments in Call-by-Value Programming Languages. Inf. Comput., 185, 2 (2003), 182–210. https://doi.org/10.1016/S0890-5401(03)00088-9 Google Scholar
Digital Library
- S. MacLane. 1971. Categories for the Working Mathematician. Springer-Verlag.Google Scholar
- Ernest G. Manes. 2002. Taut Monads and T0-spaces. Theor. Comput. Sci., 275, 1-2 (2002), 79–109. https://doi.org/10.1016/S0304-3975(00)00415-1 Google Scholar
Digital Library
- Sasa Misailovic, Daniel M. Roy, and Martin C. Rinard. 2011. Probabilistically Accurate Program Transformations. In Proc. of SAS. 316–333. https://doi.org/10.1007/978-3-642-23702-7_24 Google Scholar
Cross Ref
- Sparsh Mittal. 2016. A Survey of Techniques for Approximate Computing. ACM Comput. Surv., 48, 4 (2016), Article 62, 33 pages. https://doi.org/10.1145/2893356 Google Scholar
Digital Library
- Eugenio Moggi. 1989. Computational Lambda-Calculus and Monads. In Proc. of LICS 1989. IEEE Computer Society, 14–23. https://doi.org/10.1109/LICS.1989.39155 Google Scholar
Cross Ref
- Kobbi Nissim, Sofya Raskhodnikova, and Adam D. Smith. 2007. Smooth sensitivity and sampling in private data analysis. In Proc. of STOC 2007. 75–84. https://doi.org/10.1145/1250790.1250803 Google Scholar
Digital Library
- Paolo Pistone. 2021. On Generalized Metric Spaces for the Simply Typed Lambda-Calculus. In Proc. of LICS 2021. 1–14. https://doi.org/10.1109/LICS52264.2021.9470696 Google Scholar
Digital Library
- Gordon D. Plotkin. 1973. Lambda-Definability and Logical Relations. Memorandum SAI-RM-4, University of EdinburghGoogle Scholar
- Gordon D. Plotkin and John Power. 2001. Adequacy for Algebraic Effects. In Proc. of FOSSACS 2001. 1–24. https://doi.org/10.1007/3-540-45315-6_1 Google Scholar
Cross Ref
- Weihao Qu, Marco Gaboardi, and Deepak Garg. 2019. Relational cost analysis for functional-imperative programs. Proc. ACM Program. Lang., 3, ICFP (2019), 92:1–92:29. https://doi.org/10.1145/3341696 Google Scholar
Digital Library
- Ivan Radicek, Gilles Barthe, Marco Gaboardi, Deepak Garg, and Florian Zuleger. 2018. Monadic refinements for relational cost analysis. Proc. ACM Program. Lang., 2, POPL (2018), 36:1–36:32. https://doi.org/10.1145/3158124 Google Scholar
Digital Library
- Ganesan Ramalingam and Thomas W. Reps. 1993. A Categorized Bibliography on Incremental Computation. In Proc. of POPL 1993. 502–510. https://doi.org/10.1145/158511.158710 Google Scholar
Digital Library
- J. Reed and B.C. Pierce. 2010. Distance makes the types grow stronger: a calculus for differential privacy. In Proc. of ICFP 2010. 157–168. https://doi.org/10.1145/1863543.1863568 Google Scholar
Digital Library
- C.H. Richardson. 1954. An Introduction to the Calculus of Finite Differences. New York.Google Scholar
- Martin C. Rinard. 2011. Probabilistic accuracy bounds for perforated programs: a new foundation for program analysis and transformation. In Proceedings of PEPM 2011. 79–80. https://doi.org/10.1145/1929501.1929517 Google Scholar
Digital Library
- Adrian Sampson, Werner Dietl, Emily Fortuna, Danushen Gnanapragasam, Luis Ceze, and Dan Grossman. 2011. EnerJ: approximate data types for safe and general low-power computation. In Proc. of PLDI 2011. 164–174. https://doi.org/10.1145/1993498.1993518 Google Scholar
Digital Library
- Adrian Sampson, Pavel Panchekha, Todd Mytkowicz, Kathryn S. McKinley, Dan Grossman, and Luis Ceze. 2014. Expressing and verifying probabilistic assertions. In Proc. of PLDI 2014. 112–122. https://doi.org/10.1145/2594291.2594294 Google Scholar
Digital Library
- D. Sands. 1998. Improvement Theory and Its Applications. In Higher Order Operational Techniques in Semantics, A. D. Gordon and A. M. Pitts (Eds.). Cambridge University Press, 275–306.Google Scholar
Digital Library
- Tetsuya Sato, Gilles Barthe, Marco Gaboardi, Justin Hsu, and Shin-ya Katsumata. 2019. Approximate Span Liftings: Compositional Semantics for Relaxations of Differential Privacy. In Proc. of LICS 2019. 1–14. https://doi.org/10.1109/LICS.2019.8785668 Google Scholar
Cross Ref
- R. Sedgewick and P. Flajolet. 2013. An Introduction to the Analysis of Algorithms. Pearson Education.Google Scholar
- Stelios Sidiroglou-Douskos, Sasa Misailovic, Henry Hoffmann, and Martin C. Rinard. 2011. Managing performance vs. accuracy trade-offs with loop perforation. In Proc. of SIGSOFT/FSE’11. 124–134. https://doi.org/10.1145/2025113.2025133 Google Scholar
Digital Library
- V. Strassen. 1965. The existence of probability measures with given marginals. Ann. Math. Statist., 36, 2 (1965), 423–439.Google Scholar
Cross Ref
- A.M. Thijs. 1996. Simulation and fixpoint semantics. Rijksuniversiteit Groningen.Google Scholar
- F. Van Breugel and J. Worrell. 2005. A behavioural pseudometric for probabilistic transition systems. Theor. Comput. Sci., 331, 1 (2005), 115–142. https://doi.org/10.1016/j.tcs.2004.09.035 Google Scholar
Digital Library
- C. Villani. 2008. Optimal Transport: Old and New. Springer Berlin Heidelberg.Google Scholar
- Edwin M. Westbrook and Swarat Chaudhuri. 2013. A Semantics for Approximate Program Transformations. CoRR, abs/1304.5531 (2013), arxiv:1304.5531Google Scholar
- Hang Zhang, Mateja Putic, and John Lach. 2014. Low Power GPGPU Computation with Imprecise Hardware. In The 51st Annual Design Automation Conference 2014, DAC ’14, San Francisco, CA, USA, June 1-5, 2014. 99:1–99:6. https://doi.org/10.1145/2593069.2593156 Google Scholar
Digital Library
- Hengchu Zhang, Edo Roth, Andreas Haeberlen, Benjamin C. Pierce, and Aaron Roth. 2019. Fuzzi: a three-level logic for differential privacy. Proc. ACM Program. Lang., 3, ICFP (2019), 93:1–93:28.Google Scholar
Digital Library
- Zeyuan Allen Zhu, Sasa Misailovic, Jonathan A. Kelner, and Martin C. Rinard. 2012. Randomized accuracy-aware program transformations for efficient approximate computations. In Proc. of POPL 2012, John Field and Michael Hicks (Eds.). ACM, 441–454. https://doi.org/10.1007/978-3-642-35632-2_26 Google Scholar
Cross Ref
Index Terms
Effectful program distancing
Recommendations
Lambda Abstraction Algebras: Coordinatizing Models of Lambda Calculus
Lambda abstraction algebras are designed to algebraize the untyped lambda calculus in the same way cylindric and polyadic algebras algebraize the first-order logic; they are intended as an alternative to combinatory algebras in this regard. Like ...
Lambda Abstraction Algebras: Coordinatizing Models of Lambda Calculus
Lambda abstraction algebras are designed to algebraize the untyped lambda calculus in the same way cylindric and polyadic algebras algebraize the first-order logic; they are intended as an alternative to combinatory algebras in this regard. Like ...
Coproducts of Monads on Set
LICS '12: Proceedings of the 2012 27th Annual IEEE/ACM Symposium on Logic in Computer ScienceCoproducts of monads on $\Set$ have arisen in both the study of computational effects and universal algebra. We describe coproducts of consistent monads on $\Set$ by an initial algebra formula, and prove also the converse: if the coproduct exists, so do ...






Comments