aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsoubiran2010-01-06 10:24:41 +0000
committersoubiran2010-01-06 10:24:41 +0000
commit0c260ba25423ec1c142296f19c3009fa0702819a (patch)
treec5b784ce16fb76bdb26c89e71ce58d363f70b292
parent82791d73beaaeee5eab1fec317c689deb29f0a49 (diff)
Patch on subtyping check of opaque constants.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12631 85f007b7-540e-0410-9357-904b9bb8a0f7
-rw-r--r--kernel/subtyping.ml11
-rw-r--r--theories/Numbers/Natural/Abstract/NProperties.v2
2 files changed, 9 insertions, 4 deletions
diff --git a/kernel/subtyping.ml b/kernel/subtyping.ml
index 41f4c640ce..2a5f35f1a4 100644
--- a/kernel/subtyping.ml
+++ b/kernel/subtyping.ml
@@ -254,6 +254,8 @@ let check_constant cst env mp1 l info1 cb2 spec2 subst1 subst2 =
let con = make_con mp1 empty_dirpath l in
let cst =
if cb2.const_opaque then
+ (* In this case we compare opaque definitions, we need to bypass
+ the opacity and do a delta step*)
match cb2.const_body with
| None -> cst
| Some lc2 ->
@@ -262,8 +264,11 @@ let check_constant cst env mp1 l info1 cb2 spec2 subst1 subst2 =
| Some lc1 ->
let c = Declarations.force lc1 in
begin
- match (kind_of_term c) with
- Const n ->
+ match (kind_of_term c),(kind_of_term c2) with
+ Const n1,Const n2 when (eq_constant n1 n2) -> c
+ (* c1 may have been strenghtened
+ we need to unfold it*)
+ | Const n,_ ->
let cb = subst_const_body subst1
(lookup_constant n env) in
(match cb.const_opaque,
@@ -271,7 +276,7 @@ let check_constant cst env mp1 l info1 cb2 spec2 subst1 subst2 =
| true, Some lc1 ->
Declarations.force lc1
| _,_ -> c)
- | _ -> c
+ | _ ,_-> c
end
| None -> mkConst con
in
diff --git a/theories/Numbers/Natural/Abstract/NProperties.v b/theories/Numbers/Natural/Abstract/NProperties.v
index f59d5b1e76..2baed54cfe 100644
--- a/theories/Numbers/Natural/Abstract/NProperties.v
+++ b/theories/Numbers/Natural/Abstract/NProperties.v
@@ -17,6 +17,6 @@ Require Export NAxioms NSub.
Module Type NPropSig := NSubPropFunct.
-Module NPropFunct (N:NAxiomsSig). (* <: NPropSig N. BUG !! *)
+Module NPropFunct (N:NAxiomsSig) <: NPropSig N.
Include Type NPropSig N.
End NPropFunct.