Skip to content

Commit cc82797

Browse files
authored
Merge pull request #562 from math-comp/rename-class
avoid type name collision: class -> hbclass
2 parents 43b6e1a + 558b2a7 commit cc82797

File tree

9 files changed

+1272
-1272
lines changed

9 files changed

+1272
-1272
lines changed

.github/workflows/nix-action-coq-8.20.yml

Lines changed: 212 additions & 212 deletions
Large diffs are not rendered by default.

.github/workflows/nix-action-coq-9.0.yml

Lines changed: 352 additions & 352 deletions
Large diffs are not rendered by default.

.github/workflows/nix-action-coq-9.1.yml

Lines changed: 352 additions & 352 deletions
Large diffs are not rendered by default.

.github/workflows/nix-action-coq-master.yml

Lines changed: 334 additions & 334 deletions
Large diffs are not rendered by default.

.nix/coq-nix-toolbox.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"a1bfc972fc850d935b8a38c8d901c54299b8df41"
1+
"7af8a21e712b7665447bea5189ce3ff83fcfeac8"

HB/common/database.elpi

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ mixin-src_src (mixin-src _ _ S) S.
2323
func local-canonical-gref prop -> constant.
2424
local-canonical-gref (local-canonical C) C.
2525

26-
func class_name class -> classname.
26+
func class_name hbclass -> classname.
2727
class_name (class N _ _) N.
2828

29-
func class_structure class -> structure.
29+
func class_structure hbclass -> structure.
3030
class_structure (class _ S _) S.
3131

3232
func class-def_name prop -> classname.
@@ -38,7 +38,7 @@ mixin-class_class (mixin-class _ C) C.
3838
func mixin-class_mixin prop -> mixinname.
3939
mixin-class_mixin (mixin-class M _) M.
4040

41-
func classname->def classname -> class.
41+
func classname->def classname -> hbclass.
4242
classname->def CN (class CN S ML) :- class-def (class CN S ML), !.
4343

4444
func classname->mixins classname -> mixins.
@@ -70,7 +70,7 @@ extract-builder (builder-decl B) B.
7070
func leq-builder builder, builder ->.
7171
leq-builder (builder N _ _ _) (builder M _ _ _) :- N =< M.
7272

73-
func sub-class? class, class ->.
73+
func sub-class? hbclass, hbclass ->.
7474
sub-class? (class C1 _ ML1P) (class C2 _ ML2P) :-
7575
not (C1 = C2),
7676
list-w-params_list ML1P ML1,
@@ -187,7 +187,7 @@ toposort-classes In Out :- std.do! [
187187
std.gref.toposort ES In Out,
188188
].
189189

190-
func findall-classes -> list class.
190+
func findall-classes -> list hbclass.
191191
findall-classes CLSortedDef :- std.do! [
192192
std.findall (class-def C_) All,
193193
std.map All class-def_name CL,
@@ -204,7 +204,7 @@ findall-classes-for.unsorted [M|ML] CLAcc Out :- std.do! [
204204
findall-classes-for.unsorted ML {std.append CL CLAcc} Out
205205
].
206206

207-
func findall-classes-for list mixinname -> list class.
207+
func findall-classes-for list mixinname -> list hbclass.
208208
findall-classes-for ML CLSortedDef :- std.do! [
209209
findall-classes-for.unsorted ML [] CL,
210210
toposort-classes CL CLSorted,
@@ -252,7 +252,7 @@ findall-local-canonical CL :-
252252
%
253253
% [findall-newjoins C AllSuper] finds all C1 and C2 such that C is a (new) join for
254254
% them
255-
pred distinct-pairs-below i:class, i:list class, o:class, o:class.
255+
pred distinct-pairs-below i:hbclass, i:list hbclass, o:hbclass, o:hbclass.
256256
distinct-pairs-below CurrentClass AllSuper C1 C2 :-
257257
std.mem AllSuper C1, std.mem AllSuper C2,
258258
% no cut until here, since we don't know which C1 and C2 to pick
@@ -267,7 +267,7 @@ distinct-pairs-below CurrentClass AllSuper C1 C2 :-
267267
true, % no join, valid pair
268268
].
269269

270-
pred assert-building-bottom-up i:class, i:classname, i:classname, i:classname.
270+
pred assert-building-bottom-up i:hbclass, i:classname, i:classname, i:classname.
271271
assert-building-bottom-up CurrentClass C3n C1n C2n :-
272272
class-def (class C3n X Y),
273273
CurrentClass = class CC _ _,
@@ -284,10 +284,10 @@ assert-building-bottom-up CurrentClass C3n C1n C2n :-
284284
Msg2)
285285
true.
286286

287-
func distinct-pairs_pair prop -> pair class class.
287+
func distinct-pairs_pair prop -> pair hbclass hbclass.
288288
distinct-pairs_pair (distinct-pairs-below _ _ X Y) (pr X Y).
289289

290-
func findall-newjoins class, list class -> list (pair class class).
290+
func findall-newjoins hbclass, list hbclass -> list (pair hbclass hbclass).
291291
findall-newjoins CurrentClass AllSuper TodoJoins :-
292292
std.findall (distinct-pairs-below CurrentClass AllSuper C1_ C2_) JoinOf,
293293
std.map JoinOf distinct-pairs_pair TodoJoins.

HB/instance.elpi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ declare-const Name BodySkel TyWPSkel CFL CSL :- std.do! [
8888
].
8989

