| 1 | (************************************************************************) |
| 2 | (* * The Rocq Prover / The Rocq Development Team *) |
| 3 | (* v * Copyright INRIA, CNRS and contributors *) |
| 4 | (* <O___,, * (see version control and CREDITS file for authors & dates) *) |
| 5 | (* \VV/ **************************************************************) |
| 6 | (* // * This file is distributed under the terms of the *) |
| 7 | (* * GNU Lesser General Public License Version 2.1 *) |
| 8 | (* * (see LICENSE file for the text of the license) *) |
| 9 | (************************************************************************) |
| 10 | |
| 11 | (**********************************************************) |
| 12 | (* *) |
| 13 | (* Bullets *) |
| 14 | (* *) |
| 15 | (**********************************************************) |
| 16 | |
| 17 | type t = |
| 18 | | Dash of int |
| 19 | | Star of int |
| 20 | | Plus of int |
| 21 | |
| 22 | (** A [behavior] is the data of a put function which |
| 23 | is called when a bullet prefixes a tactic, a suggest function |
| 24 | suggesting the right bullet to use on a given proof, together |
| 25 | with a name to identify the behavior. *) |
| 26 | type behavior = { |
| 27 | name : string; |
| 28 | put : Proof.t -> t -> Proof.t; |
| 29 | suggest: Proof.t -> Pp.t |
| 30 | } |
| 31 | |
| 32 | (** A registered behavior can then be accessed in Coq |
| 33 | through the command [Set Bullet Behavior "name"]. |
| 34 | |
| 35 | Two modes are registered originally: |
| 36 | * "Strict Subproofs": |
| 37 | - If this bullet follows another one of its kind, defocuses then focuses |
| 38 | (which fails if the focused subproof is not complete). |
| 39 | - If it is the first bullet of its kind, then focuses a new subproof. |
| 40 | * "None": bullets don't do anything *) |
| 41 | val register_behavior : behavior -> unit |
| 42 | |
| 43 | (** Handles focusing/defocusing with bullets: |
| 44 | *) |
| 45 | val put : Proof.t -> t -> Proof.t |
| 46 | val suggest : Proof.t -> Pp.t |