README.md 2.52 KB
Newer Older
Robbert Krebbers's avatar
Robbert Krebbers committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
# Coq-std++

This project contains an extended "Standard Library" for Coq called coq-std++.
The key features of this library are as follows:

- It provides a great number of definitions and lemmas for common data
  structures such as lists, finite maps, finite sets, and finite multisets.
- It uses type classes for common notations (like `∅`, `∪`, and Haskell-style
  monad notations) so that these can be overloaded for different data structures.
- It uses type classes to keep track of common properties of types, like it
  having decidable equality or being countable or finite.
- Most data structures are represented in canonical ways so that Leibniz
  equality can be used as much as possible (for example, for maps we have
  `m1 = m2` iff `∀ i, m1 !! i = m2 !! i`). On top of that, the library provides
  setoid instances for most types and operations.
- It provides various tactics for common tasks, like an ssreflect inspired
Robbert Krebbers's avatar
Robbert Krebbers committed
17
  `done` tactic for finishing trivial goals, a simple breadth-first solver
Robbert Krebbers's avatar
Robbert Krebbers committed
18 19 20
  `naive_solver`, an equality simplifier `simplify_eq`, a solver `solve_proper`
  for proving compatibility of functions with respect to relations, and a solver
  `set_solver` for goals involving set operations.
21
- It is entirely dependency- and axiom-free.
Robbert Krebbers's avatar
Robbert Krebbers committed
22

23 24 25 26 27 28 29 30
## Side-effects

Importing std++ has some side effects as the library sets some global options.
Notably:

* `Generalizable All Variables`: This option enables implicit generalization in
  arguments of the form `` `{...}`` (i.e., anonymous arguments).  Unfortunately, it
  also enables implicit generalization in `Instance`.  We think that the fact
Ralf Jung's avatar
Ralf Jung committed
31
  that both behaviors are coupled together is a
32 33 34
  [bug in Coq](https://github.com/coq/coq/issues/6030).
* The behavior of `Program` is tweaked: `Unset Transparent Obligations`,
  `Obligation Tactic := idtac`, `Add Search Blacklist "_obligation_"`.  See
Ralf Jung's avatar
Ralf Jung committed
35
  [`base.v`](theories/base.v) for further details.
36

Robbert Krebbers's avatar
Robbert Krebbers committed
37 38 39 40
## Prerequisites

This version is known to compile with:

41
 - Coq version 8.6.0 / 8.6.1 / 8.7.0 / 8.7.1 / 8.7.2
Robbert Krebbers's avatar
Robbert Krebbers committed
42

Ralf Jung's avatar
Ralf Jung committed
43 44
## Installing via opam

Ralf Jung's avatar
Ralf Jung committed
45 46
To obtain the latest stable release via opam (1.2.2 or newer), you have to add
the Coq opam repository:
Ralf Jung's avatar
Ralf Jung committed
47

Ralf Jung's avatar
Ralf Jung committed
48
    opam repo add coq-released https://coq.inria.fr/opam/released
Ralf Jung's avatar
Ralf Jung committed
49 50 51

Then you can do `opam install coq-stdpp`.

Ralf Jung's avatar
Ralf Jung committed
52 53 54 55
To obtain a development version, add the Iris opam repository:

    opam repo add iris-dev https://gitlab.mpi-sws.org/FP/opam-dev.git

Ralf Jung's avatar
Ralf Jung committed
56
## Building from source
Robbert Krebbers's avatar
Robbert Krebbers committed
57

Ralf Jung's avatar
Ralf Jung committed
58 59
Run `make -jN` in this directory to build the library, where `N` is the number
of your CPU cores.  Then run `make install` to install the library.