Skip to content

Commit

Permalink
Merge pull request #1 from FissoreD/path-stdlib
Browse files Browse the repository at this point in the history
[TC] prefix of pred name for tc of Classes from Coq/Stdpp...
  • Loading branch information
proux01 authored Jul 15, 2024
2 parents 34b3bad + 0218d61 commit f2f9051
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
3 changes: 2 additions & 1 deletion apps/tc/elpi/tc_aux.elpi
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ namespace tc {
if (tc.is-option-active tc.oTC-clauseNameShortName)
(Path = "")
(coq.gref->path Gr [Hd | Tl],
std.fold Tl Hd (x\acc\r\ r is acc ^ "." ^ x) Path',
if (Hd = "Coq" ; Hd = "Stdlib") (Hd' = "") (Hd' = Hd),
std.fold Tl Hd' (x\acc\r\ r is acc ^ "." ^ x) Path',
Path is Path' ^ ".tc-"),
% CAVEAT : Non-ascii caractars can't be part of a pred
% name, we replace ö with o
Expand Down
19 changes: 5 additions & 14 deletions apps/tc/tests/bigTest.v
Original file line number Diff line number Diff line change
Expand Up @@ -882,23 +882,14 @@ instances *)
Section prod_setoid.
Context `{Equiv A, Equiv B}.
Elpi Accumulate TC.Solver lp:{{
/* uncomment when requiring Coq >= 8.21
shorten tc-Stdlib.Classes.RelationClasses.{tc-Equivalence}. */
/* remove below definition when requiring Coq >= 8.21 */
shorten tc-.Classes.RelationClasses.{tc-Equivalence}.
:after "lastHook"
tc-Coq.Classes.RelationClasses.tc-Equivalence A RA R :-
tc-Equivalence A RA R :-
RA = {{@equiv _ (@prod_equiv _ _ _ _)}},
RA' = {{@prod_relation _ _ _ _}},
coq.unify-eq RA RA' ok,
% coq.say A RA,
tc-Coq.Classes.RelationClasses.tc-Equivalence A RA' R.
:after "lastHook"
tc-Stdlib.Classes.RelationClasses.tc-Equivalence A RA R :-
RA = {{@equiv _ (@prod_equiv _ _ _ _)}},
RA' = {{@prod_relation _ _ _ _}},
coq.unify-eq RA RA' ok,
% coq.say A RA,
tc-Stdlib.Classes.RelationClasses.tc-Equivalence A RA' R.
tc-Equivalence A RA' R.
}}.
(* Elpi Typecheck TC.Solver. *)

Expand All @@ -919,7 +910,7 @@ Section prod_setoid.
std.map L1 remove_equiv_prod_equiv L2.
remove_equiv_prod_equiv A A.

shorten tc-Coq.Classes.Morphisms.{tc-Proper}.
shorten tc-.Classes.Morphisms.{tc-Proper}.

:after "lastHook"
tc-Proper A B C R :-
Expand Down Expand Up @@ -1052,7 +1043,7 @@ Elpi Accumulate TC.Solver lp:{{
std.map L1 remove_equiv_sum_equiv L2.
remove_equiv_sum_equiv A A.

shorten tc-Coq.Classes.Morphisms.{tc-Proper}.
shorten tc-.Classes.Morphisms.{tc-Proper}.
:after "lastHook"
tc-Proper A B C R :-
B = {{ @respectful _ _ _ _ }},
Expand Down

0 comments on commit f2f9051

Please sign in to comment.