@@ -28,7 +28,7 @@ namespace tc {
2828 tc.get-full-path Inst ClauseName,
2929 Locality => (
3030 tc.add-tc-db ClauseName Grafting Clause,
31- tc.add-tc-db _ Grafting (tc.instance SectionPath Inst TC)).
31+ tc.add-tc-db _ Grafting (tc.instance SectionPath Inst TC Locality )).
3232 add-inst.aux Inst _ _ _ :-
3333 @global! => tc.add-tc-db _ _ (tc.banned Inst),
3434 coq.error "Not-added" "TC_solver" "[TC] Not yet able to compile" Inst "...".
@@ -51,7 +51,7 @@ namespace tc {
5151 % TC.AddAllInstances or TC.AddInstances InstName
5252 if (is-local; has-context-deps Inst)
5353 (LocalityStr = "Local")
54- (LocalityStr = "Global "),
54+ (LocalityStr = "Export "),
5555 add-inst Inst TC LocalityStr Prio.
5656
5757 % [add-inst->db IgnoreClassDepL ForceAdd Inst] compiles and add the Inst to
@@ -61,7 +61,7 @@ namespace tc {
6161 add-inst->db _ tt Inst :- !, add-inst>db.aux Inst.
6262 add-inst->db _ _ Inst :-
6363 tc.banned Inst, !, (coq.warning "tc.banned-inst" "TC-warning" Inst "is tc.banned").
64- add-inst->db _ _ Inst :- tc.instance _ Inst _, !. % the instance has already been added
64+ add-inst->db _ _ Inst :- tc.instance _ Inst _ _ , !. % the instance has already been added
6565 add-inst->db IgnoreClassDepL _ Inst :-
6666 get-class-dependencies Inst Dep,
6767 std.exists Dep (std.mem IgnoreClassDepL), !,
@@ -85,11 +85,19 @@ namespace tc {
8585 (coq.warning "not-inst-nor-tc" "TC-warning" GR "is neither a TC nor a instance")
8686 ).
8787
88+ pred build-args i:term, o:list term.
89+ build-args (prod _ _ Bo) [{{0}} | TL] :- !, build-args (Bo _) TL.
90+ build-args _ [{{0}}].
91+
8892 % [remove-inst GR] remove an instance from the DB by replacing it with `dummy`
8993 pred remove-inst i:gref.
9094 remove-inst InstGR :-
9195 tc.get-full-path InstGR ClauseName,
92- tc.remove-clause ClauseName.
96+ tc.instance _ InstGR ClassGR Locality,
97+ tc.gref->pred-name ClassGR PredName,
98+ coq.env.typeof ClassGR ClassTy,
99+ coq.elpi.predicate PredName {build-args ClassTy} Clause,
100+ tc.remove-clause ClauseName Clause Locality.
93101
94102 pred is-in-path i:string, i:gref.
95103 is-in-path Path GR :-
0 commit comments