Skip to content

Commit 9e7231b

Browse files
committed
hack for coq.term->gref
1 parent 0227e34 commit 9e7231b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

HB/common/stdpp.elpi

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,16 @@ term->cs-pattern T _ :- coq.error T "HB database: is not a valid canonical key".
292292
% this one is in utils, maybe cs-pattern->name is not stdpp material
293293
type gref->modname-label gref -> int -> string -> string -> prop.
294294

295+
%hack/missing API
296+
:before "stop:begin"
297+
coq.term->gref (app [primitive (proj N J),T|_]) GR :- !, std.do! [
298+
coq.typecheck T Ty ok,
299+
coq.term->gref Ty (indt I),
300+
coq.env.projections I Ps,
301+
coq.env.primitive-projections I PPs,
302+
std.map2-filter Ps PPs (x\y\gr\sigma c\x = some c, y = some (pr N J), gr = const c) [GR],
303+
].
304+
295305
pred cs-pattern->name i:cs-pattern, o:string.
296306
cs-pattern->name cs-prod "prod".
297307
cs-pattern->name (cs-sort _) "sort".

0 commit comments

Comments
 (0)