When is one program inside another?
Running a program is decidable and cheap; comparing two is not.
The basic question is containment: P₁ is contained in P₂ (written P₁ ⊑ P₂) when, on every input EDB, the facts P₁ derives are a subset of the facts P₂ derives — IDB₁ ⊆ IDB₂, for all inputs at once.
Equivalence is two containments (
P₁ ⊑ P₂ and P₂ ⊑ P₁), and "is this rule ever needed?" is a containment too — so all of them are exactly as hard as containment.