[armedbear-devel] "Inconsistent precedence graph" when calling print-object on java instance

Alessio Stalla alessiostalla at gmail.com
Sun May 9 14:58:40 UTC 2010

On Sun, May 9, 2010 at 7:05 AM, Alan Ruttenberg
<alanruttenberg at gmail.com> wrote:
> Didn't seem to do it:
> (ensure-java-class (find-java-class
> "uk.ac.manchester.cs.owl.owlapi.OWLClassImpl"))
> Fails - trackback below.

Duh, right. The remove-duplicates was a silly mistake, it's completely
non influential. The problem here is that Java inheritance of
interfaces is order-independent, while CLOS honors a class precedence
order. It's thus possible to have Java interfaces that create
precedence graphs which cannot be ordered by CLOS standard rules, as
you have found out, specifically:

OWLObject extends Comparable, but
OWLPredicate extends Comparable, OWLObject

in CLOS, that would be like:

(defclass comp () ())
(defclass owlo (comp) ())
(defclass owlp (comp owlo) ())

So, I patched it again to completely skip the default
compute-class-precedence-list method and directly sort the list of
superclasses (as returned by mop::compute-superclasses*). I tested it
with your OWL example and it works.

Thanks for reporting!


More information about the armedbear-devel mailing list