Skip to content

Commit 873667f

Browse files
committed
hack for coq.term->gref
1 parent ce0707b commit 873667f

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
@@ -260,6 +260,16 @@ term->cs-pattern (sort U) (cs-sort U).
260260
term->cs-pattern T (cs-gref GR) :- coq.term->gref T GR.
261261
term->cs-pattern T _ :- coq.error T "HB database: is not a valid canonical key".
262262

263+
%hack/missing API
264+
:before "stop:begin"
265+
coq.term->gref (app [primitive (proj N J),T|_]) GR :- !, std.do! [
266+
coq.typecheck T Ty ok,
267+
coq.term->gref Ty (indt I),
268+
coq.env.projections I Ps,
269+
coq.env.primitive-projections I PPs,
270+
std.map2-filter Ps PPs (x\y\gr\sigma c\x = some c, y = some (pr N J), gr = const c) [GR],
271+
].
272+
263273
pred cs-pattern->name i:cs-pattern, o:string.
264274
cs-pattern->name cs-prod "prod".
265275
cs-pattern->name (cs-sort _) "sort".

0 commit comments

Comments
 (0)