Skip to content

Commit c141c91

Browse files
authored
Merge pull request #886 from Tragicus/indexing
Indexing in coercion and tc
2 parents 8495d43 + be4eb8e commit c141c91

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

apps/coercion/theories/coercion.v

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Elpi Db coercion.db lp:{{
1010
% - [Expected] is the type [V] should be coerced to
1111
% - [Res] is the result (of type [Expected])
1212
% Be careful not to trigger coercion as this may loop.
13+
:index(_ _ 10 10)
1314
pred coercion i:goal-ctx, i:term, i:term, i:term, o:term.
1415

1516
}}.

apps/tc/elpi/create_tc_predicate.elpi

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@ func add-class-gr search-mode, gref ->.
1717
add-class-gr _ ClassGR :- tc.class ClassGR _ _ _, !.
1818
add-class-gr SearchMode ClassGR :-
1919
std.assert! (coq.TC.class? ClassGR) "Only gref of type classes can be added as new predicates",
20-
tc.get-elpi-mode ClassGR EM SM,
20+
tc.get-elpi-mode ClassGR EM SM,
21+
if (std.forall EM (m\ sigma a s\ m = pr a s, a = out)) (true) (
22+
std.fold EM "" (m\s\r\ sigma a s'\ m = pr a s', if (a = in) (calc (s ^ " 10") r) (calc (s ^ " _") r)) Indexing),
2123
tc.gref->pred-name ClassGR PredName,
2224
get-class-locality Locality,
2325
Locality => (
24-
coq.elpi.add-predicate "tc.db" _ PredName EM,
26+
coq.elpi.add-predicate "tc.db" Indexing PredName EM,
2527
tc.add-tc-db _ _ (tc.class ClassGR PredName SearchMode SM)).
2628

2729
func add-class-str search-mode, string ->.

0 commit comments

Comments
 (0)