@@ -41,43 +41,18 @@ pred param i:aterm, i:aterm, o:term, o:term.
4141func param.store aterm -> aterm, term, term.
4242
4343% used in order not to typecheck+annotate twice the same term
44- pred fresh-type.
4544
4645% ==================================================================================================
4746
4847% TrocqConv + TrocqConst
49- param (aglobal GR as Tm) AT' Tm' GrefR :- !,
48+ param Tm AT' Tm' GrefR :- aterm.util.global Tm GR, !, std.do! [
5049 logging.debug (coq.say "[param] Rule const :" Tm "@" AT'),
51- if (fresh-type) (
52- % T' already comes from a call to annot.typecheck in the case for app
53- % subtyping will be handled there
54- % (we do not want to annot.typecheck several times a same constant, because it creates
55- % fresh class variables twice, which would split the information)
56- cstr.dep-gref GR AT' Tm' GRR,
57- GrefR = pglobal GRR _
58- ) (
59- std.do![
60- annot.typecheck (aglobal GR) AT,
61- annot.sub-type AT AT',
62- cstr.dep-gref GR AT Tm' GRR,
63- weaken AT AT' {aterm->term Tm} Tm' (pglobal GRR _) GrefR,
64- ]
65- ),
66- logging.debug (coq.say "[param] Out rule const :" Tm' "∵" GrefR).
67-
68- % universe-polymorphic case
69- param (apglobal GR UI as Tm) AT' Tm' GrefR :- !,
70- logging.debug (coq.say "[param] Rule pconst :" Tm "@" AT'),
71- if (fresh-type) (
72- cstr.dep-gref GR AT' Tm' GRR,
73- GrefR = pglobal GRR UI
74- ) (
75- annot.typecheck (apglobal GR UI) AT,
76- annot.sub-type AT AT',
77- cstr.dep-gref GR AT Tm' GRR,
78- weaken AT AT' {aterm->term Tm} Tm' (pglobal GRR UI) GrefR
79- ),
80- logging.debug (coq.say "[param] Out rule pconst :" Tm' "∵" GrefR).
50+ annot.typecheck Tm AT,
51+ annot.sub-type AT AT',
52+ cstr.dep-gref GR AT Tm' GRR,
53+ weaken AT AT' {aterm->term Tm} Tm' (pglobal GRR _) GrefR, %TODO We should replace with a coq.env.global here
54+ logging.debug (coq.say "[param] Out rule const :" Tm' "∵" GrefR)
55+ ].
8156
8257% TrocqConv + TrocqVar
8358param X T2 X' Witness :- name X, !,
@@ -162,7 +137,7 @@ param
162137param (aapp [F|Xs] as T) B (app [F'|Xs'] as T') Witness :- !, std.do! [
163138 logging.debug (coq.say "[param] Rule app :" T "@" B),
164139 annot.typecheck F TF,
165- fresh-type => param F TF F' FR,
140+ param F TF F' FR,
166141 param.args TF B Xs Xs' XsR B0,
167142 coq.mk-app FR XsR AppR,
168143 weaken B0 B {aterm->term T} T' AppR Witness,
0 commit comments