You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/tc/elpi/ho_precompile.elpi
+11-3Lines changed: 11 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -106,6 +106,7 @@ namespace tc {
106
106
precompile-aux _ (pglobal _ _ as C) A C A :- !.
107
107
precompile-aux _ (sort _ as C) A C A :- !.
108
108
precompile-aux _ (primitive _ as C) A C A :- !.
109
+
precompile-aux _ T A (tc.coercion T Scope) (s A) :- coq.safe-dest-app T HD _, tc.coercion-unify HD, !, free-var Scope.
109
110
precompile-aux _ (app [global (const C) | _] as T) A (tc.canonical-projection T Scope N) (s A) :- coq.env.projection? C N, !, free-var Scope.
110
111
precompile-aux _ (app [primitive (proj P _) | _] as T) A (tc.canonical-projection T Scope 0) (s A) :- coq.env.primitive-projection? P _, !, free-var Scope.
111
112
@@ -229,12 +230,20 @@ namespace tc {
229
230
precompile-aux (pglobal _ _ as C) A C A :- !.
230
231
precompile-aux (sort _ as C) A C A :- !.
231
232
precompile-aux (primitive _ as C) A C A :- !.
233
+
234
+
precompile-aux T A (tc.coercion T Scope) A :-
235
+
coq.safe-dest-app T HD _, tc.coercion-unify HD, !, names Scope.
236
+
precompile-aux (app [global (const C) | _] as T) A (tc.canonical-projection T Scope N) A :-
237
+
coq.env.projection? C N, !, names Scope.
238
+
precompile-aux (app [primitive (proj P _) | _] as T) A (tc.canonical-projection T Scope 0) A :-
239
+
coq.env.primitive-projection? P _, !, names Scope.
240
+
232
241
233
242
% Detect maybe-eta term
234
243
precompile-aux (fun Name Ty B as T) N (tc.maybe-eta-tm (fun Name Ty' B') Scope) M :-
235
244
maybe-eta T, !,
236
245
names Scope,
237
-
(pi x\ precompile-aux (B x) N (B' x) M'),
246
+
std.assert! (pi x\ precompile-aux (B x) N (B' x) (MM x), close-term-no-prune-fun MM Ty M') "[TC] should not fail1",
238
247
precompile-aux Ty M' Ty' M.
239
248
240
249
% Detect maybe-beta term
@@ -244,10 +253,9 @@ namespace tc {
244
253
names Scope1,
245
254
std.fold-map NPF N precompile-aux NPF1 M.
246
255
247
-
% In the goal there are
248
256
precompile-aux (prod Name Ty B) N (tc.prod-range (prod Name Ty' B') (r-ar z MaxAr)) P :- !,
249
257
count-prod Ty MaxAr,
250
-
std.assert! (pi x\ precompile-aux (B x) N (B' x) M) "[TC] should not fail",
258
+
std.assert! (pi x\ precompile-aux (B x) N (B' x) (MM x), close-term-no-prune-fun MM Ty M) "[TC] should not fail2",
0 commit comments