| 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 | (* This file implements proof block detection for: |
| 12 | - blocks delimited by { and } |
| 13 | - bullets with indentation |
| 14 | - par: terminator |
| 15 | |
| 16 | It exports utility functions to ease the development of other proof block |
| 17 | detection code. |
| 18 | *) |
| 19 | |
| 20 | (** A goal is simple if it nor depends on nor impacts on any other goal. |
| 21 | This function is used to detect, dynamically, if a proof block leaks, |
| 22 | i.e. if skipping it could impact other goals (like not instantiating their |
| 23 | type). `Simple carries the list of focused goals. |
| 24 | *) |
| 25 | val simple_goal : Evd.evar_map -> Evar.t -> Evar.t list -> bool |
| 26 | val is_focused_goal_simple : doc:Stm.doc -> Stateid.t -> [ `Simple of Evar.t list | `Not ] |
| 27 | |
| 28 | type 'a until = [ `Stop | `Found of Stm.static_block_declaration | `Cont of 'a ] |
| 29 | |
| 30 | (* Simpler function to crawl the document backward to detect the block. |
| 31 | * ?init is the entry point of the document view if not given *) |
| 32 | val crawl : |
| 33 | Stm.document_view -> ?init:Stm.document_node option -> |
| 34 | ('a -> Stm.document_node -> 'a until) -> 'a -> |
| 35 | Stm.static_block_declaration option |
| 36 | |
| 37 | (* Dummy value for static_block_declaration when no real value is needed *) |
| 38 | val unit_val : Stm.DynBlockData.t |
| 39 | |
| 40 | (* Bullets *) |
| 41 | val of_bullet_val : Proof_bullet.t -> Stm.DynBlockData.t |
| 42 | val to_bullet_val : Stm.DynBlockData.t -> Proof_bullet.t |
| 43 |