skip to main content
research-article
Open Access

Monadic and comonadic aspects of dependency analysis

Published:31 October 2022Publication History
Skip Abstract Section

Abstract

Dependency analysis is vital to several applications in computer science. It lies at the essence of secure information flow analysis, binding-time analysis, etc. Various calculi have been proposed in the literature for analysing individual dependencies. Abadi et. al., by extending Moggi’s monadic metalanguage, unified several of these calculi into the Dependency Core Calculus (DCC). DCC has served as a foundational framework for dependency analysis for the last two decades. However, in spite of its success, DCC has its limitations. First, the monadic bind rule of the calculus is nonstandard and relies upon an auxiliary protection judgement. Second, being of a monadic nature, the calculus cannot capture dependency analyses that possess a comonadic nature, for example, the binding-time calculus, λ, of Davies. In this paper, we address these limitations by designing an alternative dependency calculus that is inspired by standard ideas from category theory. Our calculus is both monadic and comonadic in nature and subsumes both DCC and λ. Our construction explains the nonstandard bind rule and the protection judgement of DCC in terms of standard categorical concepts. It also leads to a novel technique for proving correctness of dependency analysis. We use this technique to present alternative proofs of correctness for DCC and λ.

References

  1. Martín Abadi, Anindya Banerjee, Nevin Heintze, and Jon G. Riecke. 1999. A Core Calculus of Dependency. In Proceedings of the 26th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’99). Association for Computing Machinery, New York, NY, USA. 147–160. isbn:1581130953 https://doi.org/10.1145/292540.292555 Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Maximilian Algehed. 2018. A Perspective on the Dependency Core Calculus. In Proceedings of the 13th Workshop on Programming Languages and Analysis for Security (PLAS ’18). Association for Computing Machinery, New York, NY, USA. 24–28. isbn:9781450359931 https://doi.org/10.1145/3264820.3264823 Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Maximilian Algehed and Jean-Philippe Bernardy. 2019. Simple Noninterference from Parametricity. Proc. ACM Program. Lang., 3, ICFP (2019), Article 89, July, 22 pages. https://doi.org/10.1145/3341693 Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. William J. Bowman and Amal Ahmed. 2015. Noninterference for Free. SIGPLAN Not., 50, 9 (2015), Aug., 101–113. issn:0362-1340 https://doi.org/10.1145/2858949.2784733 Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Stephen Brookes and Shai Geva. 1991. Computational Comonads and Intensional Semantics. Cambridge Univ. Press, 1–44. Google ScholarGoogle Scholar
  6. Aloïs Brunel, Marco Gaboardi, Damiano Mazza, and Steve Zdancewic. 2014. A Core Quantitative Coeffect Calculus. In Proceedings of the 23rd European Symposium on Programming Languages and Systems - Volume 8410. Springer-Verlag, Berlin, Heidelberg. 351–370. isbn:9783642548321 https://doi.org/10.1007/978-3-642-54833-8_19 Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Cristiano Calcagno, Walid Taha, Liwen Huang, and Xavier Leroy. 2003. Implementing Multi-stage Languages Using ASTs, Gensym, and Reflection. In Generative Programming and Component Engineering, Frank Pfenning and Yannis Smaragdakis (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg. 57–76. isbn:978-3-540-39815-8 Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Pritam Choudhury. 2022. Monadic and Comonadic Aspects of Dependency Analysis. https://doi.org/10.48550/ARXIV.2209.06334 Google ScholarGoogle Scholar
  9. Pritam Choudhury, Harley Eades, and Stephanie Weirich. 2022. A Dependent Dependency Calculus. In Programming Languages and Systems, Ilya Sergey (Ed.). Springer International Publishing, Cham. 403–430. isbn:978-3-030-99336-8 Google ScholarGoogle Scholar
  10. Rowan Davies. 2017. A Temporal Logic Approach to Binding-Time Analysis. J. ACM, 64, 1 (2017), Article 1, mar, 45 pages. issn:0004-5411 https://doi.org/10.1145/3011069 Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Dorothy E. Denning. 1976. A Lattice Model of Secure Information Flow. Commun. ACM, 19, 5 (1976), May, 236–243. issn:0001-0782 https://doi.org/10.1145/360051.360056 Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Dorothy E. Denning and Peter J. Denning. 1977. Certification of Programs for Secure Information Flow. Commun. ACM, 20, 7 (1977), July, 504–513. issn:0001-0782 https://doi.org/10.1145/359636.359712 Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Samuel Eilenberg and G. Max Kelly. 1966. Closed Categories. In Proceedings of the Conference on Categorical Algebra, S. Eilenberg, D. K. Harrison, S. MacLane, and H. Röhrl (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg. 421–562. isbn:978-3-642-99902-4 Google ScholarGoogle Scholar
  14. Soichiro Fujii. 2019. A 2-Categorical Study of Graded and Indexed Monads. arxiv:1904.08083. Google ScholarGoogle Scholar
  15. Dan R. Ghica and Alex I. Smith. 2014. Bounded Linear Types in a Resource Semiring. In Programming Languages and Systems, Zhong Shao (Ed.). Springer Berlin Heidelberg, Berlin, Heidelberg. 331–350. isbn:978-3-642-54833-8 Google ScholarGoogle Scholar
  16. David K. Gifford and John M. Lucassen. 1986. Integrating Functional and Imperative Programming. In Proceedings of the 1986 ACM Conference on LISP and Functional Programming (LFP ’86). Association for Computing Machinery, New York, NY, USA. 28–38. isbn:0897912004 https://doi.org/10.1145/319838.319848 Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Robert Glück and Jesper Jørgensen. 1995. Efficient Multi-Level Generating Extensions for Program Specialization. In Proceedings of the 7th International Symposium on Programming Languages: Implementations, Logics and Programs (PLILPS ’95). Springer-Verlag, Berlin, Heidelberg. 259–278. isbn:354060359X Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. J. A. Goguen and J. Meseguer. 1982. Security Policies and Security Models. In 1982 IEEE Symposium on Security and Privacy. 11–11. Google ScholarGoogle Scholar
  19. Carsten K. Gomard and Neil D. Jones. 1991. A partial evaluator for the untyped lambda-calculus. Journal of Functional Programming, 1, 1 (1991), 21–69. https://doi.org/10.1017/S0956796800000058 Google ScholarGoogle ScholarCross RefCross Ref
  20. John Hatcliff and Olivier Danvy. 1997. A computational formalization for partial evaluation. Mathematical Structures in Computer Science, 7, 5 (1997), 507–541. https://doi.org/10.1017/S0960129597002405 Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Nevin Heintze and Jon G. Riecke. 1998. The SLam Calculus: Programming with Secrecy and Integrity. In Proceedings of the 25th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’98). Association for Computing Machinery, New York, NY, USA. 365–377. isbn:0897919793 https://doi.org/10.1145/268946.268976 Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Bart Jacobs. 1999. Categorical Logic and Type Theory. Elsevier, Amsterdam, The Netherlands. Google ScholarGoogle Scholar
  23. Shin-ya Katsumata. 2014. Parametric Effect Monads and Semantics of Effect Systems. SIGPLAN Not., 49, 1 (2014), jan, 633–645. issn:0362-1340 https://doi.org/10.1145/2578855.2535846 Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. G. A. Kavvos. 2019. Modalities, Cohesion, and Information Flow. Proc. ACM Program. Lang., 3, POPL (2019), Article 20, jan, 29 pages. https://doi.org/10.1145/3290333 Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Anders Kock. 1970. Monads on symmetric monoidal closed categories. 21 (1970), 1–10. https://doi.org/10.1007/BF01220868 Google ScholarGoogle ScholarCross RefCross Ref
  26. Anders Kock. 1972. Strong Functors and Monoidal Monads. 23 (1972), 113–120. https://doi.org/10.1007/BF01304852 Google ScholarGoogle ScholarCross RefCross Ref
  27. Saunders MacLane. 1971. Categories for the Working Mathematician. Springer-Verlag, New York. Graduate Texts in Mathematics, Vol. 5. Google ScholarGoogle Scholar
  28. Eugenio Moggi. 1991. Notions of computation and monads. Information and Computation, 93, 1 (1991), 55–92. issn:0890-5401 https://www.sciencedirect.com/science/article/pii/0890540191900524 Selections from 1989 IEEE Symposium on Logic in Computer Science. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Jens Palsberg and Peter Ø rbæ k. 1995. Trust in the Lambda-Calculus. In Proceedings of the Second International Symposium on Static Analysis (SAS ’95). Springer-Verlag, Berlin, Heidelberg. 314–329. isbn:3540603603 Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Tomas Petricek, Dominic Orchard, and Alan Mycroft. 2013. Coeffects: Unified Static Analysis of Context-Dependence. In Automata, Languages, and Programming. Springer Berlin Heidelberg, Berlin, Heidelberg. 385–397. isbn:978-3-642-39212-2 Google ScholarGoogle Scholar
  31. Tomas Petricek, Dominic Orchard, and Alan Mycroft. 2014. Coeffects: A calculus of context-dependent computation. In Proceedings of International Conference on Functional Programming (ICFP 2014). Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Naokata Shikuma and Atsushi Igarashi. 2006. Proving Noninterference by a Fully Complete Translation to the Simply Typed λ -Calculus. In Proceedings of the 11th Asian Computing Science Conference on Advances in Computer Science: Secure Software and Related Issues (ASIAN’06). Springer-Verlag, Berlin, Heidelberg. 301–315. isbn:3540775048 Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Geoffrey Smith. 2007. Principles of Secure Information Flow Analysis. In Malware Detection, Mihai Christodorescu, Somesh Jha, Douglas Maughan, Dawn Song, and Cliff Wang (Eds.). Springer US, Boston, MA. 291–307. isbn:978-0-387-44599-1 Google ScholarGoogle Scholar
  34. Yan Mei Tang and Pierre Jouvelot. 1995. Effect Systems with Subtyping. In In ACM Conference on Partial Evaluation and Program Manipulation. ACM Press, 45–53. Google ScholarGoogle Scholar
  35. Frank Tip. 1995. A Survey of Program Slicing Techniques. Journal of Programming Languages, 3 (1995), 121–189. Google ScholarGoogle Scholar
  36. Mads Tofte and Jean-Pierre Talpin. 1997. Region-Based Memory Management. Inf. Comput., 132, 2 (1997), feb, 109–176. issn:0890-5401 https://doi.org/10.1006/inco.1996.2613 Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Stephen Tse and Steve Zdancewic. 2004. Translating Dependency into Parametricity. In Proceedings of the Ninth ACM SIGPLAN International Conference on Functional Programming (ICFP ’04). Association for Computing Machinery, New York, NY, USA. 115–125. isbn:1581139055 https://doi.org/10.1145/1016850.1016868 Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Tarmo Uustalu and Varmo Vene. 2008. Comonadic Notions of Computation. Electronic Notes in Theoretical Computer Science, 203, 5 (2008), 263–284. issn:1571-0661 https://doi.org/10.1016/j.entcs.2008.05.029 Proceedings of the Ninth Workshop on Coalgebraic Methods in Computer Science (CMCS 2008). Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Dennis Volpano, Cynthia Irvine, and Geoffrey Smith. 1996. A Sound Type System for Secure Flow Analysis. J. Comput. Secur., 4, 2–3 (1996), jan, 167–187. issn:0926-227X Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. Philip Wadler and Peter Thiemann. 2003. The Marriage of Effects and Monads. ACM Trans. Comput. Logic, 4, 1 (2003), jan, 1–32. issn:1529-3785 https://doi.org/10.1145/601775.601776 Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Monadic and comonadic aspects of dependency analysis

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in

        Full Access

        • Article Metrics

          • Downloads (Last 12 months)143
          • Downloads (Last 6 weeks)25

          Other Metrics

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader
        About Cookies On This Site

        We use cookies to ensure that we give you the best experience on our website.

        Learn more

        Got it!