aboutsummaryrefslogtreecommitdiffhomepage
path: root/checker
diff options
context:
space:
mode:
authorGravatar letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7>2013-10-24 21:29:41 +0000
committerGravatar letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7>2013-10-24 21:29:41 +0000
commit6da011a8677676462b24940a6171fb22615c3fbb (patch)
tree0df385cc8b8d72b3465d7745d2b97283245c7ed5 /checker
parent133a2143413a723d1d4e3dead5ffa8458f61afa8 (diff)
More monomorphic List.mem + List.assoc + ...
To reduce the amount of syntactic noise, we now provide a few inner modules Int.List, Id.List, String.List, Sorts.List which contain some monomorphic (or semi-monomorphic) functions such as mem, assoc, ... NB: for Int.List.mem and co we reuse List.memq and so on. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@16936 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'checker')
-rw-r--r--checker/check.ml2
-rw-r--r--checker/closure.ml2
-rw-r--r--checker/indtypes.ml3
-rw-r--r--checker/term.ml2
-rw-r--r--checker/term.mli1
5 files changed, 7 insertions, 3 deletions
diff --git a/checker/check.ml b/checker/check.ml
index f1fe3b8c5..366eb3695 100644
--- a/checker/check.ml
+++ b/checker/check.ml
@@ -339,7 +339,7 @@ let rec intern_library seen (dir, f) needed =
try let _ = find_library dir in needed
with Not_found ->
(* Look if already listed and consequently its dependencies too *)
- if List.mem_assoc dir needed then needed
+ if List.mem_assoc_f DirPath.equal dir needed then needed
else
(* [dir] is an absolute name which matches [f] which must be in loadpath *)
let m = intern_from_file (dir,f) in
diff --git a/checker/closure.ml b/checker/closure.ml
index 4500d371c..6744269ec 100644
--- a/checker/closure.ml
+++ b/checker/closure.ml
@@ -180,7 +180,7 @@ let ref_value_cache info ref =
let body =
match ref with
| RelKey n ->
- let (s,l) = info.i_rels in lift n (List.assoc_f Int.equal (s-n) l)
+ let (s,l) = info.i_rels in lift n (Int.List.assoc (s-n) l)
| VarKey id -> raise Not_found
| ConstKey cst -> constant_value info.i_env cst
in
diff --git a/checker/indtypes.ml b/checker/indtypes.ml
index 539a36331..9f0f5844b 100644
--- a/checker/indtypes.ml
+++ b/checker/indtypes.ml
@@ -254,7 +254,8 @@ let typecheck_one_inductive env params mib mip =
(* mind_kelim: checked by positivity criterion ? *)
let sorts =
compute_elim_sorts env params mib mip.mind_arity mip.mind_nf_lc in
- if List.exists (fun s -> not (List.mem s sorts)) mip.mind_kelim then
+ let reject_sort s = not (List.mem_f family_equal s sorts) in
+ if List.exists reject_sort mip.mind_kelim then
failwith "elimination not allowed";
(* mind_recargs: checked by positivity criterion *)
()
diff --git a/checker/term.ml b/checker/term.ml
index 371889436..ea81f5dab 100644
--- a/checker/term.ml
+++ b/checker/term.ml
@@ -23,6 +23,8 @@ let family_of_sort = function
| Prop Pos -> InSet
| Type _ -> InType
+let family_equal = (==)
+
(********************************************************************)
(* Constructions as implemented *)
(********************************************************************)
diff --git a/checker/term.mli b/checker/term.mli
index 68b408617..f75341b9d 100644
--- a/checker/term.mli
+++ b/checker/term.mli
@@ -2,6 +2,7 @@ open Names
open Cic
val family_of_sort : sorts -> sorts_family
+val family_equal : sorts_family -> sorts_family -> bool
val strip_outer_cast : constr -> constr
val collapse_appl : constr -> constr