Implement same_domain helper clauses.