LSPR's Blog Symposium on “Rules as Code”

Computational Law in the Digital Age


Jerrold Soh*


Computational law, an interdisciplinary field at the intersection of law and computer science, seeks to develop systems capable of interacting with legal rules in a structured, computationally useful manner. As legal systems undergo digital transformation, the field must evolve to integrate emerging machine learning technologies while maintaining the rigor of formal legal reasoning. This piece explores the conceptual foundations of computational law, emphasizing the value of formalization and the need for cross-disciplinary collaboration. It argues that bridging the divide between symbolic and neural approaches—through neurosymbolic methods—offers promising avenues for computational law. By leveraging large language models for knowledge acquisition, logical frameworks for reasoning, and machine learning for handling open-textured legal concepts, computational law can enhance legal automation while preserving interpretability and correctness. The essay concludes that as legal digitalization accelerates, computational law must adapt by embracing hybrid methodologies to ensure effective and responsible legal tech development.

  Computational law is an established field at the intersection of law and computer science which studies how we might build computational systems capable of sensibly interfacing with law. Imagine, for instance, software which checks the logic of a contract for possible inconsistencies, simulates potential outcomes upon events like breach or change of control, and/or automatically executes certain actions, such as paying the contract sum to a specified party, when pre-defined events are fulfilled. To this end, the field has devoted significant attention towards producing useful computational representations of legal rules, being formal expressions of law’s logic in computer code. In trendier parlance, this can be understood as building digital twins for laws. Although computational law systems are far from mainstream today, law-adjacent industries such as finance and public policy have become increasingly computational. Legal systems around the world are also attempting to enter a more digital age. In this light, this piece offers several thoughts on how computational law can thrive in an era increasingly dominated by machine learning technologies. The essay begins by considering computational law’s conceptual foundations before suggesting a need to bridge old disciplinary and methodological divides. It then spotlights three promising avenues for neuro-symbolic computational law.

The conceptual origins and goals of computational law

The concept of “computational law”, crystallized in Love and Genesereth’s seminal paper, has roots that extend far back in intellectual history. Leibniz famously declared in 1679 that

“[t]he only way to rectify our reasonings is to make them tangible as those of the Mathematicians, so that we can find our error at a glance, and when there are disputes among persons, we can simply say: Let us calculate, without further ado, to see who is right”.

Inheriting this tradition, computational law’s central insight lies in realizing      the value of formalization. Formal representations of legal rules can be automatically compiled, executed, explained, and verified. The conversion from law to code is, to be sure, not loss-free. Laws frequently comprise open-textured concepts difficult to reduce to exact computable forms. But just as a map can be useful even when it does not perfectly reproduce the territory, so can computational systems which do not capture every legal nuance. Abstraction and simplification enable processing and computation, whether by humans or machines. This lesson is amply demonstrated by the significant technological advancement which digital rather than analog computers have enabled. Computational law can similarly be seen as an exercise in mapping law’s infinite, continuous semantics onto a finite, discrete space. Like maps of the law, computational law systems provide practical, navigable representations of the same.

Computational law is in this sense an enterprise in digitalizing law. To be sure, facilitating not only efficient but correct legal resolutions demands that the computational representation sufficiently (again, not perfectly) captures the law’s underlying structure. Love and Genesereth thus advocate for computational law systems within specific contexts where open texture can be effectively managed. This is sometimes overlooked by critics who interpret computational law as having the ambition of making all law computable. Hildebrant and colleagues have, for instance, raised strong concerns about so-called “code driven law” undermining the rule of law. Such critique is fairly levelled at anyone misguided enough to believe that hard science and technology alone would be enough to ‘solve law’. In an era of strong AI optimism, those who genuinely think this may well exist. But to many who work in this field, the aim is not to replace legal reasoning but to augment it. We are more interested in building practical systems that help lawyers and laypersons than in sounding alarms about the use of computers in the legal process.

Bridging disciplinary and methodological divides

The above reveals a persistent divide between engineering and legal approaches to societal problems, especially the growing inaccessibility of justice. Presumably influenced by the tools they respectively have at disposal, engineers tend to seek technical solutions through system building, while lawyers focus on articulating principles and frameworks targeted at influencing human behaviour. But real-world challenges typically demand both technical and legal solutions that account for ecosystemic issues. This highlights the need for integrated approaches and cross-disciplinary dialogue.

The same applies withincomputational law. All approaches relevant for solving the problem at hand should be acceptable regardless of whether it originates from the technological paradigm presently considered orthodox. The technological landscape has changed in the two decades since Love and Genesereth’s pioneering work. Arguably the most significant change has been the shift from symbolic, rules-based approaches to machine learning (ML) as the dominant method for building (artificially intelligent) software. Machine learning algorithms are not new, but the field’s meteoric rise can be attributed partly to disillusionment with the overpromises made about expert systems in the previous AI winter, and partly to the dramatic fall in data and compute costs we have seen over the last few decades. Headline and Nobel prize-grabbing milestones such as AlphaGo, AlphaFold, and ChatGPT have cemented the popularity of statistical AI approaches amongst researchers, firms, governments, and research funders.

This is not to say that machine learning is always better. Expert systems remain very much in practical use today. We have just stopped calling the more successful implementations “AI”. A recent example is Singapore’s Motor Accidents Outcome Simulator, which takes the facts of a traffic accident and resulting injuries as inputs and returns a simulated liability split and damages quantum. Dreyfus’ 1992 critique expressed equal skepticism towards both symbolic and statistical approaches as sufficient for attaining true artificial intelligence. Further, leading machine learning systems have expanded to such a scale that they now routinely raise concerns about resource consumption and environmental impact. Depending on the task, conventional approaches can achieve similar or better results at a fraction of the cost. A pocket calculator can multiply two numbers far more efficiently than any large language model (LLM).[1]

