Skip to content

Commit 4ecff7b

Browse files
shilangyuKacperFKorbandhalilov
committed
Add README
Co-authored-by: Kacper Korban <kacper.f.korban@gmail.com> Co-authored-by: Dario Halilovic <dario.halilovic@epfl.ch>
1 parent 032fcf2 commit 4ecff7b

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# StrictOrderSolver
2+
3+
Complete solver for strict orders (transitive+irreflexive relations) for Rocq.
4+
5+
## Usage
6+
7+
The solver works for any relation that implements the [`Transitive`](https://rocq-prover.org/doc/V9.1.0/corelib/Corelib.Classes.RelationClasses.html#Transitive) and [`Irreflexive`](https://rocq-prover.org/doc/V9.1.0/corelib/Corelib.Classes.RelationClasses.html#Irreflexive) classes. These are implicitly implemented if you instead implement the [`StrictOrder`](https://rocq-prover.org/doc/V9.1.0/corelib/Corelib.Classes.RelationClasses.html#StrictOrder) class.
8+
9+
To invoke the solver, use `strict_order rel`, where `rel` is your strict order relation.
10+
11+
The solver will close the goal in two cases:
12+
13+
1. If your goal is of the form `rel a b` and it is provable from your `rel c d` premises
14+
2. If your `rel c d` premises lead to a contradiction
15+
16+
See [Tests.v](./Tests.v) for example usages and supported use-cases.
17+
18+
```rocq
19+
From Ltac2 Require Import Ltac2.
20+
From StrictOrderSolver Require Import Solver.
21+
From Stdlib Require Import Classes.RelationClasses.
22+
23+
Axiom rel : nat -> nat -> Prop.
24+
Instance SO : StrictOrder rel. Admitted.
25+
26+
Goal forall a b c d e,
27+
rel a e -> rel a b -> rel c d -> rel b c -> rel a d.
28+
Proof.
29+
intros.
30+
strict_order rel.
31+
Qed.
32+
```
33+
34+
## Installation
35+
36+
1. Pin [opam](https://opam.ocaml.org/) dependency source
37+
38+
```sh
39+
opam pin add --no-action strict-order-solver.0.1.0 https://github.com/epfl-systemf/StrictOrderSolver.git
40+
```
41+
42+
2. Install as a dependency (or add `strict-order-solver` to your `dune-project`/`.opam` file with the `0.1.0` version selected)
43+
44+
```sh
45+
opam install strict-order-solver
46+
```
47+
48+
3. Add `StrictOrderSolver` to your Rocq theories (in dune, it is the `rocq.theory (theories)` stanza)

0 commit comments

Comments
 (0)