aboutsummaryrefslogtreecommitdiff
path: root/library
diff options
context:
space:
mode:
authorMatthieu Sozeau2014-09-27 16:08:02 +0200
committerMatthieu Sozeau2014-09-27 20:41:04 +0200
commit84544396cbbf34848be2240acf181b4d5f1f42d2 (patch)
tree72d398f334bdc7b1c6a0ee333a05940c34780f12 /library
parent0efba04058ba28889c83553224309be216873298 (diff)
Add a boolean to indicate the unfolding state of a primitive projection,
so as to reproduce correctly the reduction behavior of existing projections, i.e. delta + iota. Make [projection] an abstract datatype in Names.ml, most of the patch is about using that abstraction. Fix unification.ml which tried canonical projections too early in presence of primitive projections.
Diffstat (limited to 'library')
-rw-r--r--library/heads.ml2
-rw-r--r--library/universes.ml4
2 files changed, 3 insertions, 3 deletions
diff --git a/library/heads.ml b/library/heads.ml
index 31908816b1..8b28f05003 100644
--- a/library/heads.ml
+++ b/library/heads.ml
@@ -84,7 +84,7 @@ let kind_of_head env t =
| Meta _ | Evar _ -> NotImmediatelyComputableHead
| App (c,al) -> aux k (Array.to_list al @ l) c b
| Proj (p,c) ->
- (try on_subterm k (c :: l) b (constant_head p)
+ (try on_subterm k (c :: l) b (constant_head (Projection.constant p))
with Not_found -> assert false)
| Case (_,_,c,_) -> aux k [] c true
diff --git a/library/universes.ml b/library/universes.ml
index 7fe4258c2d..cc0153311b 100644
--- a/library/universes.ml
+++ b/library/universes.ml
@@ -220,7 +220,7 @@ let compare_head_gen_proj env equ eqs eqc' m n =
| Proj (p, c), App (f, args)
| App (f, args), Proj (p, c) ->
(match kind_of_term f with
- | Const (p', u) when eq_constant p p' ->
+ | Const (p', u) when eq_constant (Projection.constant p) p' ->
let pb = Environ.lookup_projection p env in
let npars = pb.Declarations.proj_npars in
if Array.length args == npars + 1 then
@@ -429,7 +429,7 @@ let global_app_of_constr c =
| Ind (i, u) -> (IndRef i, u), None
| Construct (c, u) -> (ConstructRef c, u), None
| Var id -> (VarRef id, Instance.empty), None
- | Proj (p, c) -> (ConstRef p, Instance.empty), Some c
+ | Proj (p, c) -> (ConstRef (Projection.constant p), Instance.empty), Some c
| _ -> raise Not_found
open Declarations