Quantitative Behavioural Reasoning for Higher-order Effectful Programs: Applicative Distances

This paper studies quantitative refinements of Abramsky's applicative similarity and bisimilarity in the context of a generalisation of Fuzz, a call-by-value λ-calculus with a linear type system that can express program sensitivity, enriched with algebraic operations à la Plotkin and Power. To do so a general, abstract framework for studying behavioural relations taking values over quantales is introduced according to Lawvere's analysis of generalised metric spaces. Barr's notion of relator (or lax extension) is then extended to quantale-valued relations, adapting and extending results from the field of monoidal topology. Abstract notions of quantale-valued effectful applicative similarity and bisimilarity are then defined and proved to be a compatible generalised metric (in the sense of Lawvere) and pseudometric, respectively, under mild conditions.

[1]  Albert Thijs,et al.  Simulation and fixpoint semantics , 1996 .

[2]  Kenneth O. Kortanek,et al.  Discrete Infinite Transportation Problems , 1995, Discret. Appl. Math..

[3]  Ugo Dal Lago,et al.  On coinductive equivalences for higher-order probabilistic functional programs , 2013, POPL.

[4]  Ugo Dal Lago,et al.  Metric Reasoning About λ-Terms: The General Case (Long Version) , 2017, ArXiv.

[5]  A. Kock Strong functors and monoidal monads , 1972 .

[6]  C. Villani Optimal Transport: Old and New , 2008 .

[7]  Doina Precup,et al.  Metrics for Markov Decision Processes with Infinite State Spaces , 2005, UAI.

[8]  Marcello M. Bonsangue,et al.  Generalized Metric Spaces: Completion, Topology, and Powerdomains via the Yoneda Embedding , 1995, Theor. Comput. Sci..

[9]  Dirk Hofmann,et al.  Topological theories and closed objects , 2007 .

[10]  Bart Jacobs,et al.  Simulations in Coalgebra , 2003, CMCS.

[11]  Christel Baier,et al.  Denotational Semantics in the CPO and Metric Approach , 1994, Theor. Comput. Sci..

[12]  Ugo Dal Lago,et al.  Metric reasoning about λ-terms: The affine case , 2015, 2015 30th Annual ACM/IEEE Symposium on Logic in Computer Science.

[13]  Maurice Nivat,et al.  Metric Interpretations of Infinite Trees and Semantics of non Deterministic Recursive Programs , 1980, Theor. Comput. Sci..

[14]  James Worrell,et al.  A behavioural pseudometric for probabilistic transition systems , 2005, Theor. Comput. Sci..

[15]  Dirk Hofmann,et al.  A cottage industry of lax extensions , 2015, 1507.08172.

[16]  Alex K. Simpson,et al.  Behavioural Equivalence via Modalities for Algebraic Effects , 2018, ESOP.

[17]  Paul Blain Levy,et al.  Similarity Quotients as Final Coalgebras , 2011, FoSSaCS.

[18]  Dominic R. Verity,et al.  ∞-Categories for the Working Mathematician , 2018 .

[19]  Andrew Pitts,et al.  Advanced Topics in Bisimulation and Coinduction: Howe's method for higher-order languages , 2011 .

[20]  Ernest G. Manes,et al.  Taut Monads and T0-spaces , 2002, Theor. Comput. Sci..

[21]  Benjamin C. Pierce,et al.  Distance makes the types grow stronger: a calculus for differential privacy , 2010, ICFP '10.

[22]  Paolo Baldan,et al.  Towards Trace Metrics via Functor Lifting , 2015, CALCO.

[23]  Stefan Friedrich,et al.  Topology , 2019, Arch. Formal Proofs.

[24]  Lynn Arthur Steen,et al.  Counterexamples in Topology , 1970 .

[25]  Andrew Pitts,et al.  Semantics and Logics of Computation: Operationally-Based Theories of Program Equivalence , 1997 .

[26]  Christoph Schubert,et al.  Extensions in the theory of lax algebras , 2010 .

[27]  Doina Precup,et al.  Metrics for Finite Markov Decision Processes , 2004, AAAI.

[28]  Catuscia Palamidessi,et al.  Generalized Bisimulation Metrics , 2014, CONCUR.

[29]  Karl Crary,et al.  Syntactic Logical Relations for Polymorphic and Recursive Types , 2007, Computation, Meaning, and Logic.

[30]  Douglas J. Howe Proving Congruence of Bisimulation in Functional Programming Languages , 1996, Inf. Comput..

