   (all
     (member ?member)
     (member|ajsynthetic? ?member false)))
+  
+(defn
+  type-declaredinterface
+  "Relation between a type and one of the interfaces it 
+   declares to be implementing (for a class and aspect)
+   or extending (for an interface)."
+  [?type ?interface]
+  (all
+    (type ?type)
+    (contains (.getDeclaredInterfaces ?type) ?interface)))  
+
+(defn
+  type-declaredinterface+
+  "Relation between a type and one of the ancestors in its declared interface hierarchy."
+  [?type ?ancestor]
+  (conde
+    [(type-declaredinterface ?type ?ancestor) ]
+    [(fresh [?inbetween]
+              (type-declaredinterface ?type ?inbetween)
+              (type-declaredinterface+ ?inbetween ?ancestor))]))
 
 (defn
   aspect-declaredinterface

  (all
    (aspect ?aspect)
    (equals ?super (.getSuperclass ?aspect))))

(defn
  aspect-declaredsuperaspect

  [?aspect ?interface]
  (all
    (aspect ?aspect)
    (type-declaredinterface ?aspect ?interface)))


(defn
  aspect-declaredsuper
