scope ai_findVarObjects.

static <A> L<A> nuLike ai_findVarObjects(Class<A> varClass, O root) {
  ret ai_findVarObjects(varClass, root, null);
}

static <A> L<A> nuLike ai_findVarObjects(Class<A> varClass, O root, IF1<O, Bool> objectFilter) {
  Cl out = transitiveHullOfFunction(o -> #scanObject(o, objectFilter), root);
  ret instancesOf(varClass, out);
}
  
static L #scanObject(O o, IF1<O, Bool> objectFilter) {
  ret filter(nsnpntFieldValues_withoutOuterRefs(o),
    v -> v != null && !v instanceof S
      && (objectFilter == null || objectFilter.get(v)));
}

end scope