[31]  Ugo Dal Lago,et al.  On Probabilistic Applicative Bisimulation and Call-by-Value λ-Calculi , 2014, ESOP.

[32]  M. Escardó,et al.  A metric model of PCF , 1998 .

[33]  Miguel Angel Fiol,et al.  Vertex-symmetric digraphs with small diameter , 1995 .

[34]  Alexander Kurz,et al.  Relation lifting, a survey , 2016, J. Log. Algebraic Methods Program..

[35]  Viggo Stoltenberg-hansen,et al.  In: Handbook of Logic in Computer Science , 1995 .

[36]  Andrew M. Pitts,et al.  Howe's method for higher-order languages , 2012, Advanced Topics in Bisimulation and Coinduction.

[37]  Gordon D. Plotkin,et al.  Adequacy for Algebraic Effects , 2001, FoSSaCS.

[38]  Jan J. M. M. Rutten,et al.  Elements of Generalized Ultrametric Domain Theory , 1996, Theor. Comput. Sci..

[40]  Hayo Thielecke,et al.  Modelling environments in call-by-value programming languages , 2003, Inf. Comput..

[41]  Samson Abramsky,et al.  Domain theory , 1995, LICS 1995.

[42]  Dirk Hofmann,et al.  Monoidal topology : a categorical approach to order, metric, and topology , 2014 .

[43]  Franck van Breugel,et al.  An introduction to metric semantics: operational and denotational models for programming and specification languages , 2001, Theor. Comput. Sci..

[44]  Kim G. Larsen,et al.  Compositional bisimulation metric reasoning with Probabilistic Process Calculi , 2016, Log. Methods Comput. Sci..

[45]  Brian A. Davey,et al.  An Introduction to Lattices and Order , 1989 .

[46]  Martin Odersky,et al.  Call-by-name, call-by-value, call-by-need and the linear lambda calculus , 1995, MFPS.

[47]  Joseph A. Goguen,et al.  Initial Algebra Semantics and Continuous Algebras , 1977, J. ACM.

[48]  Ugo Dal Lago,et al.  Effectful applicative bisimilarity: Monads, relators, and Howe's method , 2017, 2017 32nd Annual ACM/IEEE Symposium on Logic in Computer Science (LICS).

[49]  Davide Sangiorgi,et al.  Environmental Bisimulations for Higher-Order Languages , 2007, 22nd Annual IEEE Symposium on Logic in Computer Science (LICS 2007).

[50]  J. W. de Bakker,et al.  Denotational semantics of concurrency , 1982, STOC '82.

[51]  Samson Abramsky,et al.  Handbook of logic in computer science. , 1992 .

[52]  James H. Morris,et al.  Lambda-calculus models of programming languages. , 1969 .

[53]  Eugenio Moggi,et al.  Computational lambda-calculus and monads , 1989, [1989] Proceedings. Fourth Annual Symposium on Logic in Computer Science.

[54]  S. Abramsky The lazy lambda calculus , 1990 .

[55]  David Sands,et al.  Improvement theory and its applications , 1999 .

[56]  Andrew D. Gordon A Tutorial on Co-induction and Functional Programming , 1994, Functional Programming.

[57]  Glynn Winskel,et al.  Relational Reasoning about Functions and Nondeterminism , 1999 .

[58]  Marco Gaboardi,et al.  A semantic account of metric preservation , 2017, POPL.

[59]  John C. Reynolds,et al.  Types, Abstraction and Parametric Polymorphism , 1983, IFIP Congress.

[60]  Andre Scedrov,et al.  Bounded Linear Logic: A Modular Approach to Polynomial-Time Computability , 1992, Theor. Comput. Sci..

[61]  F. William Lawvere,et al.  Metric spaces, generalized logic, and closed categories , 1973 .

[62]  Paolo Baldan,et al.  Behavioral Metrics via Functor Lifting , 2014, FSTTCS.

[63]  Yuxin Deng,et al.  Behavioural Pseudometrics for Nondeterministic Probabilistic Systems , 2016, SETTA.

[64]  Ugo Dal Lago,et al.  Metric Reasoning About \lambda -Terms: The General Case , 2017, ESOP.

[65]  K. I. Rosenthal Quantales and their applications , 1990 .

[66]  W. Desch,et al.  Wasserstein metric and subordination , 2008 .

[67]  Martin Odersky,et al.  Call-by-name, Call-by-value, Call-by-need and the Linear lambda Calculus , 1999, Theor. Comput. Sci..