Something went wrong. Try again.
forked from coq/coq
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138(************************************************************************)(* * The Rocq Prover / The Rocq Development Team *)(* v * Copyright INRIA, CNRS and contributors *)(* <O___,, * (see version control and CREDITS file for authors & dates) *)(* \VV/ **************************************************************)(* // * This file is distributed under the terms of the *)(* * GNU Lesser General Public License Version 2.1 *)(* * (see LICENSE file for the text of the license) *)(************************************************************************)
open Namesopen Minimlopen Table
(*s Utility functions over ML types with meta. *)
val reset_meta_count : unit -> unitval new_meta : 'a -> ml_type
val type_subst_list : ml_type list -> ml_type -> ml_typeval type_subst_vect : ml_type array -> ml_type -> ml_type
val instantiation : ml_schema -> ml_type
val needs_magic : ml_type * ml_type -> boolval put_magic_if : bool -> ml_ast -> ml_astval put_magic : ml_type * ml_type -> ml_ast -> ml_ast
val generalizable : ml_ast -> bool
(*s ML type environment. *)
module Mlenv : sig type t val empty : t
(* get the n-th more recently entered schema and instantiate it. *) val get : t -> int -> ml_type
(* Adding a type in an environment, after generalizing free meta *) val push_gen : t -> ml_type -> t
(* Adding a type with no [Tvar] *) val push_type : t -> ml_type -> t
(* Adding a type with no [Tvar] nor [Tmeta] *) val push_std_type : t -> ml_type -> tend
(*s Utility functions over ML types without meta *)
val type_mem_kn : MutInd.t -> ml_type -> bool
val type_maxvar : ml_type -> int
val type_decomp : ml_type -> ml_type list * ml_typeval type_recomp : ml_type list * ml_type -> ml_type
val var2var' : ml_type -> ml_type
type abbrev_map = global -> ml_type option
val type_expand : abbrev_map -> ml_type -> ml_typeval type_simpl : ml_type -> ml_typeval type_to_sign : abbrev_map -> ml_type -> signval type_to_signature : abbrev_map -> ml_type -> signatureval type_expunge : abbrev_map -> ml_type -> ml_typeval type_expunge_from_sign : abbrev_map -> signature -> ml_type -> ml_type
val eq_ml_type : ml_type -> ml_type -> boolval isTdummy : ml_type -> boolval isMLdummy : ml_ast -> boolval isKill : sign -> bool
val case_expunge : signature -> ml_ast -> ml_ident list * ml_astval term_expunge : signature -> ml_ident list * ml_ast -> ml_ast
(*s Special identifiers. [dummy_name] is to be used for dead code and will be printed as [_] in concrete (Caml) code. *)
val anonymous_name : Id.tval dummy_name : Id.tval id_of_name : Name.t -> Id.tval id_of_mlid : ml_ident -> Id.tval tmp_id : ml_ident -> ml_ident
(*s [collect_lambda MLlam(id1,...MLlam(idn,t)...)] returns the list [idn;...;id1] and the term [t]. *)
val collect_lams : ml_ast -> ml_ident list * ml_astval collect_n_lams : int -> ml_ast -> ml_ident list * ml_astval remove_n_lams : int -> ml_ast -> ml_astval nb_lams : ml_ast -> intval named_lams : ml_ident list -> ml_ast -> ml_astval dummy_lams : ml_ast -> int -> ml_astval anonym_or_dummy_lams : ml_ast -> signature -> ml_ast
val eta_args_sign : int -> signature -> ml_ast list
(*s Utility functions over ML terms. *)
val mlapp : ml_ast -> ml_ast list -> ml_astval ast_map : (ml_ast -> ml_ast) -> ml_ast -> ml_astval ast_map_lift : (int -> ml_ast -> ml_ast) -> int -> ml_ast -> ml_astval ast_iter : (ml_ast -> unit) -> ml_ast -> unitval ast_occurs : int -> ml_ast -> boolval ast_occurs_itvl : int -> int -> ml_ast -> boolval ast_lift : int -> ml_ast -> ml_astval ast_pop : ml_ast -> ml_astval ast_subst : ml_ast -> ml_ast -> ml_ast
val ast_glob_subst : ml_ast Refmap'.t -> ml_ast -> ml_ast
val dump_unused_vars : ml_ast -> ml_ast
val normalize : ml_ast -> ml_astval optimize_fix : ml_ast -> ml_astval inline : Table.t -> global -> ml_ast -> bool
val is_basic_pattern : ml_pattern -> boolval has_deep_pattern : ml_branch array -> boolval is_regular_match : ml_branch array -> bool
exception Impossible
(* Classification of signatures *)
type sign_kind = | EmptySig | NonLogicalSig (* at least a [Keep] *) | SafeLogicalSig (* only [Kill Ktype] *) | UnsafeLogicalSig (* No [Keep], not all [Kill Ktype] *)
val sign_kind : signature -> sign_kind
val sign_no_final_keeps : signature -> signature