presto-main/src/main/java/io/prestosql/sql/planner/EqualityInference.java/EqualityInference/isScoped
class EqualityInference:    private static boolean isScoped(Expression expression, Predicate<Symbol> symbolScope)
    {
        return SymbolsExtractor.extractUnique(expression).stream().allMatch(symbolScope);
    }