Abstract
Law at large underpins modern society, codifying and governing many aspects of citizens' daily lives. Oftentimes, law is subject to interpretation, debate and challenges throughout various courts and jurisdictions. But in some other areas, law leaves little room for interpretation, and essentially aims to rigorously describe a computation, a decision procedure or, simply said, an algorithm.
Unfortunately, prose remains a woefully inadequate tool for the job. The lack of formalism leaves room for ambiguities; the structure of legal statutes, with many paragraphs and sub-sections spread across multiple pages, makes it hard to compute the intended outcome of the algorithm underlying a given text; and, as with any other piece of poorly-specified critical software, the use of informal, natural language leaves corner cases unaddressed.
We introduce Catala, a new programming language that we specifically designed to allow a straightforward and systematic translation of statutory law into an executable implementation. Notably, Catala makes it natural and easy to express the general case / exceptions logic that permeates statutory law. Catala aims to bring together lawyers and programmers through a shared medium, which together they can understand, edit and evolve, bridging a gap that too often results in dramatically incorrect implementations of the law. We have implemented a compiler for Catala, and have proven the correctness of its core compilation steps using the F* proof assistant.
We evaluate Catala on several legal texts that are algorithms in disguise, notably section 121 of the US federal income tax and the byzantine French family benefits; in doing so, we uncover a bug in the official implementation of the French benefits. We observe as a consequence of the formalization process that using Catala enables rich interactions between lawyers and programmers, leading to a greater understanding of the original legislative intent, while producing a correct-by-construction executable specification reusable by the greater software ecosystem. Doing so, Catala increases trust in legal institutions, and mitigates the risk of societal damage due to incorrect implementations of the law.
Supplemental Material
- Danel Ahman, Cătălin Hriţcu, Kenji Maillard, Guido Martínez, Gordon Plotkin, Jonathan Protzenko, Aseem Rastogi, and Nikhil Swamy. 2017. Dijkstra monads for free. In Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages. 515–529.Google Scholar
Digital Library
- Layman E Allen. 1956. Symbolic logic: A razor-edged tool for drafting and interpreting legal documents. Yale LJ, 66 (1956), 833.Google Scholar
Cross Ref
- Anne Broache. 2008. IRS trudges on with aging computers. https://www.cnet.com/news/irs-trudges-on-with-aging-computers/Google Scholar
- Marie-Andrée Blanc. 2016. La modulation des allocations familiales : une erreur historique. Travail, genre et sociétés, 35, 1 (2016), 157–161. isbn:9782707189493 https://doi.org/10.3917/tgs.035.0157 Google Scholar
Cross Ref
- Gerhard Brewka and Thomas Eiter. 2000. Prioritizing default logic. In Intellectics and computational logic. Springer, 27–45.Google Scholar
Cross Ref
- Marie-Françoise Clergeau. 2016. Plaidoyer pour la modulation. Travail, genre et sociétés, 35, 1 (2016), 173–177. isbn:9782707189493 https://doi.org/10.3917/tgs.035.0173 Google Scholar
Cross Ref
- Alain Colmerauer and Philippe Roussel. 1996. The Birth of Prolog. Association for Computing Machinery, New York, NY, USA. 331–367.Google Scholar
- Sylvain Conchon, Jean-Christophe Filliâtre, and Julien Signoles. 2007. Designing a Generic Graph Library Using ML Functors.. Trends in functional programming, 8 (2007), 124–140.Google Scholar
- Leonardo de Moura and Nikolaj Bjørner. 2008. Z3: An Efficient SMT Solver. In Tools and Algorithms for the Construction and Analysis of Systems, C. R. Ramakrishnan and Jakob Rehof (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg. 337–340.Google Scholar
Digital Library
- Merigoux Denis, Chataing Nicolas, and Protzenko Jonathan. 2021. Catala: A Programming Language for the Law. https://doi.org/10.5281/zenodo.4775161 Google Scholar
Cross Ref
- John Dewey. 1924. Logical method and law. Cornell LQ, 10 (1924), 17.Google Scholar
- Derek Doran, Sarah Schulz, and Tarek R Besold. 2017. What does explainable AI really mean? A new conceptualization of perspectives. arXiv preprint arXiv:1710.00794.Google Scholar
- Frank R. Konkel. 2018. The IRS system processing your taxes is almost 60 years old. https://www.nextgov.com/it-modernization/2018/03/irs-system-processing-your-taxes-almost-60-years-old/146770/Google Scholar
- Michael Genesereth. 2015. Computational Law. The Cop in the Backseat.Google Scholar
- Randy Goebel, Ajay Chander, Katharina Holzinger, Freddy Lecue, Zeynep Akata, Simone Stumpf, Peter Kieseberg, and Andreas Holzinger. 2018. Explainable ai: the new 42? In International cross-domain conference for machine learning and knowledge extraction. 295–303.Google Scholar
- Government Accountability Office (GAO). 2021. COVID-19: Urgent Actions Needed to Better Ensure an Effective Federal Response – Report to Congressional Committees. https://www.gao.gov/reports/GAO-21-191/##appendix24 Appendix 24, first table.Google Scholar
- Xiao He, Bohan Qin, Yan Zhu, Xing Chen, and Yi Liu. 2018. Spesc: A specification language for smart contracts. In 2018 IEEE 42nd Annual Computer Software and Applications Conference (COMPSAC). 1, 132–137.Google Scholar
Cross Ref
- Nils Holzenberger, Andrew Blair-Stanek, and Benjamin Van Durme. 2020. A Dataset for Statutory Reasoning in Tax Law Entailment and Question Answering. arXiv preprint arXiv:2005.05257.Google Scholar
- Tom Hvitved. 2011. Contract formalisation and modular implementation of domain-specific languages. Ph.D. Dissertation. Citeseer.Google Scholar
- Internal Revenue Service. [n.d.]. Exclusion of gain from sale of principal residence. https://www.law.cornell.edu/uscode/text/26/121Google Scholar
- Andrew W Keep and R Kent Dybvig. 2013. A nanopass framework for commercial compiler development. In Proceedings of the 18th ACM SIGPLAN international conference on Functional programming. 343–350.Google Scholar
Digital Library
- D. E. Knuth. 1984. Literate Programming. Comput. J., 27, 2 (1984), 01, 97–111.Google Scholar
- Sarah Lawsky. 2018. Formal Methods and the Law. https://popl18.sigplan.org/details/POPL-2018-papers/3/Formal-Methods-and-the-LawGoogle Scholar
- Sarah B. Lawsky. 2017. Formalizing the Code. Tax Law Review, 70, 377 (2017).Google Scholar
- Sarah B. Lawsky. 2018. A Logic for Statutes. Florida Tax Review.Google Scholar
- Sarah B Lawsky. 2020. Form as Formalization. Ohio State Technology Law Journal.Google Scholar
- Philip Leith. 2016. The rise and fall of the legal expert system. International Review of Law, Computers & Technology, 30, 3 (2016), 94–106.Google Scholar
Digital Library
- Rodolphe Lepigre and Christophe Raffalli. 2018. Abstract representation of binders in ocaml using the bindlib library. arXiv preprint arXiv:1807.01872.Google Scholar
- Xavier Leroy. 2006. Formal Certification of a Compiler Back-end or: Programming a Compiler with a Proof Assistant. SIGPLAN Not., 41, 1 (2006), Jan., 42–54.Google Scholar
Digital Library
- Kif Leswing. 2020. New Jersey needs volunteers who know COBOL, a 60-year-old programming language. https://www.cnbc.com/2020/04/06/new-jersey-seeks-cobol-programmers-to-fix-unemployment-system.htmlGoogle Scholar
- Guido Martínez, Danel Ahman, Victor Dumitrescu, Nick Giannarakis, Chris Hawblitzel, Cătălin HriŢcu, Monal Narasimhamurthy, Zoe Paraskevopoulou, Clément Pit-Claudel, Jonathan Protzenko, Tahina Ramananandro, Aseem Rastogi, and Nikhil Swamy. 2019. Meta-F*: Proof Automation with SMT, Tactics, and Metaprograms. In Programming Languages and Systems, Luís Caires (Ed.). Springer International Publishing, Cham. 30–59. isbn:978-3-030-17184-1Google Scholar
- Denis Merigoux, Raphaël Monat, and Jonathan Protzenko. 2021. A Modern Compiler for the French Tax Code. Compiler Construction.Google Scholar
- Yasuhiko Minamide, Greg Morrisett, and Robert Harper. 1996. Typed closure conversion. In Proceedings of the 23rd ACM SIGPLAN-SIGACT symposium on principles of programming languages. 271–283.Google Scholar
Digital Library
- Antoine Miné, Xavier Leroy, Pascal Cuoq, and Christophe Troestler. 2011. The Zarith OCaml library. https://github.com/ocaml/ZarithGoogle Scholar
- Jacques Monin. 2018. Louvois, le logiciel qui a mis l’armée à terre. https://www.franceinter.fr/emissions/secrets-d-info/secrets-d-info-27-janvier-2018Google Scholar
- Jason Morris. 2020. Spreadsheets for Legal Reasoning: The Continued Promise of Declarative Logic Programming in Law. Available at SSRN 3577239.Google Scholar
- Marcos A Pertierra, Sarah Lawsky, Erik Hemberg, and Una-May O’Reilly. 2017. Towards Formalizing Statute Law as Default Logic through Automatic Semantic Parsing.. In ASAIL@ ICAIL.Google Scholar
- François Pottier. 2016. Reachability and error diagnosis in LR (1) parsers. In Proceedings of the 25th International Conference on Compiler Construction. 88–98.Google Scholar
Digital Library
- François Pottier and Yann Régis-Gianat. 2014. The Menhir Parser Generator. http://cambium.inria.fr/~fpottier/menhir/Google Scholar
- Mark Proctor. 2012. Drools: A Rule Engine for Complex Event Processing. In Proceedings of the 4th International Conference on Applications of Graph Transformations with Industrial Relevance (AGTIVE’11). Springer-Verlag, Berlin, Heidelberg. 2–2. https://doi.org/10.1007/978-3-642-34176-2_2 Google Scholar
Digital Library
- R. Reiter. 1980. A logic for default reasoning. Artificial Intelligence, 13, 1 (1980), 81 – 132. Special Issue on Non-Monotonic Logic.Google Scholar
Digital Library
- Vincenzo Scoca, Rafael Brundo Uriarte, and Rocco De Nicola. 2017. Smart contract negotiation in cloud computing. In 2017 IEEE 10th International Conference on Cloud Computing (CLOUD). 592–599.Google Scholar
Cross Ref
- M. J. Sergot, F. Sadri, R. A. Kowalski, F. Kriwaczek, P. Hammond, and H. T. Cory. 1986. The British Nationality Act As a Logic Program. Commun. ACM, 29, 5 (1986), May, 370–386.Google Scholar
Digital Library
- Sébastien Shulz. 2019. Un logiciel libre pour lutter contre l’opacité du système sociofiscal. Revue francaise de science politique, 69, 5 (2019), 845–868.Google Scholar
- Julien Signoles. 2011. The Calendar OCaml library. https://github.com/ocaml-community/calendarGoogle Scholar
- Nikhil Swamy, Catalin Hritcu, Chantal Keller, Aseem Rastogi, Antoine Delignat-Lavaud, Simon Forest, Karthikeyan Bhargavan, Cédric Fournet, Pierre-Yves Strub, Markulf Kohlweiss, Jean-Karim Zinzindohoué, and Santiago Zanella-Béguelin. 2016. Dependent Types and Multi-Monadic Effects in F*. In 43rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL). ACM, 256–270. https://www.fstar-lang.org/papers/mumon/Google Scholar
Digital Library
- Jonathan Turner. 2016. Shape of errors to come. https://blog.rust-lang.org/2016/08/10/Shape-of-errors-to-come.htmlGoogle Scholar
- Jérôme Vouillon and Vincent Balat. 2014. From bytecode to JavaScript: the Js_of_ocaml compiler. Software: Practice and Experience, 44, 8 (2014), 951–972.Google Scholar
Digital Library
- Wikipedia contributors. 2021. Code of Ur-Nammu — Wikipedia, The Free Encyclopedia. https://en.wikipedia.org/w/index.php?title=Code_of_Ur-Nammu&oldid=998720276 [Online; accessed 22-Feb-2021].Google Scholar
- Jakub Zakrzewski. 2018. Towards verification of Ethereum smart contracts: a formalization of core of Solidity. In Working Conference on Verified Software: Theories, Tools, and Experiments. 229–247.Google Scholar
Cross Ref
Index Terms
Catala: a programming language for the law
Recommendations
Lessons in Copyright Activism: K-12 Education and the DMCA 1201 Exemption Rulemaking Process
Digital learning is being transformed by changes in copyright law. This article discusses the author's personal journey as a copyright education activist through two rounds of rulemaking proceedings before the Copyright Office concerning the anti-...
The Study of the Interrelation between Law Programs and Digital Forensics in UAE Academia
InfoSecCD '13: Proceedings of the 2013 on InfoSecCD '13: Information Security Curriculum Development ConferenceThe field of digital forensics is growing in the Middle East which is shown by the establishment of technical digital forensic programs in various universities. Even though these programs are important for the development and advancement of the field ...
Natural language processing in law: Prediction of outcomes in the higher courts of Turkey
AbstractNatural language processing (NLP) based approaches have recently received attention for legal systems of several countries. It is of interest to study the wide variety of legal systems that have so far not received any attention. In ...






Comments