https://github.com/kuniwak/isabelle-git-commit-graph
Formal Definition of the Git Commit‑Graph Model
https://github.com/kuniwak/isabelle-git-commit-graph
formal-methods git isabelle
Last synced: 5 months ago
JSON representation
Formal Definition of the Git Commit‑Graph Model
- Host: GitHub
- URL: https://github.com/kuniwak/isabelle-git-commit-graph
- Owner: Kuniwak
- License: mit
- Created: 2025-05-03T21:49:46.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-05-10T01:31:00.000Z (about 1 year ago)
- Last Synced: 2026-01-17T14:13:11.340Z (5 months ago)
- Topics: formal-methods, git, isabelle
- Language: Isabelle
- Homepage:
- Size: 15.6 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Formal Definition of the Git Commit‑Graph Model
===============================================
This document gives a formally defined state‑transition model of a Git commit‑object graph that can be mechanically verified in Isabelle.
With this definition, you can quickly write formal definitions of Git branching strategies and formal specifications of the tools that surround them.
To keep the focus on describing the commit graph itself, the concepts of tree and blob objects are omitted.
Consequently, this model is not suitable for formally specifying tools—such as merge drivers—that manipulate trees or blobs.
Moreover, because orphan branches are rarely used, we assume that any two commits in the graph share a common ancestor.
This lets us ignore merge‑failure cases caused by the absence of a common ancestor.
An example definition of a branching strategy can be found in [`ExampleBranchStrategy.thy`](./ExampleBranchStrategy.thy).
⸻
Types
- Git State
(commit graph * commit)- Graph
('a set * 'a rel)- Commit
- Abstracted as natural numbers, since only distinguishability between commits is required.
The initial state of the system is provided by `init`.
Transition Functions
mergemerge :: git ⇒ commit set ⇒ git optioncommitcommit :: git ⇒ commit ⇒ git option
License
-------
MIT License