@@ -223,21 +223,24 @@ distinct-pairs-below CurrentClass AllSuper C1 C2 :-
223223 not(sub-class? C1 C2),
224224 not(sub-class? C2 C1),
225225 if (join C1n C2n C3n)
226- (assert-building-bottom-up CurrentClass C3n, fail) % a join, not a valid pair
226+ (assert-building-bottom-up CurrentClass C3n C1n C2n , fail) % a join, not a valid pair
227227 true, % no join, valid pair
228228 ].
229229
230- pred assert-building-bottom-up i:class, i:classname.
231- assert-building-bottom-up CurrentClass C3n :-
230+ pred assert-building-bottom-up i:class, i:classname, i:classname, i:classname .
231+ assert-building-bottom-up CurrentClass C3n C1n C2n :-
232232 class-def (class C3n X Y),
233233 CurrentClass = class CC _ _,
234234 if (not (sub-class? CurrentClass (class C3n X Y)))
235235 (gref->modname CC 1 "." Before, gref->modname_short C3n "." After,
236- Msg1 is "- declare structure " ^ Before ^ " before structure " ^ After ^ ";",
237- coq.error "You must declare the hierarchy bottom-up."
236+ Msg1 is "- declare structure " ^ Before ^ " before structure " ^ After ^ " if " ^ After ^ " inherits from it;",
237+ Msg2 is "- declare an additional structure that inherits from both "
238+ ^ {gref->modname_short C1n "."} ^ " and " ^ {gref->modname_short C2n "."}
239+ ^ " and from which " ^ Before ^ " and/or " ^ After ^ " inherit.",
240+ coq.error "You must declare the hierarchy bottom-up or addd a missing join."
238241 "There are two ways out:"
239242 Msg1
240- "- declare an additional structure from which both inherit" )
243+ Msg2 )
241244 true.
242245
243246pred distinct-pairs_pair i:prop, o:pair class class.
0 commit comments