diff options
Diffstat (limited to 'library')
| -rw-r--r-- | library/coqlib.ml | 6 | ||||
| -rw-r--r-- | library/coqlib.mli | 8 | ||||
| -rw-r--r-- | library/global.ml | 1 | ||||
| -rw-r--r-- | library/global.mli | 1 | ||||
| -rw-r--r-- | library/lib.ml | 15 | ||||
| -rw-r--r-- | library/lib.mli | 2 |
6 files changed, 29 insertions, 4 deletions
diff --git a/library/coqlib.ml b/library/coqlib.ml index 36a9598f36..026b7aa316 100644 --- a/library/coqlib.ml +++ b/library/coqlib.ml @@ -349,6 +349,9 @@ let coq_iff = lazy_init_reference ["Logic"] "iff" let coq_iff_left_proj = lazy_init_reference ["Logic"] "proj1" let coq_iff_right_proj = lazy_init_reference ["Logic"] "proj2" +let coq_prod = lazy_init_reference ["Datatypes"] "prod" +let coq_pair = lazy_init_reference ["Datatypes"] "pair" + (* Runtime part *) let build_coq_True () = Lazy.force coq_True let build_coq_I () = Lazy.force coq_I @@ -364,6 +367,9 @@ let build_coq_iff () = Lazy.force coq_iff let build_coq_iff_left_proj () = Lazy.force coq_iff_left_proj let build_coq_iff_right_proj () = Lazy.force coq_iff_right_proj +let build_coq_prod () = Lazy.force coq_prod +let build_coq_pair () = Lazy.force coq_pair + (* The following is less readable but does not depend on parsing *) let coq_eq_ref = lazy (init_reference ["Logic"] "eq") diff --git a/library/coqlib.mli b/library/coqlib.mli index b4bd1b0e06..8844684957 100644 --- a/library/coqlib.mli +++ b/library/coqlib.mli @@ -101,7 +101,7 @@ val glob_jmeq : GlobRef.t at compile time. Therefore, we can only provide methods to build them at runtime. This is the purpose of the [constr delayed] and [constr_pattern delayed] types. Objects of this time needs to be - forced with [delayed_force] to get the actual constr or pattern + forced with [delayed_force] to get the actual constr or pattern at runtime. *) type coq_bool_data = { @@ -167,7 +167,7 @@ val build_coq_inversion_eq_true_data : coq_inversion_data delayed val build_coq_sumbool : GlobRef.t delayed (** {6 ... } *) -(** Connectives +(** Connectives The False proposition *) val build_coq_False : GlobRef.t delayed @@ -186,6 +186,10 @@ val build_coq_iff : GlobRef.t delayed val build_coq_iff_left_proj : GlobRef.t delayed val build_coq_iff_right_proj : GlobRef.t delayed +(** Pairs *) +val build_coq_prod : GlobRef.t delayed +val build_coq_pair : GlobRef.t delayed + (** Disjunction *) val build_coq_or : GlobRef.t delayed diff --git a/library/global.ml b/library/global.ml index 5872126a12..e872d081d6 100644 --- a/library/global.ml +++ b/library/global.ml @@ -86,7 +86,6 @@ let push_named_assum a = globalize0 (Safe_typing.push_named_assum a) let push_named_def d = globalize0 (Safe_typing.push_named_def d) let add_constraints c = globalize0 (Safe_typing.add_constraints c) let push_context_set b c = globalize0 (Safe_typing.push_context_set b c) -let push_context b c = globalize0 (Safe_typing.push_context b c) let set_engagement c = globalize0 (Safe_typing.set_engagement c) let set_typing_flags c = globalize0 (Safe_typing.set_typing_flags c) diff --git a/library/global.mli b/library/global.mli index 6aeae9fd02..5205968c7b 100644 --- a/library/global.mli +++ b/library/global.mli @@ -49,7 +49,6 @@ val add_mind : (** Extra universe constraints *) val add_constraints : Univ.Constraint.t -> unit -val push_context : bool -> Univ.UContext.t -> unit val push_context_set : bool -> Univ.ContextSet.t -> unit (** Non-interactive modules and module types *) diff --git a/library/lib.ml b/library/lib.ml index 8ebe44890c..07026a9c2a 100644 --- a/library/lib.ml +++ b/library/lib.ml @@ -440,6 +440,21 @@ let add_section_context ctx = check_same_poly true vars; sectab := (Context ctx :: vars,repl,abs)::sl +exception PolyFound of bool (* make this a let exception once possible *) +let is_polymorphic_univ u = + try + let open Univ in + List.iter (fun (vars,_,_) -> + List.iter (function + | Variable (_,_,poly,(univs,_)) -> + if LSet.mem u univs then raise (PolyFound poly) + | Context (univs,_) -> + if LSet.mem u univs then raise (PolyFound true) + ) vars + ) !sectab; + false + with PolyFound b -> b + let extract_hyps (secs,ohyps) = let rec aux = function | (Variable (id,impl,poly,ctx)::idl, decl::hyps) when Names.Id.equal id (NamedDecl.get_id decl) -> diff --git a/library/lib.mli b/library/lib.mli index 9933b762ba..a7d21060e9 100644 --- a/library/lib.mli +++ b/library/lib.mli @@ -183,6 +183,8 @@ val add_section_kn : Decl_kinds.polymorphic -> MutInd.t -> Constr.named_context -> unit val replacement_context : unit -> Opaqueproof.work_list +val is_polymorphic_univ : Univ.Level.t -> bool + (** {6 Discharge: decrease the section level if in the current section } *) val discharge_kn : MutInd.t -> MutInd.t |
