@@ -18,12 +18,14 @@ End X.
1818
1919Elpi Query lp:{{
2020 coq.locate-module "X" MP,
21- coq.env.module MP [
22- (indt Xi), (const _), (const _), (const _), (const _),
23- (const _),
24- (indt XYi), (const XYr), (const _), (const _), (const _),
25- (const _)
26- ],
21+ coq.env.module MP L,
22+ std.assert! (L = [
23+ gref (indt Xi), gref (const _), gref (const _), gref (const _), gref (const _),
24+ gref (const _),
25+ submodule _ [
26+ gref (indt XYi), gref (const XYr), gref (const _), gref (const _), gref (const _),
27+ gref (const _)]
28+ ]) "bad module",
2729 coq.say {coq.gref->string (indt Xi)},
2830 rex_match "\\(Top.\\|.*test_API_module\\)\\.X\\.i$" {coq.gref->string (indt Xi)},
2931 rex_match "\\(Top.\\|.*test_API_module\\)\\.X\\.Y\\.i$" {coq.gref->string (indt XYi)},
4345
4446Elpi Query lp:{{
4547 coq.locate-module "Y" MP,
46- coq.env.module MP [indt I, indt J, |_],
48+ coq.env.module MP [gref ( indt I), gref ( indt J) , |_],
4749 coq.gref->path (indt I) P,
4850 coq.gref->id (indt J) ID
4951}}.
@@ -120,3 +122,40 @@ Elpi Query lp:{{
120122
121123Print ITA.
122124
125+
126+ Module R.
127+ Module S.
128+ Definition x := 3.
129+ End S.
130+ Module Type P1.
131+ Parameter x : nat.
132+ End P1.
133+ Module Type P2.
134+ Parameter y : nat.
135+ End P2.
136+ Module F(A : P1)(B : P2).
137+ Definition z := A.x + B.y.
138+ End F.
139+ Module Type FT(A : P2)(B : P1).
140+ Definition z := A.y + B.x.
141+ End FT.
142+ Definition a := 1.
143+ End R.
144+
145+ Elpi Query lp:{{
146+ coq.locate-module "R" R,
147+ coq.locate-module "R.S" S,
148+ coq.locate-module-type "R.P1" P1,
149+ coq.locate-module-type "R.P2" P2,
150+ coq.locate-module "R.F" F,
151+ coq.locate-module-type "R.FT" FT,
152+ coq.env.module R L,
153+ std.assert! (L = [
154+ submodule S [gref (const _)],
155+ module-type P1,
156+ module-type P2,
157+ module-functor F [P1,P2],
158+ module-type-functor FT [P2,P1],
159+ gref (const _)
160+ ]) "bad module"
161+ }}.
0 commit comments