Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TC] prefix of pred name for tc of Classes from Coq/Stdpp... #1

Merged
merged 1 commit into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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),
proux01 marked this conversation as resolved.
Show resolved Hide resolved
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
Loading