9090
% [not-subclass-of X C] holds if C does not inherit from X
91-
func not-subclass-of classname, class ->.
91+
func not-subclass-of classname, hbclass ->.
9292
not-subclass-of HasNoInstance (class C _ _) :- not(sub-class C HasNoInstance _ _).
9393

9494
% [declare-all T CL MCSTL] given a type T and a list of class definition
@@ -97,7 +97,7 @@ not-subclass-of HasNoInstance (class C _ _) :- not(sub-class C HasNoInstance _ _
9797
% rest. For each fulfilled class it declares a local constant inhabiting the
9898
% corresponding structure and declares it canonical.
9999
% Each mixin used in order to fulfill a class is returned together with its name.
100-
func declare-all term, list class -> list (pair id constant).
100+
func declare-all term, list hbclass -> list (pair id constant).
101101
declare-all _ [] [].
102102
declare-all T [class _ Struct _|Rest] L :- has-instance T Struct, !,
103103
declare-all T Rest L.
@@ -114,7 +114,7 @@ declare-all T [class HasNoInstance _ _|Rest] L :-
114114
% for generic types, we need first to instantiate them by giving them holes,
115115
% so they can be used to instantiate the classes
116116
:index (_ 2)
117-
func declare-all-on-type-constructor term, list class -> list (pair id constant).
117+
func declare-all-on-type-constructor term, list hbclass -> list (pair id constant).
118118
declare-all-on-type-constructor _ [] [].
119119
declare-all-on-type-constructor TK [class _ Struct _|Rest] L :- saturate-type-constructor TK T, has-instance T Struct, !,
120120
declare-all-on-type-constructor TK Rest L.
@@ -268,7 +268,7 @@ saturate-instances Filter :- std.do! [
268268
declare-all-on-type-constructor t Classes _),
269269
].
270270

271-
func no-instance-for cs-pattern, class ->.
271+
func no-instance-for cs-pattern, hbclass ->.
272272
no-instance-for K (class _ S _) :-
273273
get-structure-sort-projection S (global Proj),
274274
coq.CS.db-for Proj K [].

HB/structure.elpi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ mk-coe-structure-body StructureF StructureT TC Coercion SortProjection ClassProj
330330

331331
% [declare-coercion P1 P2 C1 C2] declares a structure and a class coercion
332332
% from C1 to C2 given P1 P2 the two projections from the structure of C1
333-
pred declare-coercion i:term, i:term, i:class, i:class.
333+
pred declare-coercion i:term, i:term, i:hbclass, i:hbclass.
334334
declare-coercion SortProjection ClassProjection
335335
(class FC StructureF FMLwP) (class TC StructureT TMLwP) :- std.do! [
336336

@@ -386,7 +386,7 @@ join-body N1 N2 S3 S2_Pack S1_sort S3_to_S1 S2_class S3_to_S2
386386
mk-app S2_Pack {std.append Holes2 [S1_sortS3Ps, S2_classS3Ps]} (Pack s)
387387
].
388388

389-
pred declare-join i:class, i:pair class class, o:prop.
389+
pred declare-join i:hbclass, i:pair hbclass hbclass, o:prop.
390390
declare-join (class C3 S3 MLwP3) (pr (class C1 S1 _) (class C2 S2 _)) (join C1 C2 C3) :-
391391
Name is "join_" ^ {gref->modname S3 2 "_"} ^
392392
"_between_" ^ {gref->modname S1 2 "_"} ^ "_and_" ^ {gref->modname S2 2 "_"},
@@ -414,7 +414,7 @@ declare-join (class C3 S3 MLwP3) (pr (class C1 S1 _) (class C2 S2 _)) (join C1 C
414414
% in the middle of existing ones. Possible fix: always declare all intermediate
415415
% possibilities but without proper names (requires the previous TODO about
416416
% aliasing already existing stuff).
417-
pred declare-unification-hints i:term, i:term, i:class, o:list prop.
417+
pred declare-unification-hints i:term, i:term, i:hbclass, o:list prop.
418418
declare-unification-hints SortProj ClassProj CurrentClass NewJoins :- std.do! [
419419
findall-classes All,
420420

@@ -495,7 +495,7 @@ declare-sort-coercion CoeClass StructureName (global Proj) :-
495495

496496
log.coq.coercion.declare (coercion Proj 0 StructureName CoeClass).
497497

498-
pred if-class-already-exists-error i:id, i:list class, i:list mixinname.
498+
pred if-class-already-exists-error i:id, i:list hbclass, i:list mixinname.
499499
if-class-already-exists-error _ [] _.
500500
if-class-already-exists-error N [class _ S ML1wP|CS] ML2 :-
501501
list-w-params_list ML1wP ML1,

HB/structures.v

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,11 @@ typeabbrev (w-mixins A) (pair mixins (w-params A)).
100100
% instances by calls to `S.Pack T {{lib:elpi.hole}}`, and extending the reconstruction
101101
% mecanism of mixins to also reinfer these holes.
102102

103-
kind class type.
104-
type class classname -> structure -> mixins -> class.
103+
kind hbclass type.
104+
type class classname -> structure -> mixins -> hbclass.
105105

106106
% class-def contains all the classes ever declared
107-
pred class-def o:class.
107+
pred class-def o:hbclass.
108108

109109
%%%%% Builders %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
110110

0 commit comments

Comments
 (0)