Skip to content

Commit 88ef8bb

Browse files
committed
add primitive proj LPCIC#792
1 parent 65929f7 commit 88ef8bb

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

apps/tc/elpi/ho_compile.elpi

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ namespace tc {
2323
decompile-term-aux (pglobal _ _ as T) L T' L :- !, copy T T', !.
2424
decompile-term-aux (sort _ as T) L T' L :- !, copy T T', !.
2525
decompile-term-aux (uvar as X) L X L :- !.
26+
decompile-term-aux (primitive _ as P) L P L :- !.
2627

2728
decompile-term-aux (tc.maybe-eta-tm T S) (pr [X|XS] L1) Y (pr XS' [NL | L2]) :- !,
2829
name Y X S,

apps/tc/elpi/ho_precompile.elpi

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ namespace tc {
142142
% precompile-aux IsP Ty A Ty1 A1, pi x\ is-name x => precompile-aux IsP (F x) A1 (F1 x) A2.
143143
% precompile-aux IsP (match T Rty B) A (match T1 Rty1 B1) A3 :- !,
144144
% precompile-aux IsP T A T1 A1, precompile-aux IsP Rty A1 Rty1 A2, std.fold-map B A2 (precompile-aux IsP) B1 A3.
145-
% precompile-aux _ (primitive _ as C) A C A :- !.
145+
precompile-aux _ (primitive _ as C) A C A :- !.
146146
% precompile-aux IsP (uvar M L as X) A W A1 :- var X, !, std.fold-map L A (precompile-aux IsP) L1 A1, coq.mk-app-uvar M L1 W.
147147
% % when used in CHR rules
148148
% precompile-aux IsP (uvar X L) A (uvar X L1) A1 :- std.fold-map L A (precompile-aux IsP) L1 A1.

apps/tc/tests/prim_proj.v

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
From elpi Require Import tc.
2+
3+
Set Primitive Projections.
4+
Record S := { sort :> Type }.
5+
Unset Primitive Projections.
6+
7+
Class C (s : Type) := {}.
8+
9+
Instance SC (s : S) : C s := Build_C s.

0 commit comments

Comments
 (0)