Recognition: 2 theorem links
· Lean TheoremA Gradual Probabilistic Lambda Calculus
Pith reviewed 2026-05-10 18:40 UTC · model grok-4.3
The pith
GPLC lets programmers gradually add or remove type and probability annotations in probabilistic code while preserving type safety.
A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.
Core claim
GPLC is a gradual source probabilistic lambda calculus whose static semantics relies on probabilistic couplings to define consistency, precision, and consistent transitivity, while its dynamic semantics is given by elaboration to TPLC; TPLC interprets programs as distributions over final values, and both languages are shown to be type safe, to conservatively extend their fully static variants, and to satisfy the gradual guarantee with respect to type precision.
What carries the argument
Probabilistic couplings that define consistency, precision, and consistent transitivity between gradual types in the static semantics of GPLC.
If this is right
- Any GPLC program can be made fully static or fully dynamic by adjusting annotations and the resulting behavior remains type safe.
- Increasing the precision of any type or probability annotation produces a program whose distribution is related to the original by the gradual guarantee.
- TPLC programs obtained from elaboration are always well-typed and terminate with a proper probability distribution over values.
- The language supports a spectrum of checking styles from fully static to fully dynamic without separate implementations.
Where Pith is reading between the lines
- The coupling technique used for gradual relations might transfer to other calculi that track distributions or expectations.
- A practical implementation could allow developers to start with dynamic probabilistic scripts and incrementally add type information while re-checking safety.
- The gradual guarantee implies that small annotation changes cannot suddenly alter the set of possible runtime errors or the support of the output distribution.
Load-bearing premise
The static relations between gradual types can be defined and shown to be transitive using probabilistic couplings between the distributions they denote.
What would settle it
A concrete GPLC program and a pair of type annotations differing only in precision such that the elaborated TPLC programs produce observably different output distributions.
Figures
read the original abstract
Probabilistic programming languages have recently gained a lot of attention, in particular due to their applications in domains such as machine learning and differential privacy. To establish invariants of interest, many such languages include some form of static checking in the form of type systems. However, adopting such a type discipline can be cumbersome or overly conservative. Gradual typing addresses this problem by supporting a smooth transition between static and dynamic checking, and has been successfully applied for languages with different constructs and type abstractions. Nevertheless, its benefits have never been explored in the context of probabilistic languages. In this work, we present and formalize GPLC, a gradual source probabilistic lambda calculus. GPLC includes a binary probabilistic choice operator and allows programmers to gradually introduce/remove static type -- and probability -- annotations. The static semantics of GPLC heavily relies on the notion of probabilistic couplings, as required for defining several relations, such as consistency, precision, and consistent transitivity. The dynamic semantics of GPLC is given via elaboration to the target language TPLC, which features a distribution-based semantics interpreting programs as probability distributions over final values. Regarding the language metatheory, we establish that TPLC -- and therefore also GPLC -- is type safe and satisfies two of the so-called refined criteria for gradual languages, namely, that it is a conservative extension of a fully static variant and that it satisfies the gradual guarantee, behaving smoothly with respect to type precision.
Editorial analysis
A structured set of objections, weighed in public.
Referee Report
Summary. The manuscript presents GPLC, a gradual source probabilistic lambda calculus featuring a binary probabilistic choice operator and support for gradually introducing or removing static type and probability annotations. Static semantics relies on probabilistic couplings to define relations including consistency, precision, and consistent transitivity. GPLC elaborates to TPLC, whose dynamic semantics interprets programs as probability distributions over values. The metatheory claims type safety for TPLC (hence GPLC via elaboration), that GPLC is a conservative extension of a fully static variant, and that it satisfies the gradual guarantee with respect to type precision.
Significance. If the claims hold, this is a significant contribution as the first formalization of gradual typing for probabilistic languages, an area relevant to machine learning and differential privacy where static checking can be cumbersome. The use of couplings to handle probabilistic relations in the gradual criteria is a technically sound device that enables the conservative extension and gradual guarantee results. The paper provides explicit definitions and stated proofs of type safety, conservative extension, and the gradual guarantee, which strengthens the assessment.
major comments (1)
- §4 (Metatheory, proofs of gradual guarantee): the claim that consistent transitivity holds via couplings needs an explicit statement of the conditions under which the coupling-based relation is transitive for arbitrary probability distributions; without this, the gradual guarantee may not apply to all well-typed programs.
minor comments (3)
- Abstract: the reference to 'refined criteria for gradual languages' should include a citation to the originating work (e.g., Siek et al. or follow-up papers on refined gradual typing criteria).
- Syntax and static semantics sections: the notation distinguishing probability annotations from type annotations in the gradual rules should be made more explicit, perhaps via a dedicated figure or table of examples.
- Related work: add a brief comparison to existing gradual calculi with effects or non-determinism to clarify the novelty of the coupling approach.
Simulated Author's Rebuttal
We thank the referee for their positive evaluation of the manuscript and for the constructive comment on the metatheory section. We address the point below and will incorporate a clarification in the revised version.
read point-by-point responses
-
Referee: §4 (Metatheory, proofs of gradual guarantee): the claim that consistent transitivity holds via couplings needs an explicit statement of the conditions under which the coupling-based relation is transitive for arbitrary probability distributions; without this, the gradual guarantee may not apply to all well-typed programs.
Authors: We appreciate the referee's suggestion for strengthening the presentation. The manuscript defines the coupling-based consistency relation (Definition 4.3) and proves consistent transitivity (Lemma 4.8) as a step toward the gradual guarantee (Theorem 4.13). The transitivity proof relies on the existence of suitable couplings that preserve the marginal distributions and the precision ordering on types and probabilities. We agree that stating the precise conditions more explicitly—namely, that the relation is transitive whenever there exist couplings whose supports satisfy the consistency and precision constraints for the underlying distributions—would improve readability and make the scope of the result clearer. In the revised manuscript we will add a short clarifying lemma immediately before Theorem 4.13 that enumerates these conditions. This is a presentational improvement only; the existing proofs already establish the result for all well-typed programs in GPLC. revision: yes
Circularity Check
No significant circularity in derivation chain
full rationale
The paper defines GPLC via elaboration to TPLC and proves type safety, conservative extension, and the gradual guarantee using new relations (consistency, precision, consistent transitivity) built on the external notion of probabilistic couplings. These relations and the subsequent metatheory proofs do not reduce to self-definitions, fitted parameters renamed as predictions, or load-bearing self-citations; the central claims rest on standard gradual-typing criteria and independently verifiable coupling properties rather than circular reductions to the paper's own inputs.
Axiom & Free-Parameter Ledger
axioms (2)
- domain assumption Probabilistic couplings can define consistency, precision, and consistent transitivity relations for gradual typing over probabilistic choice.
- domain assumption Elaboration to a distribution-based target language preserves type safety and gradual properties.
invented entities (2)
-
GPLC
no independent evidence
-
TPLC
no independent evidence
Lean theorems connected to this paper
-
IndisputableMonolith/Cost/FunctionalEquation.leanwashburn_uniqueness_aczel unclear?
unclearRelation between the paper passage and the cited Recognition theorem.
The static semantics of GPLC heavily relies on the notion of probabilistic couplings, as required for defining several relations, such as consistency, precision, and consistent transitivity.
-
IndisputableMonolith/Foundation/RealityFromDistinction.leanreality_from_one_distinction unclear?
unclearRelation between the paper passage and the cited Recognition theorem.
we establish that TPLC -- and therefore also GPLC -- is type safe and satisfies two of the so-called refined criteria for gradual languages
What do these tags mean?
- matches
- The paper's claim is directly supported by a theorem in the formal canon.
- supports
- The theorem supports part of the paper's argument, but the paper may add assumptions or extra steps.
- extends
- The paper goes beyond the formal theorem; the theorem is a base layer rather than the whole result.
- uses
- The paper appears to rely on the theorem as machinery.
- contradicts
- The paper's claim conflicts with a theorem or certificate in the canon.
- unclear
- Pith found a possible connection, but the passage is too broad, indirect, or ambiguous to say the theorem truly supports the claim.
Reference graph
Works this paper leans on
-
[1]
Martin Avanzini, Ugo Dal Lago, and Alexis Ghyselen. 2021. Type-Based Complexity Analysis of Probabilistic Functional Programs. InProceedings of the 34th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS ’19). IEEE Press, Article 41, 13 pages
2021
-
[2]
Arthur Azevedo de Amorim, Matt Fredrikson, and Limin Jia. 2020. Reconciling Noninterference and Gradual Typing. InProceedings of the 2020 Symposium on Logic in Computer Science (LICS 2020)
2020
-
[3]
Felipe Ba˜nados Schwerter, Ronald Garcia, and ´Eric Tanter. 2016. Gradual Type-and-Effect Systems.Journal of Functional Programming26 (Sept. 2016), 19:1–19:69
2016
-
[4]
Gilles Barthe, Benjamin Gr´egoire, and Santiago Zanella-B´eguelin. 2009. Formal Certification of Code-Based Cryptographic Proofs. In36th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL’09). ACM, New York, 90–101
2009
-
[5]
12 Johannes Borgström, Ugo Dal Lago, Andrew D
Johannes Borgstr¨om, Ugo Dal Lago, Andrew D. Gordon, and Marcin Szymczak. 2016. A lambda-calculus foundation for universal probabilistic programming. InProceedings of the 21st ACM SIGPLAN International Conference on Functional Programming, ICFP 2016, Nara, Japan, September 18-22, 2016, Jacques Garrigue, Gabriele Keller, and Eijiro Sumii (Eds.). ACM, 33–46...
-
[6]
Brett Boston, Adrian Sampson, Dan Grossman, and Luis Ceze. 2015. Probability type inference for flexible approximate programming. InProceedings of the 2015 ACM SIGPLAN International Conference on Object- Oriented Programming, Systems, Languages, and Applications, OOPSLA 2015, part of SPLASH 2015, Pittsburgh, PA, USA, October 25-30, 2015, Jonathan Aldrich ...
-
[7]
Michael Carbin, Sasa Misailovic, and Martin C. Rinard. 2016. Verifying quantitative reliability for programs that execute on unreliable hardware.Commun. ACM59, 8 (2016), 83–91. https://doi.org/10.1145/2958738
-
[8]
Giuseppe Castagna and Victor Lanvin. 2017. Gradual Typing with Union and Intersection Types.Proceedings of the ACM on Programming Languages1, ICFP (Sept. 2017), 41:1–41:28
2017
-
[9]
Giuseppe Castagna, Victor Lanvin, Tommaso Petrucciani, and Jeremy G. Siek. 2019. Gradual typing: a new perspective. See[48], 16:1–16:32. A Gradual Probabilistic Lambda Calculus 41
2019
-
[10]
Rajamani, Aditya V
Guillaume Claret, Sriram K. Rajamani, Aditya V. Nori, Andrew D. Gordon, and Johannes Borgstr¨om. 2013. Bayesian Inference using Data Flow Analysis. InProceedings of the 9th Joint Meeting on Foundations of Software Engineering (ESEC/FSE 2013). ACM, 92–102
2013
-
[11]
Vincent Danos and Thomas Ehrhard. 2011. Probabilistic coherence spaces as a model of higher-order probabilistic computation.Information and Computation209, 6 (2011), 966–991. https://doi.org/10.1016/j. ic.2011.02.001
work page doi:10.1016/j 2011
- [12]
-
[13]
Tim Disney and Cormac Flanagan. 2011. Gradual information flow typing. InInternational Workshop on Scripts to Programs
2011
-
[14]
Cynthia Dwork and Aaron Roth. 2014. The Algorithmic Foundations of Differential Privacy.Found. Trends Theor. Comput. Sci.9, 3-4 (2014), 211–407. https://doi.org/10.1561/0400000042
-
[15]
Thomas Ehrhard, Michele Pagani, and Christine Tasson. 2017. Measurable Cones and Stable, Measurable Functions: A Model for Probabilistic Higher-Order Programming.Proc. ACM Program. Lang.2, POPL, Article 59 (dec 2017), 28 pages. https://doi.org/10.1145/3158147
-
[16]
Luminous Fennell and Peter Thiemann. 2013. Gradual Security Typing with References. InProceedings of the 26th Computer Security Foundations Symposium (CSF). 224–239
2013
-
[17]
Ronald Garcia. 2013. Calculating threesomes, with blame. InProceedings of the 18th ACM SIGPLAN International Conference on Functional programming. 417–428
2013
-
[18]
Clark, and ´Eric Tanter
Ronald Garcia, Alison M. Clark, and ´Eric Tanter. 2016. Abstracting Gradual Typing. InProceedings of the 43rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL 2016), Rastislav Bod´ık and Rupak Majumdar (Eds.). ACM Press, St Petersburg, FL, USA, 429–442. See erratum: https://www.cs.ubc.ca/ rxg/agt-erratum.pdf
2016
-
[19]
Zoubin Ghahramani. 2015. Probabilistic Machine Learning and Artificial Intelligence.Nature521, 7553 (2015), 452–459
2015
-
[20]
Shafi Goldwasser and Silvio Micali. 1984. Probabilistic Encryption.J. Comput. Sys. Sci.28, 2 (1984), 270–299
1984
-
[21]
Goodman, Vikash K
Noah D. Goodman, Vikash K. Mansinghka, Daniel Roy, Keith Bonawitz, and Joshua B. Tenenbaum. 2008. Church: A Language for Generative Models. InProceedings of the Twenty-Fourth Conference on Uncertainty in Artificial Intelligence (UAI’08). AUAI Press, 220–229
2008
-
[22]
Noah D Goodman and Andreas Stuhlm¨ uller. 2014. The Design and Implementation of Probabilistic Programming Languages. http://dippl.org. Accessed: 2022-10-17
2014
-
[23]
Gordon, Thomas A
Andrew D. Gordon, Thomas A. Henzinger, Aditya V. Nori, and Sriram K. Rajamani. 2014. Probabilistic programming. InProceedings of the on Future of Software Engineering, FOSE 2014. ACM, 167–181
2014
-
[24]
Momoko Hattori, Naoki Kobayashi, and Ryosuke Sato. 2023. Gradual Tensor Shape Checking. InProgramming Languages and Systems: 32nd European Symposium on Programming, ESOP 2023, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2023, Paris, France, April 22–27, 2023, Proceedings. Springer-Verlag, Berlin, Heidelberg, 19...
-
[25]
Willem Heijltjes and Georgina Majury. 2025. Simple Types for Probabilistic Termination. In33rd EACSL Annual Conference on Computer Science Logic, CSL 2025, February 10-14, 2025, Amsterdam, Netherlands (LIPIcs), J ¨org Endrullis and Sylvain Schmitz (Eds.), Vol. 326. Schloss Dagstuhl - Leibniz-Zentrum f¨ ur Informatik, 31:1–31:21. https://doi.org/10.4230/LI...
-
[26]
David Herman, Aaron Tomb, and Cormac Flanagan. 2007. Space-efficient gradual typing. InIn Trends in Functional Programming (TFP
2007
-
[27]
David Herman, Aaron Tomb, and Cormac Flanagan. 2010. Space-efficient gradual typing.Higher-Order and Sympolic Computation23, 2 (June 2010), 167–189
2010
-
[28]
Chris Heunen, Ohad Kammar, Sam Staton, and Hongseok Yang. 2017. A convenient category for higher-order probability theory. In32nd Annual ACM/IEEE Symposium on Logic in Computer Science, LICS 2017, Reykjavik, Iceland, June 20-23, 2017. IEEE Computer Society, 1–12. https://doi.org/10.1109/LICS.2017.8005137
-
[29]
Xuejing Huang and Bruno C. d. S. Oliveira. 2020. A Type-Directed Operational Semantics For a Calculus with a Merge Operator. InECOOP
2020
-
[30]
Jafery and Jana Dunfield
Khurram A. Jafery and Jana Dunfield. 2017. Sums of Uncertainty: Refinements Go Gradual, See [ 47], 804–817. 42 Wenjia Ye, Mat ´ıas Toro, and Federico Olmedo
2017
-
[31]
Jones and Gordon D
C. Jones and Gordon D. Plotkin. 1989. A probabilistic powerdomain of evaluations.[1989] Proceedings. Fourth Annual Symposium on Logic in Computer Science(1989), 186–195
1989
-
[32]
Oleg Kiselyov. 2016. Probabilistic Programming Language and its Incremental Evaluation. InProgramming Languages and Systems - 14th Asian Symposium, APLAS 2016, Hanoi, Vietnam, November 21-23, 2016, Proceedings (Lecture Notes in Computer Science), Atsushi Igarashi (Ed.), Vol. 10017. 357–376. https: //doi.org/10.1007/978-3-319-47958-3 19
-
[33]
Ugo Dal Lago and Charles Grellois. 2017. Probabilistic Termination by Monadic Affine Sized Typing.ACM Transactions on Programming Languages and Systems (TOPLAS)41 (2017), 1 – 65
2017
-
[34]
Ugo Dal Lago and Margherita Zorzi. 2012. Probabilistic operational semantics for the lambda calculus.RAIRO Theor. Informatics Appl.46, 3 (2012), 413–450. https://doi.org/10.1051/ita/2012012
- [35]
-
[36]
Tuan Anh Le, Atilim Gunes Baydin, and Frank D. Wood. 2017. Inference Compilation and Universal Probabilistic Programming. InProceedings of the 20th International Conference on Artificial Intelligence and Statistics, AISTATS 2017, 20-22 April 2017, Fort Lauderdale, FL, USA (Proceedings of Machine Learning Research), Aarti Singh and Xiaojin (Jerry) Zhu (Eds...
2017
-
[37]
Nico Lehmann and ´Eric Tanter. 2017. Gradual Refinement Types, See [47], 775–788
2017
-
[38]
Meven Lennon-Bertrand, Kenji Maillard, Nicolas Tabareau, and ´Eric Tanter. 2022. Gradualizing the Calculus of Inductive Constructions.ACM Transactions on Programming Languages and Systems(2022). To appear. To be presented at POPL ’22
2022
-
[39]
Luke Ong, Hugo Paquet, and Dominik Wagner
Carol Mak, C.-H. Luke Ong, Hugo Paquet, and Dominik Wagner. 2021. Densities of Almost Surely Terminating Probabilistic Programs are Differentiable Almost Everywhere. InProgramming Languages and Systems - 30th European Symposium on Programming, ESOP 2021, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2021, Luxembo...
-
[40]
Stefan Malewski, Michael Greenberg, and ´Eric Tanter. 2021. Gradually Structured Data.Proceedings of the ACM on Programming Languages5, OOPSLA (Nov. 2021), 126:1–126:28
2021
-
[41]
Zeina Migeed, James Reed, Jason Ansel, and Jens Palsberg. 2024. Generalizing Shape Analysis with Gradual Types. In38th European Conference on Object-Oriented Programming (ECOOP 2024) (Leibniz International Proceedings in Informatics (LIPIcs)), Jonathan Aldrich and Guido Salvaneschi (Eds.), Vol. 313. Schloss Dagstuhl – Leibniz-Zentrum f¨ ur Informatik, Dag...
-
[42]
Sparsh Mittal. 2016. A Survey of Techniques for Approximate Computing.ACM Comput. Surv.48, 4 (2016), 62:1–62:33. https://doi.org/10.1145/2893356
-
[43]
1995.Randomized Algorithms
Rajeev Motwani and Prabhakar Raghavan. 1995.Randomized Algorithms. Cambridge University Press
1995
-
[44]
New, Daniel R
Max S. New, Daniel R. Licata, and Amal Ahmed. 2019. Gradual Type Theory. See[48], 15:1–15:31
2019
-
[45]
Avi Pfeffer. 2010. Practical Probabilistic Programming. InInductive Logic Programming - 20th International Conference, ILP 2010, Florence, Italy, June 27-30, 2010. Revised Papers (Lecture Notes in Computer Science), Paolo Frasconi and Francesca A. Lisi (Eds.), Vol. 6489. Springer, 2–3
2010
-
[46]
Luna Phipps-Costin, Carolyn Jane Anderson, Michael Greenberg, and Arjun Guha. 2021. Solver-based gradual type migration.Proc. ACM Program. Lang.5, OOPSLA (2021), 1–27. https://doi.org/10.1145/3485488
-
[47]
ACM Press, Paris, France
POPL 2017 2017.Proceedings of the 44th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL 2017). ACM Press, Paris, France
2017
-
[48]
Norman Ramsey and Avi Pfeffer. 2002. Stochastic lambda calculus and monads of probability distributions. In POPL ’02
2002
-
[49]
Jason Reed and Benjamin C. Pierce. 2010. Distance Makes the Types Grow Stronger: A Calculus for Differential Privacy. InProceedings of the 15th ACM SIGPLAN International Conference on Functional Programming (ICFP’10). ACM, 157–168
2010
-
[50]
Amr Sabry and Matthias Felleisen. 1993. Reasoning about Programs in Continuation-Passing Style. InLISP AND SYMBOLIC COMPUTATION. 288–298
1993
-
[51]
Nasser Saheb-Djahromi. 1978. Probabilistic LCF. InMFCS. A Gradual Probabilistic Lambda Calculus 43
1978
-
[52]
Moss, Chris Heunen, and Zoubin Ghahramani
Adam ´Scibior, Ohad Kammar, Matthijs V´ak´ar, Sam Staton, Hongseok Yang, Yufei Cai, Klaus Ostermann, Sean K. Moss, Chris Heunen, and Zoubin Ghahramani. 2018. Denotational validation of higher-order Bayesian inference.Proc. ACM Program. Lang.2, POPL (2018), 60:1–60:29. https://doi.org/10.1145/3158148
-
[53]
Roberto Segala and Nancy A. Lynch. 1995. Probabilistic Simulations for Probabilistic Processes.Nord. J. Comput.2, 2 (1995), 250–273
1995
-
[54]
Jeremy Siek and Walid Taha. 2006. Gradual Typing for Functional Languages. InProceedings of the Scheme and Functional Programming Workshop. 81–92
2006
-
[55]
Jeremy Siek, Peter Thiemann, and Phil Wadler. 2015. Blame and Coercion: Together Again for the First Time. InProceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2015). ACM Press, Portland, OR, USA, 425–435
2015
-
[56]
Jeremy Siek and Philip Wadler. 2010. Threesomes, with and without blame. InProceedings of the 37th annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL 2010). ACM Press, Madrid, Spain, 365–376
2010
-
[57]
Siek, Ronald Garcia, and Walid Taha
Jeremy G. Siek, Ronald Garcia, and Walid Taha. 2009. Exploring the Design Space of Higher-Order Casts. In ESOP
2009
-
[58]
Siek, Michael M
Jeremy G. Siek, Michael M. Vitousek, Matteo Cimini, and John Tang Boyland. 2015. Refined Criteria for Gradual Typing. In1st Summit on Advances in Programming Languages (SNAPL 2015) (Leibniz International Proceedings in Informatics (LIPIcs)), Vol. 32. Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik, Asilomar, California, USA, 274–293
2015
-
[59]
Siek, Michael M
Jeremy G. Siek, Michael M. Vitousek, Matteo Cimini, Sam Tobin-Hochstadt, and Ronald Garcia. 2015. Monotonic References for Efficient Gradual Typing. InESOP
2015
-
[60]
Stephen Strickland, Christos Dimoulas, Sam Tobin-Hochstadt, and Matthias Felleisen
Asumu Takikawa, T. Stephen Strickland, Christos Dimoulas, Sam Tobin-Hochstadt, and Matthias Felleisen
-
[61]
InProceedings of the 27th ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA 2012)
Gradual Typing for First-Class Classes. InProceedings of the 27th ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA 2012). ACM Press, Tucson, AZ, USA, 793–810
2012
-
[62]
Mat´ıas Toro, Ronald Garcia, and´Eric Tanter. 2018. Type-Driven Gradual Security with References.ACM Transactions on Programming Languages and Systems40, 4 (Nov. 2018), 16:1–16:55
2018
-
[63]
Mat´ıas Toro and´Eric Tanter. 2017. A Gradual Interpretation of Union Types. InProceedings of the 24th Static Analysis Symposium (SAS 2017) (Lecture Notes in Computer Science), Vol. 10422. Springer-Verlag, New York City, NY, USA, 382–404
2017
-
[64]
Mat´ıas Toro and´Eric Tanter. 2020. Abstracting Gradual References.Science of Computer Programming197 (Oct. 2020), 1–65
2020
-
[65]
Hoffman, Rif A
Dustin Tran, Matthew D. Hoffman, Rif A. Saurous, Eugene Brevdo, Kevin Murphy, and David M. Blei
-
[66]
In5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings
Deep Probabilistic Programming. In5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings. OpenReview.net. https: //openreview.net/forum?id=Hy6b4Pqee
2017
- [67]
-
[68]
Philip Wadler and Robert Bruce Findler. 2009. Well-Typed Programs Can’t Be Blamed. InProceedings of the 18th European Symposium on Programming Languages and Systems (ESOP 2009) (Lecture Notes in Computer Science), Giuseppe Castagna (Ed.), Vol. 5502. Springer-Verlag, York, UK, 1–16
2009
-
[69]
Wenjia Ye, Bruno C. d. S. Oliveira, and Xuejing Huang. 2021. Type-Directed Operational Semantics for Gradual Typing. InECOOP
2021
-
[70]
Wenjia Ye, Bruno C. d. S. Oliveira, and Mat´ıas Toro. 2024. Merging Gradual Typing.Proc. ACM Program. Lang.8, OOPSLA2, Article 294 (Oct. 2024), 29 pages. https://doi.org/10.1145/3689734 44 Wenjia Ye, Mat ´ıas Toro, and Federico Olmedo 𝑟∈R, 𝑏∈B, 𝑥∈Var, 𝑝∈ [0,1], 𝜏∈Type, 𝑇∈DType 𝜏::=Real|Bool|𝜏→𝑇(simple types) 𝑇::={ {𝜏 𝑝𝑖 𝑖 |𝑖∈I} }(distribution types) 𝑚 , 𝑛...
-
[71]
∈VJ𝜏K.(𝑣 1 𝑣 ′ 1, 𝑣2 𝑣 ′
-
[72]
∈TJ𝑇K} VJ𝑇K={(V,V) |V={ {𝑣 𝑝𝑖 𝑖 |𝑖∈I} },V={ {𝑣 𝑝 𝑗 𝑗 |𝑗∈J} },∃𝜉={ {𝜏 𝜔𝑘 𝑘 |𝑘∈K} }, (𝜉 ,V,V) ∈Atom[𝑇],∀𝜔 𝑘 >0, 𝑖=𝜔 𝑘 .l, 𝑗=𝜔 𝑘 .r.(𝑣 𝑖, 𝑣 𝑗 ) ∈VJ𝜏 𝑘K}) TJ𝑇K={(𝑚 1, 𝑚2) |𝑚 1 ⇓∗ 𝑠 V1 ∧𝑚 2 ⇓∗ V2,(V 1,V 2) ∈VJ𝑇K} GJ·K={∅} GJΓ, 𝑥:𝜏K={𝛾[(𝑣, 𝑣 ′)/𝑥] |𝛾∈GJΓK∧ (𝑣, 𝑣 ′) ∈VJ𝜏K} Atom[𝜏]={(𝑣, 𝑣 ′) | ⊢ 𝑠 𝑣:𝜏∧ ⊢𝑣 ′ :𝜏} Atom[𝑇]={(𝜉 ,V,V) | ⊢ 𝑠 V:𝑇 1 ∧ ⊢V:𝑇 2 ∧𝜉⊢𝑇 1 r =𝑇 2...
-
[73]
:: 𝑝·𝑇 1 + (1 −𝑝) ·𝑇 2) ∈TJ𝑝·𝑇 1 + (1 −𝑝) ·𝑇 2K ∵Γ⊢m 1 ≈𝑚 ′ 1 :𝑇 1 ∴𝛾 1 (m1) ⇓ ∗ V1 ∴𝛾 2 (𝑚 ′
-
[74]
⇓ ∗ V2 ∴(V 1,V 2) ∈𝑇 1 ∵Γ⊢m 2 ≈𝑚 ′ 2 :𝑇 2 ∴𝛾 1 (m2) ⇓ ∗ V ′1 ∴𝛾 2 (𝑚 ′
-
[75]
IfΓ, 𝑥 : 𝜏⊢m≈𝑚 ′ : 𝑇 , 𝜀⊢𝜏→𝑇∼𝜏→ 𝑇thenΓ⊢𝜆𝑥:𝜏 .m≈𝜀𝜆𝑥:𝜏 .𝑚 ′ ::𝜏→𝑇:𝑇
⇓ ∗ V ′ 2 ∴(V ′3,V ′ 4 ) ∈𝑇 2 By Lemma 21 ∴(𝑝·V 1 + (1 −𝑝) ·V ′3, 𝑝·V 2 + (1 −𝑝) ·V ′ 4 :: 𝑝·𝑇 1 + (1 −𝑝) ·𝑇 2) ∈VJ𝑝·𝑇 1 + (1 −𝑝) ·𝑇 2K The result holds.□ Lemma 27 (Compatibility (lambda)). IfΓ, 𝑥 : 𝜏⊢m≈𝑚 ′ : 𝑇 , 𝜀⊢𝜏→𝑇∼𝜏→ 𝑇thenΓ⊢𝜆𝑥:𝜏 .m≈𝜀𝜆𝑥:𝜏 .𝑚 ′ ::𝜏→𝑇:𝑇 . Proof. (for evidence compositions, Lemma 20 is used). we need to show, (𝜆𝑥:𝜏 .𝛾 1 (m), 𝜀𝜆𝑥:𝜏 .𝛾 2 (...
-
[76]
∈VJ𝜏K,(𝜆𝑥:𝜏 .𝛾 1 (m)v 2, 𝜀𝜆𝑥:𝜏 .𝛾 2 (𝑚 ′)::𝜏→𝑇 𝑣 ′
-
[77]
IfΓ⊢v≈𝑣 ′ : Bool,Γ⊢m 1 ≈𝑚 ′ 1 : 𝑇 ,Γ⊢m 2 ≈𝑚 ′ 2 : 𝑇 , 𝜀⊢Bool∼BoolthenΓ⊢if v then m 1 else m2 ≈let𝑥=𝜀𝑣 ′ :: Bool in if𝑥then m 1 else m2 : 𝑇
∈TJ𝑇K ∵𝜆𝑥:𝜏 .𝛾 1 (m)v 2 ⇓∗ 𝛾1(m) [v2/𝑥] ∵𝜀𝜆𝑥:𝜏 .𝛾 2(𝑚 ′)::𝜏→𝑇 𝑣 ′ 2 ⇓∗ cod(𝜀)𝛾 2 (𝑚 ′) [dom(𝜀0 ◦𝜀)𝑢 2 ::𝜏/𝑥]::𝑇 By Lemma 21 ∴(v 2,dom(𝜀 0 ◦𝜀)𝑢 2 ::𝜏) ∈VJ𝜏K ∵Γ, 𝑥:𝜏⊢m≈𝑚 ′ :𝑇 ∴(𝛾 1 [𝑥/v2] (m), 𝛾2 [𝑥/dom(𝜀 0 ◦𝜀)𝑢 2 ::𝜏] (m)) ∈TJ𝑇K =(𝛾 1 (m) [𝑥/v2], 𝛾2(m) [𝑥/dom(𝜀 0 ◦𝜀)𝑢 2 ::𝜏]) ∈TJ𝑇K ∴𝛾 1 (m) [v2/𝑥] ⇓ ∗ V1 ∴cod(𝜀)𝛾 2 (𝑚 ′) [dom(𝜀0 ◦𝜀)𝑢 2 ::𝜏/𝑥]::𝑇⇓ ∗ cod(𝜀)V...
-
[78]
⇓ ∗ V2 ∴(V 1,V 2) ∈𝑇 ∵Γ⊢m 2 ≈𝑚 ′ 2 :𝑇 ∴𝛾 1 (m2) ⇓ ∗ V3 ∴𝛾 2 (𝑚 ′
-
[79]
If∃𝜔(𝑙, 𝑘)
⇓ ∗ V4 ∴(V ′3,V ′ 4 ) ∈𝑇 ifb=𝑏=true, ∴(if b then𝛾 1 (m1)else𝛾 1 (m2) ⇓V 1 ∴let𝑥=𝜀 0𝑏::Bool in if𝑥then𝛾 2 (𝑚1)else𝛾 2 (𝑚2) ⇓V 2 ifb=𝑏=false, ∴(if b then𝛾 1 (m1)else𝛾 1 (𝑚2)) ⇓V 3 ∴let𝑥=𝜀 0𝑏::Bool in if𝑥then𝛾 2 (𝑚1)else𝛾 2 (m2) ⇓V 4 The result holds.□ Lemma 29 (Logical composition). If∃𝜔(𝑙, 𝑘). Í 𝑙 𝜔(𝑙, 𝑘)=𝑝 𝑘 ∧Í 𝑘 𝜔(𝑙, 𝑘)=𝑝 𝑙 ∧𝜔(𝑙, 𝑘)> 0 ⇒ (V 𝑙,V 𝑘) ∈VJ𝑇 𝑖...
-
[80]
:: Í 𝑖∈I 𝑝𝑖·𝑇𝑖)) ∈TJ Í 𝑖∈I 𝑝𝑖· 𝑇𝑖K ∵Γ⊢m 1 ≈𝑚 ′ 1 :𝑇 1 ∴𝛾 1 (m1) ⇓ ∗ V1 ∴𝛾 2 (𝑚 ′
discussion (0)
Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.