     (succeeds (.isNested ?resolvedtype))))
 
 (defn
+  topleveltype
+  "Relation of non-nested types known to the AspectJ weaver."
+  [?type]
+  (all
+    (type ?type)
+    (equals false (.isNested ?type))))
+
+(defn
   nestedtype-outertype
-  "Relation between a nested and its outer type.
+  "Relation between a nested and its immediate outer type.
 
    e.g., (ekeko* [?i ?o]  (interface ?i) (nestedtype-outertype ?i ?o))
 

           [(== ?outermost ?outer)])))
    

 
(defn
  aspect
  "Relation of aspects known to the weaver."

  (all 
    (nestedtype ?nested)
    (equals ?outer (.getOuterClass ?nested)))) ;also returns other outer types

(defn
  nestedtype-outertype+
  "Relation between a nested and one of its encompassing outer types."
  [?nested ?outer]
  (conde
    [(nestedtype-outertype ?nested ?outer)]
    [(fresh [?o]
            (nestedtype-outertype ?nested ?o)
            (nestedtype-outertype ?o ?outer))]))


(defn
