The notion of a contract plays a central role in the resource-rational contractualism framework. But what exactly is a “contract”? How are social contracts represented in the mind?
In this commentary, we discuss the need for a formal theory of contract representations. Such a theory would allow us to extend Levine et al.’s account of moral cognition in many valuable directions. First, an explicit account of contract representations would lay the groundwork for precisely specifying a computational architecture for how moral agents encode, store, and manipulate contracts. What computational operations support evaluating, comparing, composing, writing, and updating contracts? How do our representations of contracts interface with cognitive systems for planning, inference, and decision-making? How do we learn to work with contracts, and how do we incorporate past moral experiences (“precedent” and “case law”) into our future contractual reasoning (Feng et al., Reference Feng, Chen, Cheong, Xia and Zhang2023)?
Second, a formal treatment of contract representations would help us understand how moral agents manage resource-rational trade-offs. Different representational schemes come with different computational costs and benefits. Positing explicit data structures and algorithms for working with contracts would allow us to make quantitative, testable predictions about moral cognition: for example, the threshold where people might switch from converging on a contract specified as a series of special cases to a contract specified as a general rule.
Third, a formal account of contract representations would allow us to study how people come to acquire contracts: either by writing new contracts in new situations or by inferring existing contracts from observation. Contract acquisition can be modeled as searching over a space of possible contracts. For example, Oldenburg and Zhi-Xuan (Reference Oldenburg and Zhi-Xuan2024) propose a model of how observers might infer a society’s norms by observing agents’ (norm-constrained) actions and then performing Bayesian inference over a space of possible norms. A formal account of contract representations would specify more generally what the search space is for contract creation and inference.
What might this general search space look like? In Oldenburg and Zhi-Xuan’s model, the space of possible norms is generated by a grammar of first-order predicates over permissible behavior. More generally, a combinatorial language-like representation for contracts is appealing, as it provides a compositional approach to building complex representations from simple components. The mind might recombine “clauses” from prior agreements to create new contracts in new situations. One possibility, then, is that contracts are represented as programs in a language-of-thought for agreements: what we might call the “legalese-of-thought.”
It is indeed quite natural to conceive of contracts as programs, and recent years have seen many efforts to use specialized programming languages to represent legal agreements as executable “smart contracts.” Because smart contracts are formalized unambiguously in code, they enjoy the benefits of transparency, determinism, and decentralization – at least in principle. In practice, however, this formality comes at a cost: smart contracts famously struggle to handle the ambiguity inherent in the real world. They cannot adapt to new, unanticipated situations, and when edge cases inevitably occur, they cause millions of dollars in losses (Atzei, Bartoletti, & Cimoli, Reference Atzei, Bartoletti and Cimoli2017). This brittleness is inconsistent with the remarkable flexibility of the human moral mind, which suggests that deterministic programs are not the answer after all.
What are we missing here? An important observation is that legal contracts rarely, if ever, explicitly specify responses to every possible contingency, but the remaining ambiguity is often considered a “feature, not a bug” (Hadfield-Menell & Hadfield, Reference Hadfield-Menell and Hadfield2019). For example, treaties between nations sometimes contain vague terms to facilitate agreement while deferring contentious specifics to future negotiation (Koremenos, Reference Koremenos2016). Similarly, constitutional principles are frequently articulated at a high level of abstraction to accommodate evolving societal values and unforeseen technological development (Sunstein, Reference Sunstein1996). The Fourth Amendment of the US Constitution prohibits “unreasonable searches and seizures” but leaves “unreasonable” undefined (see, e.g., Katz v. United States), and the Clean Air Act requires protecting public health with an “adequate margin of safety” to address uncertainties associated with hazards that have not yet been fully identified (McClellan, Reference McClellan2012). The wisdom in such agreements is in acknowledging the many sources of uncertainty inherent in moral reasoning: from uncertainty about the current state of the world to uncertainty about future outcomes to uncertainty about the meaning of the contract itself.
If principled reasoning under uncertainty really is a fundamental feature of contract representations, then probabilistic programs may offer a more compelling representational framework than deterministic programs. Probabilistic programs combine the strengths of explicit symbolic reasoning with the flexibility of graded statistical inference. In particular, probabilistic programming languages like memo (Chandra et al, Reference Chandra, Chen, Tenenbaum and Ragan-Kelley2025), which center theory-of-mind reasoning, can be used to study how moral agents come up with contracts in the face of uncertainty over each other’s beliefs, desires, and intentions. For example, when deciding whether to take an action that affects another person without their consent (Levine et al, Reference Levine, Kleiman-Weiner, Chater, Cushman and Tenenbaum2024), a moral agent may consider a contract that requires making graded probabilistic inferences about the other party’s values (“it is okay if I am confident that this is what you want”). To study how moral agents interpret written rules, we might follow Wong et al. (Reference Wong, Grand, Lew, Goodman, Mansinghka, Andreas and Tenenbaum2023) and model natural-language rules as being translated into a probabilistic legalese-of-thought by a language model. As for unwritten rules, we might consider how uncertainty creates space for moral agents to coordinate contracts around Schelling points: salient equilibria that emerge without explicit communication (Schelling, Reference Schelling1960).
Effective moral cognition demands representations that are explicit enough to coordinate social inference and behavior, yet flexible enough to accommodate the pervasive uncertainty we have about our world, our future, and each other. A probabilistic “legalese-of-thought” would reveal the internal data structures that make our moral inferences tractable, quantify the resource costs that shape moral reasoning, and provide a common language for cognitive scientists, computer scientists, and philosophers to specify and test theories of moral agreement.
The notion of a contract plays a central role in the resource-rational contractualism framework. But what exactly is a “contract”? How are social contracts represented in the mind?
In this commentary, we discuss the need for a formal theory of contract representations. Such a theory would allow us to extend Levine et al.’s account of moral cognition in many valuable directions. First, an explicit account of contract representations would lay the groundwork for precisely specifying a computational architecture for how moral agents encode, store, and manipulate contracts. What computational operations support evaluating, comparing, composing, writing, and updating contracts? How do our representations of contracts interface with cognitive systems for planning, inference, and decision-making? How do we learn to work with contracts, and how do we incorporate past moral experiences (“precedent” and “case law”) into our future contractual reasoning (Feng et al., Reference Feng, Chen, Cheong, Xia and Zhang2023)?
Second, a formal treatment of contract representations would help us understand how moral agents manage resource-rational trade-offs. Different representational schemes come with different computational costs and benefits. Positing explicit data structures and algorithms for working with contracts would allow us to make quantitative, testable predictions about moral cognition: for example, the threshold where people might switch from converging on a contract specified as a series of special cases to a contract specified as a general rule.
Third, a formal account of contract representations would allow us to study how people come to acquire contracts: either by writing new contracts in new situations or by inferring existing contracts from observation. Contract acquisition can be modeled as searching over a space of possible contracts. For example, Oldenburg and Zhi-Xuan (Reference Oldenburg and Zhi-Xuan2024) propose a model of how observers might infer a society’s norms by observing agents’ (norm-constrained) actions and then performing Bayesian inference over a space of possible norms. A formal account of contract representations would specify more generally what the search space is for contract creation and inference.
What might this general search space look like? In Oldenburg and Zhi-Xuan’s model, the space of possible norms is generated by a grammar of first-order predicates over permissible behavior. More generally, a combinatorial language-like representation for contracts is appealing, as it provides a compositional approach to building complex representations from simple components. The mind might recombine “clauses” from prior agreements to create new contracts in new situations. One possibility, then, is that contracts are represented as programs in a language-of-thought for agreements: what we might call the “legalese-of-thought.”
It is indeed quite natural to conceive of contracts as programs, and recent years have seen many efforts to use specialized programming languages to represent legal agreements as executable “smart contracts.” Because smart contracts are formalized unambiguously in code, they enjoy the benefits of transparency, determinism, and decentralization – at least in principle. In practice, however, this formality comes at a cost: smart contracts famously struggle to handle the ambiguity inherent in the real world. They cannot adapt to new, unanticipated situations, and when edge cases inevitably occur, they cause millions of dollars in losses (Atzei, Bartoletti, & Cimoli, Reference Atzei, Bartoletti and Cimoli2017). This brittleness is inconsistent with the remarkable flexibility of the human moral mind, which suggests that deterministic programs are not the answer after all.
What are we missing here? An important observation is that legal contracts rarely, if ever, explicitly specify responses to every possible contingency, but the remaining ambiguity is often considered a “feature, not a bug” (Hadfield-Menell & Hadfield, Reference Hadfield-Menell and Hadfield2019). For example, treaties between nations sometimes contain vague terms to facilitate agreement while deferring contentious specifics to future negotiation (Koremenos, Reference Koremenos2016). Similarly, constitutional principles are frequently articulated at a high level of abstraction to accommodate evolving societal values and unforeseen technological development (Sunstein, Reference Sunstein1996). The Fourth Amendment of the US Constitution prohibits “unreasonable searches and seizures” but leaves “unreasonable” undefined (see, e.g., Katz v. United States), and the Clean Air Act requires protecting public health with an “adequate margin of safety” to address uncertainties associated with hazards that have not yet been fully identified (McClellan, Reference McClellan2012). The wisdom in such agreements is in acknowledging the many sources of uncertainty inherent in moral reasoning: from uncertainty about the current state of the world to uncertainty about future outcomes to uncertainty about the meaning of the contract itself.
If principled reasoning under uncertainty really is a fundamental feature of contract representations, then probabilistic programs may offer a more compelling representational framework than deterministic programs. Probabilistic programs combine the strengths of explicit symbolic reasoning with the flexibility of graded statistical inference. In particular, probabilistic programming languages like memo (Chandra et al, Reference Chandra, Chen, Tenenbaum and Ragan-Kelley2025), which center theory-of-mind reasoning, can be used to study how moral agents come up with contracts in the face of uncertainty over each other’s beliefs, desires, and intentions. For example, when deciding whether to take an action that affects another person without their consent (Levine et al, Reference Levine, Kleiman-Weiner, Chater, Cushman and Tenenbaum2024), a moral agent may consider a contract that requires making graded probabilistic inferences about the other party’s values (“it is okay if I am confident that this is what you want”). To study how moral agents interpret written rules, we might follow Wong et al. (Reference Wong, Grand, Lew, Goodman, Mansinghka, Andreas and Tenenbaum2023) and model natural-language rules as being translated into a probabilistic legalese-of-thought by a language model. As for unwritten rules, we might consider how uncertainty creates space for moral agents to coordinate contracts around Schelling points: salient equilibria that emerge without explicit communication (Schelling, Reference Schelling1960).
Effective moral cognition demands representations that are explicit enough to coordinate social inference and behavior, yet flexible enough to accommodate the pervasive uncertainty we have about our world, our future, and each other. A probabilistic “legalese-of-thought” would reveal the internal data structures that make our moral inferences tractable, quantify the resource costs that shape moral reasoning, and provide a common language for cognitive scientists, computer scientists, and philosophers to specify and test theories of moral agreement.
Acknowledgements
None.
Financial support
KC was supported by the Hertz Foundation and the NSF Graduate Research Fellowship Program. MKW was supported by the Cooperative AI Foundation, the Foresight Institute, and the Sony Research Award Program.
Competing interests
None.