McMaster University
Dependent Types as a Medium for Domain Modelling: Case Studies and Lessons from Agda
Abstract
dc:description.abstractDependent types are commonly presented as a foundation for program verification, enabling precise specifications and machine-checked proofs of correctness. In practice, however, much of the intellectual effort in formal methods is spent not on proving properties of programs, but on modelling: deciding how a domain should be structured, which distinctions should be represented, and which constraints should be enforced explicitly. This thesis investigates dependent types as a modelling medium, rather than primarily as a verification technology. The central claim is that dependent typing can reshape domain models by forcing structural assumptions, invariants, and semantic commitments to be made explicit, and that the benefits and costs of this explicitness only become visible through extended modelling practice. The study is conducted through a series of case studies developed in Agda, spanning multiple domains: a railway system modelled at both problem-space and solution-space levels, a structure-aware version control system, file and order management systems, and a typed calculator serving as a low-payoff baseline. Across these models, recurring patterns are identified, including semantic refinement, projection between modelling levels, and the relocation of invariants from predicates into type structure. Cross-case analysis suggests that dependent types can significantly improve clarity and local reasoning by making ill-formed states unrepresentable, but at the cost of increased proof burden, reduced modelling flexibility, and higher refactoring effort. The thesis concludes by distilling practical design guidance for future modellers, outlining when dependent types are likely to aid domain understanding, and when their use is unwarranted or counterproductive.
Degree
thesis:*- Department dc:contributor.department
- Computing and Software
- Year dc:date.issued
- 2026
Author and committee
dc:creator, dc:contributor.*- Author dc:creator
-
- An, Nan
- Advisor dc:contributor.advisor
-
- Carette, Jacques
Subjects
dc:subject × 6Rights
dc:rights- Statement dc:rights
-
- Attribution 4.0 International
- Licence dc:rights.uri
- Language dc:language.iso
- en_US
Identifiers
dc:identifier.*- Identifier URI
- https://doi.org/10.71548/2264