The Pacioli Combinator Library: A Universal Domain-Specific Language for Financial and Economic Computation on the Pacioli Manifold
Authors/Creators
Description
PENDING QUALITY AUDIT (2026-08). The file is restricted while this record is reviewed as part of a systematic audit of the author's corpus. It has not yet been assessed. Metadata and DOI remain public, and access can be requested.
Abstract
Peyton Jones, Eber, and Seward [1] identified a structural problem in financial engineering: practitioners maintained a large catalogue of hand-coded contract types with no compositional structure and no formal semantics, making systematic analysis impossible. Their solution—a combinator library with a denotational valuation semantics embedded in Haskell—is the direct intellectual ancestor of this paper.
The same problem recurs across every application domain built on the Pacioli manifold: derivative pricing, accounting consolidation, credit risk, XVA, regulatory capital, agent-based simulation, and climate risk modelling each maintain their own isolated catalogue of hand-coded objects, with no shared primitives and no common language.
We introduce the Pacioli Combinator Library (PCL): a Python embedded domain-specific language (eDSL) that is the universal expression language for Financial and Economic Gauge Theory (FGT/EGT, Papers 291–305). PCL is to the Pacioli manifold what SQL is to the relational model: a single compositional language whose terms compile, under domain-specific models, to computations appropriate for pricing, accounting, risk, simulation, or optimisation—from one codebase, all differentiable. PCL provides:
-
A compositional denotational semantics $\Phi(\cdot )$ mapping
Behaviourterms to flow processes on the Pacioli manifold, with the $\partial^2 = 0$ bookkeeping invariant guaranteed by construction at every combinator; -
The
choose$(\beta, \dots)$ combinator: a Maslov–Gibbs softmax over alternatives, differentiable at all finite $\beta$ and recovering classical winner-take-all choice in the limit $\beta \to \infty$; -
An observable layer carrying the full EGT connection coefficient vocabulary: yield, credit spread, FX holonomy, off-diagonal climate curvature, and carbon liability (Papers 295–300);
-
A JAX compiler translating any well-formed PCL term into a differentiable JAX computation graph under a caller-supplied
Model, enabling gradient-based optimisation viajax.gradacross all application domains.
The same PCL term zcb(t, 100, GBP, edge) compiles to a discounted cash flow under a PricingModel, to a balance sheet entry under an AccountingModel, and to a credit-adjusted exposure under a RiskModel. The design follows Peyton Jones et al. exactly in spirit: identify the minimal set of orthogonal primitives, give each a precise denotational semantics, and let the algebra emerge. The choose combinator, the EGT observable layer, and the multi-domain model architecture are the three primary contributions relative to their contract DSL.