Skip to content

Commit

Permalink
golfing and doc in structures.ml*
Browse files Browse the repository at this point in the history
  • Loading branch information
Tragicus committed Mar 20, 2024
1 parent 81379a9 commit 1b8fb1d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 11 deletions.
4 changes: 0 additions & 4 deletions engine/evd.ml
Original file line number Diff line number Diff line change
Expand Up @@ -892,12 +892,8 @@ let mem d e = EvMap.mem e d.undf_evars || EvMap.mem e d.defn_evars

let undefined_map d = d.undf_evars

let undefined_evars d = EvMap.domain d.undf_evars

let defined_map d = d.defn_evars

let defined_evars d = EvMap.domain d.defn_evars

let drop_all_defined d = { d with defn_evars = EvMap.empty }

(* spiwack: not clear what folding over an evar_map, for now we shall
Expand Down
6 changes: 0 additions & 6 deletions engine/evd.mli
Original file line number Diff line number Diff line change
Expand Up @@ -276,15 +276,9 @@ val add_quconstraints : evar_map -> Sorts.QUConstraints.t -> evar_map
val undefined_map : evar_map -> undefined evar_info Evar.Map.t
(** Access the undefined evar mapping directly. *)

val undefined_evars : evar_map -> Evar.Set.t
(** Access the set of undefined evars. *)

val defined_map : evar_map -> defined evar_info Evar.Map.t
(** Access the defined evar mapping directly. *)

val defined_evars : evar_map -> Evar.Set.t
(** Access the set of defined evars. *)

val drop_all_defined : evar_map -> evar_map

val drop_new_defined : original:evar_map -> evar_map -> evar_map
Expand Down
3 changes: 2 additions & 1 deletion pretyping/structures.ml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ let is_projection cst = Cmap.mem cst !projection_table

let projection_number env cst =
let s = find_from_projection cst in
CList.index (Option.equal (Environ.QConstant.equal env)) (Some cst) (List.map (fun x -> x.proj_body) s.projections) - 1
CList.index0 (Option.equal (Environ.QConstant.equal env)) (Some cst)
(List.map (fun x -> x.proj_body) s.projections)

end

Expand Down
2 changes: 2 additions & 0 deletions pretyping/structures.mli
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ val projection_nparams : Names.Constant.t -> int
val is_projection : Names.Constant.t -> bool

val projection_number : Environ.env -> Names.Constant.t -> int
(** [projection_number env p] returns the position of the projection p in
the structure it corresponds to, counting from 0. *)

end

Expand Down

0 comments on commit 1b8fb1d

Please sign in to comment.