aboutsummaryrefslogtreecommitdiff
path: root/pretyping
diff options
context:
space:
mode:
authorppedrot2012-11-25 17:38:55 +0000
committerppedrot2012-11-25 17:38:55 +0000
commit1653654a0eba7ecca78e67b4db1f6fa031e7271f (patch)
treee5a914ecf08ebddc774216122d3910fb8ecee9b9 /pretyping
parent589b1edc7064c2d210cf4786a6e5ed32d8165117 (diff)
More equality functions
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@15998 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'pretyping')
-rw-r--r--pretyping/classops.ml8
-rw-r--r--pretyping/classops.mli3
-rw-r--r--pretyping/locusops.ml3
-rw-r--r--pretyping/locusops.mli4
4 files changed, 18 insertions, 0 deletions
diff --git a/pretyping/classops.ml b/pretyping/classops.ml
index 2f47074060..d8cfde590d 100644
--- a/pretyping/classops.ml
+++ b/pretyping/classops.ml
@@ -53,6 +53,14 @@ let coe_info_typ_equal c1 c2 =
c1.coe_is_identity == c2.coe_is_identity &&
Int.equal c1.coe_param c2.coe_param
+let cl_typ_eq t1 t2 = match t1, t2 with
+| CL_SORT, CL_SORT -> true
+| CL_FUN, CL_FUN -> true
+| CL_SECVAR v1, CL_SECVAR v2 -> id_eq v1 v2
+| CL_CONST c1, CL_CONST c2 -> eq_constant c1 c2
+| CL_IND i1, CL_IND i2 -> eq_ind i1 i2
+| _ -> false
+
type cl_index = int
type coe_index = coe_info_typ
diff --git a/pretyping/classops.mli b/pretyping/classops.mli
index 1cbacdfa64..82af9d4180 100644
--- a/pretyping/classops.mli
+++ b/pretyping/classops.mli
@@ -22,6 +22,9 @@ type cl_typ =
| CL_CONST of constant
| CL_IND of inductive
+(** Equality over [cl_typ] *)
+val cl_typ_eq : cl_typ -> cl_typ -> bool
+
val subst_cl_typ : substitution -> cl_typ -> cl_typ
(** This is the type of infos for declared classes *)
diff --git a/pretyping/locusops.ml b/pretyping/locusops.ml
index 161243587c..22f154795b 100644
--- a/pretyping/locusops.ml
+++ b/pretyping/locusops.ml
@@ -40,6 +40,9 @@ let nowhere = { onhyps=Some[]; concl_occs=NoOccurrences }
let onHyp h =
{ onhyps=Some[(AllOccurrences,h),InHyp]; concl_occs=NoOccurrences }
+let is_nowhere = function
+| { onhyps=Some[]; concl_occs=NoOccurrences } -> true
+| _ -> false
(** Clause conversion functions, parametrized by a hyp enumeration function *)
diff --git a/pretyping/locusops.mli b/pretyping/locusops.mli
index 15ab0c94b3..bd4df6edd6 100644
--- a/pretyping/locusops.mli
+++ b/pretyping/locusops.mli
@@ -28,6 +28,10 @@ val onConcl : 'a clause_expr
val nowhere : 'a clause_expr
val onHyp : 'a -> 'a clause_expr
+(** Tests *)
+
+val is_nowhere : 'a clause_expr -> bool
+
(** Clause conversion functions, parametrized by a hyp enumeration function *)
val simple_clause_of : (unit -> identifier list) -> clause -> simple_clause