### Description

As we have more rules doing analysis across plans, a number of methods are useful to add to the `QueryPlan` class itself, mainly around expressions:

```
- expressions() - return the expressions declared by this plan
- references() - return the references from the expressions above
```
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/optimizer/LogicalPlanOptimizer.java
BooleanSimplification() {
            super();
        }
        @Override
        protected Expression maybeSimplifyNegatable(Expression e) {
            return null;
        }
    }
    static class PruneFilters extends OptimizerRules.PruneFilters {
        @Override
        protected LogicalPlan skipPlan(Filter filter) {
            return LogicalPlanOptimizer.skipPlan(filter);
        }
    }
    static class SkipQueryOnLimitZero extends OptimizerRules.SkipQueryOnLimitZero {
        @Override
        protected LogicalPlan skipPlan(Limit limit) {
            return LogicalPlanOptimizer.skipPlan(limit);
        }
    }
    static class PruneEmptyPlans extends OptimizerRules.OptimizerRule<UnaryPlan> {