Here's a simplified UML diagram prepared for a Java implementation of Jedi 1.0:
We can represent this diagram as a Prolog knowledge base:
Three predicates are defined:
extends(X, Y) if class/interface Y extends class/interface X.
implements(X, Y) if class Y implements interface X.
has(X, Y, Z) if class X has a reference named Y to a class/interface Z.
Define and test the rule:
depends(X, Y) if class/interface X depends on class/interface Y.
Technically, X depends on Y if changes to Y may require changes to X. For our purposes, X depends on Y if there is a chain of arrows leading from X to Y.
Note: X depends on itself.