aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/context.ml9
-rw-r--r--kernel/context.mli4
2 files changed, 9 insertions, 4 deletions
diff --git a/kernel/context.ml b/kernel/context.ml
index 4e53b73a28..269bf21432 100644
--- a/kernel/context.ml
+++ b/kernel/context.ml
@@ -147,9 +147,6 @@ struct
| LocalAssum (na, ty) -> na, None, ty
| LocalDef (na, v, ty) -> na, Some v, ty
- let of_tuple = function
- | n, None, ty -> LocalAssum (n,ty)
- | n, Some v, ty -> LocalDef (n,v,ty)
end
(** Rel-context is represented as a list of declarations.
@@ -348,6 +345,12 @@ struct
let of_tuple = function
| id, None, ty -> LocalAssum (id, ty)
| id, Some v, ty -> LocalDef (id, v, ty)
+
+ let of_rel f = function
+ | Rel.Declaration.LocalAssum (na,t) ->
+ LocalAssum (f na, t)
+ | Rel.Declaration.LocalDef (na,v,t) ->
+ LocalDef (f na, v, t)
end
(** Named-context is represented as a list of declarations.
diff --git a/kernel/context.mli b/kernel/context.mli
index b5f3904d22..b8a7bf6a34 100644
--- a/kernel/context.mli
+++ b/kernel/context.mli
@@ -82,7 +82,6 @@ sig
val fold : (Constr.t -> 'a -> 'a) -> t -> 'a -> 'a
val to_tuple : t -> Name.t * Constr.t option * Constr.t
- val of_tuple : Name.t * Constr.t option * Constr.t -> t
end
(** Rel-context is represented as a list of declarations.
@@ -197,6 +196,9 @@ sig
val to_tuple : t -> Id.t * Constr.t option * Constr.t
val of_tuple : Id.t * Constr.t option * Constr.t -> t
+
+ (** Convert [Rel.Declaration.t] value to the corresponding [Named.Declaration.t] value. *)
+ val of_rel : (Name.t -> Id.t) -> Rel.Declaration.t -> t
end
(** Rel-context is represented as a list of declarations.