Reference. Homotopical patch theory
Homotopy type theory is an extension of Martin-Löf type theory, based on a correspondence with homotopy theory and higher category theory. In homotopy type theory, the propositional equality type is proof-relevant, and corresponds to paths in a space. This allows for a new class of datatypes, called higher inductive types, which are specified by constructors not only for points but also for paths. In this paper, we consider a programming application of higher inductive types. Version control systems such as Darcs are based on the notion of patches—syntactic representations of edits to a repository. We show how patch theory can be developed in homotopy type theory. Our formulation separates formal theories of patches from their interpretation as edits to repositories. A patch theory is presented as a higher inductive type. Models of a patch theory are given by maps out of that type, which, being functors, automatically preserve the structure of patches. Several standard tools of homotopy theory come into play, demonstrating the use of these methods in a practical programming context.
Cite
Cited by (4)
Grove: A Bidirectionally Typed Collaborative Structure Editor Calculus adams-2025-grove
Version control systems typically rely on a patch language , heuristic patch synthesis algorithms like diff , and three-way merge algorithms . Standard patch languages and merge algorithms often fail to identify conflicts correctly when there are multiple edits to one line of code or code is relocated. This paper introduces Grove, a collaborative structure editor calculus that eliminates patch synthesis and three-way merge algorithms entirely. Instead, patches are derived directly from the log of the developer’s edit actions and all edits commute, i.e. the repository state forms a commutative replicated data type (CmRDT). To handle conflicts that can arise due to code relocation, the core datatype in Grove is a labeled directed multi-graph with uniquely identified vertices and edges. All edits amount to edge insertion and deletion, with deletion being permanent. To support tree-based editing, we define a decomposition from graphs into groves , which are a set of syntax trees with conflicts–including local, relocation, and unicyclic relocation conflicts–represented explicitly using holes and references between trees. Finally, we define a type error localization system for groves that enjoys a totality property, i.e. all editor states in Grove are statically meaningful, so developers can use standard editor services while working to resolve these explicitly represented conflicts. The static semantics is defined as a bidirectional marking system in line with recent work, with gradual typing employed to handle situations where errors and conflicts prevent type determination. We then layer on a unification-based type inference system to opportunistically fill type holes and fail gracefully when no solution exists. We mechanize the metatheory of Grove using the Agda theorem prover. We implement these ideas as the Grove Workbench , which generates the necessary data structures and algorithms in OCaml given a syntax tree specification.
Internalizing representation independence with univalence angiuli-2021-internalizing
In their usual form, representation independence metatheorems provide an external guarantee that two implementations of an abstract interface are interchangeable when they are related by an operation-preserving correspondence. If our programming language is dependently-typed, however, we would like to appeal to such invariance results within the language itself, in order to obtain correctness theorems for complex implementations by transferring them from simpler, related implementations. Recent work in proof assistants has shown that Voevodsky’s univalence principle allows transferring theorems between isomorphic types, but many instances of representation independence in programming involve non-isomorphic representations. In this paper, we develop techniques for establishing internal relational representation independence results in dependent type theory, by using higher inductive types to simultaneously quotient two related implementation types by a heterogeneous correspondence between them. The correspondence becomes an isomorphism between the quotiented types, thereby allowing us to obtain an equality of implementations by univalence. We illustrate our techniques by considering applications to matrices, queues, and finite multisets. Our results are all formalized in Cubical Agda, a recent extension of Agda which supports univalence and higher inductive types in a computationally well-behaved way.
Constructing Higher Inductive Types as Groupoid Quotients vanderweide-2020-constructing
Cubical Agda: A Dependently Typed Programming Language with Univalence and Higher Inductive Types VezzosiMortbergAbel2019
Proof assistants based on dependent type theory provide expressive languages for both programming and proving within the same system. However, all of the major implementations lack powerful extensionality principles for reasoning about equality, such as function and propositional extensionality. These principles are typically added axiomatically which disrupts the constructive properties of these systems. Cubical type theory provides a solution by giving computational meaning to Homotopy Type Theory and Univalent Foundations, in particular to the univalence axiom and higher inductive types. This paper describes an extension of the dependently typed functional programming language Agda with cubical primitives, making it into a full-blown proof assistant with native support for univalence and a general schema of higher inductive types. These new primitives make function and propositional extensionality as well as quotient types directly definable with computational content. Additionally, thanks also to copatterns, bisimilarity is equivalent to equality for coinductive types. This extends Agda with support for a wide range of extensionality principles, without sacrificing type checking and constructivity.
Cites 49 works (3 here)
With notes (3)
Calculating the Fundamental Group of the Circle in Homotopy Type Theory licata-2013-calculating
Observational equality, now! altenkirch-2007-observational
Separation logic: A logic for shared mutable data structures reynolds_separation_2002
In joint work with Peter O’Hearn and others, based on early ideas of Burstall, we have developed an extension of Hoare logic that permits reasoning about low-level imperative programs that use shared mutable data structure. The simple imperative programming language is extended with commands (not expressions) for accessing and modifying shared structures, and for explicit allocation and deallocation of storage. Assertions are extended by introducing a “separating conjunction” that asserts that its subformulas hold for disjoint parts of the heap, and a closely related “separating implication”. Coupled with the inductive definition of predicates on abstract data structures, this extension permits the concise and flexible description of structures with controlled sharing. In this paper, we survey the current development of this program logic, including extensions that permit unrestricted address arithmetic, dynamically allocated arrays, and recursive procedures. We also discuss promising future directions.
External (46)
- Cubical Type Theory: A Constructive Interpretation of the Univalence Axiom (preprint) (2016)
- A Cubical Approach to Synthetic Homotopy Theory (2015)
- A generalization of the Takeuti–Gandy interpretation (2015)
- Towards Cubical Type Theory (preprint) (2015)
- Synthetic Cohomology in Homotopy Type Theory (M.Phil. thesis) (2015)
- Pijul (project website) (2015)
- Internalization of Extensional Equality (2015)
- The Semantics of Version Control (2014)
- Eilenberg-MacLane spaces in homotopy type theory (2014)
- Containers in Homotopy Type Theory (2014)
- Univalence for inverse diagrams and homotopy canonicity (2014)
- A model of type theory in cubical sets (2014)
- Covering spaces in homotopy type theory (TYPES 2014 talk) (2014)
- A Categorical Theory of Patches (2013)
- Darcs (project website) (2013)
- pi_n(S^n) in homotopy type theory (2013)
- Higher Inductive Types (in preparation) (2013)
- Canonicity for 2-dimensional type theory (2012)
- On editing text (blog post) (2012)
- The Simplicial Model of Univalent Foundations (2012)
- Camp Patch Theory (2012)
- 2-Dimensional Directed Type Theory (2011)
- Higher Inductive Types: A Tour of the Menagerie (blog post) (2011)
- Homotopy Type Theory VI: Higher Inductive Types (blog post) (2011)
- Types are weak ω -groupoids (2010)
- Homotopy Theoretic Models of Identity Types (2009)
- Two-dimensional models of type theory (2009)
- Weak ω-Categories from Intensional Type Theory (2009)
- Type-Correct Changes: A Safe Approach to Version Control Implementation (MS thesis) (2009)
- A formalization of Darcs patch theory using inverse semigroups (2009)
- Theory of Patches (Darcs 2.1 appendix) (2009)
- The identity type weak factorisation system (2008)
- Homotopy Theoretic Aspects of Constructive Type Theory (PhD thesis) (2008)
- Towards a Practical Programming Language Based on Dependent Type Theory (PhD thesis) (2007)
- A very short note on homotopy lambda-calculus (2006)
- Containers: Constructing strictly positive types (2005)
- Darcs: distributed version management in Haskell (2005)
- Some Properties of Darcs Patch Theory (2005)
- Dependently Typed Functional Programs and Their Proofs (PhD thesis) (2000)
- The groupoid interpretation of type theory (1998)
- Programming in Martin-Löf's Type Theory, an Introduction (1990)
- Implementing Mathematics with the NuPRL Proof Development System (1986)
- The strength of Martin-Löf's intuitionistic type theory with one universe (1977)
- Functorial Semantics of Algebraic Theories and Some Algebraic Problems in the Context of Functorial Semantics of Algebraic Theories (PhD thesis) (1963)
- Interpretation of analysis by means of constructive functionals of finite types (1959)
- On the interpretation of intuitionistic number theory (1945)