| 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 | open Names |
| 12 | open Miniml |
| 13 | |
| 14 | (*s Functions upon ML modules. *) |
| 15 | |
| 16 | val struct_ast_search : (ml_ast -> bool) -> ml_structure -> bool |
| 17 | val struct_type_search : (ml_type -> bool) -> ml_structure -> bool |
| 18 | |
| 19 | type do_ref = global -> unit |
| 20 | |
| 21 | val type_iter_references : do_ref -> ml_type -> unit |
| 22 | val ast_iter_references : do_ref -> do_ref -> do_ref -> ml_ast -> unit |
| 23 | val decl_iter_references : do_ref -> do_ref -> do_ref -> ml_decl -> unit |
| 24 | val spec_iter_references : do_ref -> do_ref -> do_ref -> ml_spec -> unit |
| 25 | |
| 26 | val signature_of_structure : ml_structure -> ml_signature |
| 27 | |
| 28 | val mtyp_of_mexpr : ml_module_expr -> ml_module_type |
| 29 | |
| 30 | val msid_of_mt : ml_module_type -> ModPath.t |
| 31 | |
| 32 | val get_decl_in_structure : global -> ml_structure -> ml_decl |
| 33 | |
| 34 | (* Some transformations of ML terms. [optimize_struct] simplify |
| 35 | all beta redexes (when the argument does not occur, it is just |
| 36 | thrown away; when it occurs exactly once it is substituted; otherwise |
| 37 | a let-in redex is created for clarity) and iota redexes, plus some other |
| 38 | optimizations. The first argument is the list of objects we want to appear. |
| 39 | *) |
| 40 | |
| 41 | val optimize_struct : Common.State.t -> global list * ModPath.t list -> |
| 42 | ml_structure -> ml_structure |