skip to main content
research-article
Open Access

Combining Functional and Automata Synthesis to Discover Causal Reactive Programs

Published:11 January 2023Publication History
Skip Abstract Section

Abstract

We present a new algorithm that synthesizes functional reactive programs from observation data. The key novelty is to iterate between a functional synthesis step, which attempts to generate a transition function over observed states, and an automata synthesis step, which adds any additional latent state necessary to fully account for the observations. We develop a functional reactive DSL called Autumn that can express a rich variety of causal dynamics in time-varying, Atari-style grid worlds, and apply our method to synthesize Autumn programs from data. We evaluate our algorithm on a benchmark suite of 30 Autumn programs as well as a third-party corpus of grid-world-style video games. We find that our algorithm synthesizes 27 out of 30 programs in our benchmark suite and 21 out of 27 programs from the third-party corpus, including several programs describing complex latent state transformations, and from input traces containing hundreds of observations. We expect that our approach will provide a template for how to integrate functional and automata synthesis in other induction domains.

Skip Supplemental Material Section

Supplemental Material

References

  1. Dana Angluin. 1987. Learning Regular Sets from Queries and Counterexamples. Inf. Comput., 75, 2 (1987), 87–106. https://doi.org/10.1016/0890-5401(87)90052-6 Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Suguman Bansal, Kedar S. Namjoshi, and Yaniv Sa’ar. 2018. Synthesis of Asynchronous Reactive Programs from Temporal Specifications. In Computer Aided Verification - 30th International Conference, CAV 2018, Held as Part of the Federated Logic Conference, FloC 2018, Oxford, UK, July 14-17, 2018, Proceedings, Part I, Hana Chockler and Georg Weissenbacher (Eds.) (Lecture Notes in Computer Science, Vol. 10981). Springer, 367–385. https://doi.org/10.1007/978-3-319-96145-3_20 Google ScholarGoogle ScholarCross RefCross Ref
  3. Tewodros A. Beyene, Swarat Chaudhuri, Corneliu Popeea, and Andrey Rybalchenko. 2014. A constraint-based approach to solving games on infinite graphs. In The 41st Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL ’14, San Diego, CA, USA, January 20-21, 2014, Suresh Jagannathan and Peter Sewell (Eds.). ACM, 221–234. https://doi.org/10.1145/2535838.2535860 Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Roderick Bloem, Barbara Jobstmann, Nir Piterman, Amir Pnueli, and Yaniv Sa’ar. 2012. Synthesis of Reactive(1) designs. J. Comput. Syst. Sci., 78, 3 (2012), 911–938. https://doi.org/10.1016/j.jcss.2011.08.007 Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Chia Yuan Cho, Domagoj Babic, Eui Chul Richard Shin, and Dawn Song. 2010. Inference and analysis of formal models of botnet command and control protocols. In Proceedings of the 17th ACM Conference on Computer and Communications Security, CCS 2010, Chicago, Illinois, USA, October 4-8, 2010, Ehab Al-Shaer, Angelos D. Keromytis, and Vitaly Shmatikov (Eds.). ACM, 426–439. https://doi.org/10.1145/1866307.1866355 Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Wonhyuk Choi, Bernd Finkbeiner, Ruzica Piskac, and Mark Santolucito. 2022. Can reactive synthesis and syntax-guided synthesis be friends? In PLDI ’22: 43rd ACM SIGPLAN International Conference on Programming Language Design and Implementation, San Diego, CA, USA, June 13 - 17, 2022, Ranjit Jhala and Isil Dillig (Eds.). ACM, 229–243. https://doi.org/10.1145/3519939.3523429 Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. François Chollet. 2019. On the Measure of Intelligence. https://doi.org/10.48550/ARXIV.1911.01547 Google ScholarGoogle Scholar
  8. François Chollet. 2019. On the Measure of Intelligence. CoRR, abs/1911.01547 (2019), arXiv:1911.01547. arxiv:1911.01547 Google ScholarGoogle Scholar
  9. David Combe, Colin de la Higuera, and Jean-Christophe Janodet. 2010. Zulu: An Interactive Learning Competition. In Finite-State Methods and Natural Language Processing, Anssi Yli-Jyrä, András Kornai, Jacques Sakarovitch, and Bruce Watson (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg. 139–146. isbn:978-3-642-14684-8 Google ScholarGoogle Scholar
  10. Evan Czaplicki and Stephen Chong. 2013. Asynchronous functional reactive programming for GUIs. In ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI ’13, Seattle, WA, USA, June 16-19, 2013, Hans-Juergen Boehm and Cormac Flanagan (Eds.). ACM, 411–422. https://doi.org/10.1145/2491956.2462161 Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Samuel Drews and Loris D’Antoni. 2017. Learning Symbolic Automata. In Tools and Algorithms for the Construction and Analysis of Systems - 23rd International Conference, TACAS 2017, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2017, Uppsala, Sweden, April 22-29, 2017, Proceedings, Part I, Axel Legay and Tiziana Margaria (Eds.) (Lecture Notes in Computer Science, Vol. 10205). 173–189. https://doi.org/10.1007/978-3-662-54577-5_10 Google ScholarGoogle ScholarCross RefCross Ref
  12. Tao Du, Jeevana Priya Inala, Yewen Pu, Andrew Spielberg, Adriana Schulz, Daniela Rus, Armando Solar-Lezama, and Wojciech Matusik. 2018. InverseCSG: automatic conversion of 3D models to CSG trees. ACM Trans. Graph., 37, 6 (2018), 213. https://doi.org/10.1145/3272127.3275006 Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Kevin Ellis, Adam Albright, Armando Solar-Lezama, Joshua B. Tenenbaum, and Timothy J. O’Donnell. 2022. Synthesizing theories of human language with Bayesian program induction.. Nature Communications, 13, 5024 (2022), https://doi.org/10.1038/s41467-022-32012-w Google ScholarGoogle ScholarCross RefCross Ref
  14. Kevin Ellis, Armando Solar-Lezama, and Joshua B. Tenenbaum. 2015. Unsupervised Learning by Program Synthesis. In Advances in Neural Information Processing Systems 28: Annual Conference on Neural Information Processing Systems 2015, December 7-12, 2015, Montreal, Quebec, Canada, Corinna Cortes, Neil D. Lawrence, Daniel D. Lee, Masashi Sugiyama, and Roman Garnett (Eds.). 973–981. https://proceedings.neurips.cc/paper/2015/hash/b73dfe25b4b8714c029b37a6ad3006fa-Abstract.html Google ScholarGoogle Scholar
  15. Kevin Ellis, Catherine Wong, Maxwell Nye, Mathias Sablé-Meyer, Lucas Morales, Luke Hewitt, Luc Cary, Armando Solar-Lezama, and Joshua B Tenenbaum. 2021. Dreamcoder: Bootstrapping inductive program synthesis with wake-sleep library learning. In Proceedings of the 42nd acm sigplan international conference on programming language design and implementation. 835–850. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Richard Evans, José Hernández-Orallo, Johannes Welbl, Pushmeet Kohli, and Marek J. Sergot. 2020. Evaluating the Apperception Engine. ArXiv, abs/2007.05367 (2020). Google ScholarGoogle Scholar
  17. Richard Evans, José Hernández-Orallo, Johannes Welbl, Pushmeet Kohli, and Marek Sergot. 2021. Making sense of sensory input. Artificial Intelligence, 293 (2021), 103438. issn:0004-3702 https://doi.org/10.1016/j.artint.2020.103438 Google ScholarGoogle ScholarCross RefCross Ref
  18. Bernd Finkbeiner, Felix Klein, Ruzica Piskac, and Mark Santolucito. 2019. Synthesizing functional reactive programs. In Proceedings of the 12th ACM SIGPLAN International Symposium on Haskell, [email protected] 2019, Berlin, Germany, August 18-23, 2019, Richard A. Eisenberg (Ed.). ACM, 162–175. https://doi.org/10.1145/3331545.3342601 Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Alison Gopnik and Henry M Wellman. 2012. Reconstructing constructivism: causal models, Bayesian learning mechanisms, and the theory theory.. Psychological bulletin, 138, 6 (2012), 1085. Google ScholarGoogle Scholar
  20. Matthew Guzdial, Boyang Li, and Mark O Riedl. 2017. Game Engine Learning from Video.. In IJCAI. 3707–3713. Google ScholarGoogle Scholar
  21. Ali Sinan Köksal, Yewen Pu, Saurabh Srivastava, Rastislav Bodík, Jasmin Fisher, and Nir Piterman. 2013. Synthesis of biological models from mutation experiments. In The 40th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL ’13, Rome, Italy - January 23 - 25, 2013, Roberto Giacobazzi and Radhia Cousot (Eds.). ACM, 469–482. https://doi.org/10.1145/2429069.2429125 Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. John Levine, Clare Bates Congdon, Marc Ebner, Graham Kendall, Simon M Lucas, Risto Miikkulainen, Tom Schaul, and Tommy Thompson. 2013. General video game playing. Google ScholarGoogle Scholar
  23. Julie L Newcomb and Rastislav Bodik. 2019. Using human-in-the-loop synthesis to author functional reactive programs. https://doi.org/10.48550/ARXIV.1909.11206 Google ScholarGoogle Scholar
  24. Amir Pnueli and Roni Rosner. 1990. Distributed Reactive Systems Are Hard to Synthesize. In 31st Annual Symposium on Foundations of Computer Science, St. Louis, Missouri, USA, October 22-24, 1990, Volume II. IEEE Computer Society, 746–757. https://doi.org/10.1109/FSCS.1990.89597 Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Harald Raffelt and Bernhard Steffen. 2006. LearnLib: A Library for Automata Learning and Experimentation. In Fundamental Approaches to Software Engineering, Luciano Baresi and Reiko Heckel (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg. 377–380. isbn:978-3-540-33094-3 Google ScholarGoogle Scholar
  26. Armando Solar-Lezama. 2013. Program sketching. Int. J. Softw. Tools Technol. Transf., 15, 5-6 (2013), 475–495. https://doi.org/10.1007/s10009-012-0249-7 Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Megan Tjandrasuwita, Jennifer J Sun, Ann Kennedy, Swarat Chaudhuri, and Yisong Yue. 2021. Interpreting expert annotation differences in animal behavior. arXiv preprint arXiv:2106.06114. Google ScholarGoogle Scholar
  28. Pedro A. Tsividis, Joao Loula, Jake Burga, Nathan Foss, Andres Campero, Thomas Pouncy, Samuel J. Gershman, and Joshua B. Tenenbaum. 2021. Human-Level Reinforcement Learning through Theory-Based Modeling, Exploration, and Planning. https://doi.org/10.48550/ARXIV.2107.12544 Google ScholarGoogle Scholar
  29. Tomer D Ullman and Joshua B Tenenbaum. 2020. Bayesian models of conceptual development: Learning as building models of the world. Annual Review of Developmental Psychology. Google ScholarGoogle Scholar
  30. Frits W. Vaandrager. 2017. Model learning. Commun. ACM, 60, 2 (2017), 86–95. https://doi.org/10.1145/2967606 Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Willem Zuidema, Robert M French, Raquel G Alhama, Kevin Ellis, Timothy J O’Donnell, Tim Sainburg, and Timothy Q Gentner. 2020. Five ways in which computational modeling can help advance cognitive science: Lessons from artificial grammar learning. Topics in cognitive science, 12, 3 (2020), 925–941. Google ScholarGoogle Scholar

Index Terms

  1. Combining Functional and Automata Synthesis to Discover Causal Reactive Programs

      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

      • Published in

        cover image Proceedings of the ACM on Programming Languages
        Proceedings of the ACM on Programming Languages  Volume 7, Issue POPL
        January 2023
        2196 pages
        EISSN:2475-1421
        DOI:10.1145/3554308
        • Editor:
        Issue’s Table of Contents

        Copyright © 2023 Owner/Author

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 11 January 2023
        Published in pacmpl Volume 7, Issue POPL

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • research-article
      • Article Metrics

        • Downloads (Last 12 months)425
        • Downloads (Last 6 weeks)123

        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!