This repository serves as my personal template for creating new Rocq projects. Rocq is a formal proof management system that provides a formal language to write mathematical definitions, executable algorithms, and theorems, together with an environment for semi-interactive development of machine-checked proofs.
To create a new project based on this template:
- Click the "Use this template" button on GitHub
- Choose a name for your new repository
- Clone your new repository
- Customize the project for your specific needs
Before using this template, ensure you have Rocq installed on your system:
Option 1: Using OPAM (Recommended)
opam install rocqOption 2: Using Nix
nix-shell -p rocqOption 3: From Source Follow the installation instructions at Rocq's official repository.
rocq --versionThis template provides a standard Rocq project layout:
.
├── _CoqProject # Project configuration file
├── Makefile # Build automation
├── theories/ # Main development theories
├── instances/ # Concrete instances and examples
├── examples/ # Usage examples and demos
└── README.md # This file
-
theories/: Contains the main theoretical development of your project. This is where you'll define abstract concepts, prove theorems, and develop the core mathematical content. -
instances/: Contains concrete instantiations of the abstract theories. This includes specific implementations and concrete examples of the general concepts defined intheories/. This might be a good place for instances of type classes. -
examples/: Contains example files demonstrating how to use your development. These serve as both documentation and tests for your theoretical work.
To build the entire project:
makeTo build a specific target:
make theories/YourFile.voTo clean all generated files:
make cleanThe _CoqProject file configures the project structure. It currently includes:
- Logical path mapping for the
Tmplnamespace - Include paths for all three main directories
You may want to customize this file by:
- Changing the namespace from
Tmplto something more descriptive - Adding dependencies to other Rocq libraries
- Setting compiler flags or options
Example customizations:
-R theories MyProject
-R instances MyProject
-R examples MyProject
# Add dependencies
-Q path/to/some/lib SomeLib
# Set options
-arg -w -arg -notation-overridden
- Rename the namespace: Edit
_CoqProjectto replaceTmplwith your project name - Update the README: Customize this README.md file for your specific project
- Add your first theory: Create a
.vfile in thetheories/directory - Build and test: Run
maketo ensure everything compiles - Add examples: Create demonstration files in
examples/
Create theories/BasicDefinitions.v:
(** * Basic Definitions *)
Definition my_constant : nat := 42.
Theorem example_theorem : my_constant = 42.
Proof.
reflexivity.
Qed.Then create theories/UsingBasic.v that uses the first file:
(** * Using Basic Definitions *)
From Tmpl Require Import BasicDefinitions.
Theorem my_constant_is_even : Nat.even my_constant = true.
Proof.
reflexivity.
Qed.When contributing to a project based on this template:
- Follow the established directory structure
- Document your definitions and theorems
- Provide examples in the
examples/directory - Ensure all proofs compile with
make - Update this README as needed
This template is provided as-is. Choose an appropriate license for your project when using this template.
Happy proving! 🎯