@@ -36,6 +36,19 @@ pred union i:list A, i:list A, o:list A.
3636union L1 L2 R :-
3737 std.fold L2 L1 (x\l\l'\if (std.mem l x) (l' = l) (l' = [x|l])) R.
3838
39+ pred lt-gref i:gref, i:gref.
40+ lt-gref X Y :-
41+ gref->modname_short X "." SX, gref->modname_short Y "." SY, !, SX s< SY.
42+
43+ pred size-order i:(list A -> list A -> prop), i:list A, i:list A.
44+ size-order Rel L1 L2 :-
45+ std.length L1 S1, std.length L2 S2, !, (S1 i< S2; (S1 = S2, !, Rel L1 L2)).
46+
47+ pred lexi-order i:list gref, i:list gref.
48+ lexi-order [] [].
49+ lexi-order [X1|_] [X2|_] :- lt-gref X1 X2.
50+ lexi-order [X|T1] [X|T2] :- lexi-order T1 T2.
51+
3952% [mixins-on-string S ML] list mixins in structures [S] is equipped with
4053pred mixins-on-string i:string, o:list mixinname.
4154mixins-on-string S ML :-
@@ -94,17 +107,15 @@ paths-from-for-step-using.aux MLSrc ML FL' K' (fdp F _ MLF) L R :-
94107
95108pred pp-solutions i:list (list factoryname).
96109pp-solutions LLF :-
97- std.sort LLF
98- (l1\l2\sigma s1 s2\std.length l1 s1, std.length l2 s2, s1 i=< s2)
99- SLLF,
110+ std.sort LLF (size-order lexi-order) SLLF,
100111 % format
101112 PpSolutions = box (v 4) [
102113 str "HB: solutions (use 'HB.about F.Build' to see the arguments of each factory F):",
103114 {about.bulletize SLLF pp-solution}],
104115 % print
105116 coq.say {coq.pp->string PpSolutions},
106117 coq.say.
107-
118+
108119pred pp-solution i:list factoryname o:coq.pp.
109120pp-solution L (box (hov 0) PLS) :-
110121 std.map L about.pp-module PL,
0 commit comments