The point is that both neural and symbolic approaches have their own strengths and weaknesses. Statistical models can better interface with legal information that is almost inevitably expressed in unstructured text but are not by their very nature made for rigorous (legal) reasoning. Symbolic approaches produce explainable and ex ante verifiable decision traces but struggle with the vagaries of natural language and the combinatorial explosion of real world scenarios. As Floris Bex argues, significant opportunities for future research lie in thoughtfully combining data-driven and knowledge-based approaches. The promise of neurosymbolic methods is increasingly being recognized outside computational law.

Neurosymbolic Computational Law

Several promising directions exist for pursuing neurosymbolic computational law. First, LLMs can help with addressing the knowledge acquisition bottleneck. That is, the large, often prohibitive costs necessary for creating an adequate computational legal representation. The conventional manual process for doing so — having a team of people read the law and write the code — requires rare and expensive expertise in both law and computer science. LLMs can bridge this gap by facilitating the conversion from legal rules to logical formulas. This is effectively a machine translation task, and LLMs have become increasingly adept at formal language generation. Significant work on automatically translating law to logic with classic ML methods already exists. Cutting-edge LLMs could enhance this further.

Second, logical frameworks can serve as reasoning and control layers for LLMs. The inevitable tendency of LLMs to hallucinate poses significant challenges for their application in the legal domain. While existing counter-hallucination strategies like retrieval-augmented generation offer some improvements, they remain fundamentally probabilistic and do not allow ex ante output verification or quality assurance. This may disqualify end-to-end ML approaches from public or client-facing use cases because the risk of misrepresenting the law is often unacceptable for law firms, courts, and other key legal stakeholders. Now consider a simple system where legal LLM outputs are cross-checked against an authoritative list of verified      case names and citations before being sent to the user. This could prevent the generation of fictitious cases which landed the Mata lawyer in trouble. In such a system, the probabilistic outputs of the LLM are constrained by the determinism of the humble reference table. Providing trustworthy and “hallucination-free” citations has become the focus of many legal AI providers, though the secrecy we can usually expect today with corporate AI systems prevents us from knowing how far neurosymbolic methods are used therein. More broadly, a blueprint for enhancing the flexibility of LLMs with the rigour of logical approaches is Deepmind’s AlphaProof. A formalizer network converted natural language math Olympiad questions into formal problems written in the functional proof assistant language Lean. The formal problems were used to train a separate reinforcement learning-based solver network towards finding the right proofs. Notice that this second step was only possible because solutions to formal problems can be formally verified. This allowed training rewards for the solver to be automatically generated based on proof correctness. A legal domain-specific language[2] such as LLD, Catala, or L4 could play Lean’s role in a hybrid computational law system. AI researchers have already begun to study approaches for enhancing LLMs with logic. So too have AI and law scholars.

Third, machine learning systems can serve as simulated oracles for handling open-textured concepts in computational law systems. When developers of computational representations encounter concepts that resist definite specification (e.g. did Party A take “reasonable efforts” to address the breach?), the practical choice is usually to put this question to the user. Machine learning models can support this process by offering simulations based on precedent data. To be clear, this is not meant to substitute for human (lawyer) input on these concepts. Nonetheless, in practical computational law projects, getting a considered legal opinion on open-textured questions typically requires substantial time and resources. An ML system which simulates a quick, approximate answer could allow development to proceed while the legal domain experts are deliberating.

Looking Forward

Chief Justice Sundaresh Menon of Singapore has noted that,

“as technology expands access to legal information, the public will increasingly use and expect to use digital tools to access the law. Such tools will therefore increasingly act as the intermediaries between citizens and the law in a growing number of contexts. This has major implications for our legal systems; and we must face up to them and adapt, or risk becoming overwhelmed”.      

As legal systems around the world attempt to digitalise, lessons learnt from decades of computational law research are today more relevant than before. They can guide legal digitalization efforts away from known dead ends and towards established best practices. They can help promote the accurate, informed, and efficient use of legal information systems. But the digitalization of law can and will happen with or without the research community’s input. To contribute to this transition, computational law can evolve alongside new technologies and societal realities. It can bridge entrenched disciplinary and methodological divides. It can embrace hybrid approaches, combining the best of both symbolic and neural methods while covering their respective shortfalls. Computational law can flourish in the digital age.


[1] Taking GPT3, which has 175 billion parameters, for example, prompting the language model to “calculate the result of 6 times 7” would approximately involve multiply 175 billion numbers several times over to generate a response as such “the answer is 42”.

[2] In computer science terms, domain-specific languages are programming languages written for specific use cases. For instance, the Postscript is a language Adobe developed specifically for rendering documents, and today powers the PDF format. Legal domain-specific languages, then, are programming languages specially designed for expressing legal concepts and rules.


* Jerrold is an Assistant Professor at the Singapore Management University School of Law and Deputy Director of its Centre for Computational Law. He started programming computers in 2010. While studying law and economics at NUS, he co-founded a legal analytics startup Lex Quanta that worked on several legal machine learning projects. He joined SMU in 2018 and obtained an LLM from Harvard Law School in 2020. His present research focuses on legal NLP, network analytics, and good old legal questions around AI regulation and liability. He teaches the law of torts as well as an omnibus course on law and technology.