      (fresh [?type]
             (type-member ?type ?member))]))
 
-;(defn
-;  type-member
-;  "Relation between a type and one of its declared members as known to the weaver."
-
 (defn- 
-  resolvedmember-synthetic?
-  [?resolvedmember ?syntheticbool]
-  (all
-    (member ?resolvedmember)
-    (equals ?syntheticbool (.isSynthetic ?resolvedmember))))
-
-(defn
-  syntheticmember
-  "Relation of synthetic members."
-  [?resolvedmember]
-  (all
-    (resolvedmember-synthetic? ?resolvedmember true)))
+  type|ajsynthetic?
+  [?type ?boolean]
+  (all
+    (equals ?boolean (.isSynthetic ?type))))
+
+
+(defn
+  type|nonsynthetic
+  "Relation of types that are not AspectJ synthetic."
+  [?type]
+  (all
+    (type ?type)
+    (type|ajsynthetic? ?type false)))
+   
+(defn
+  type|synthetic
+  "Relation of types that are AspectJ synthetic."
+  [?type]
+  (all
+    (type ?type)
+    (type|ajsynthetic? ?type true)))
+
+
+(defn- 
+  member|ajsynthetic?
+  [?member ?boolean]
+  (all
+    ;;note: do not use .isSynthetic on ResolvedMember, 
+    ;;those are java-based synthetics (rather than ajc-based synthetics)
+    (equals ?boolean (.isAjSynthetic ?member))))
+
+
+
+(defn
+  member|synthetic
+  "Relation of members that are AspectJ synthetic (e.g., hasAspect())."
+  [?member]
+  (all
+    (member ?member)
+    (member|ajsynthetic? ?member true)))
   
-(defn
-  nonsyntheticmember
-  "Relation of nonsynethic members."
-  [?resolvedmember]
-  (all
-     (resolvedmember-synthetic? ?resolvedmember false)))
-
+;;TODO: perhaps filter out using signature?
+(defn
+  member|nonsynthetic
+  "Relation of members that are not AspectJ synthetic. Still includes members implementing ITD."
+  [?member]
+  (all
+    (member ?member)
+    (member|ajsynthetic? ?member false)))
 
 (defn
   aspect-declaredinterface

    (succeeds (.isNested ?resolvedtype))))

(defn
  nestedtype-outertype
  "Relation between a nested and its outer type.

   e.g., (ekeko* [?i ?o]  (interface ?i) (nestedtype-outertype ?i ?o))


  (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
