public CompilableProvider Rewrite(CompilableProvider rootProvider)
 {
     State = null;
     try {
         using (new CorrectorState(this))
             return(VisitCompilable(rootProvider));
     }
     catch (InvalidOperationException) {
         if (throwOnCorrectionFault)
         {
             throw;
         }
         return(rootProvider);
     }
 }
            // Constructors

            public CorrectorState(ApplyProviderCorrectorRewriter owner)
            {
                this.owner = owner;
                Predicates =
                    new Dictionary <ApplyParameter, List <Pair <Expression <Func <Tuple, bool> >, ColumnCollection> > >();
                CalculateProviders =
                    new Dictionary <ApplyParameter, List <Pair <CalculateProvider, ColumnCollection> > >();
                CalculateFilters =
                    new Dictionary <CalculateProvider, List <Pair <Expression <Func <Tuple, bool> >, ColumnCollection> > >();
                previousState = owner.State;
                if (previousState == null)
                {
                    SelfConvertibleApplyProviders = new Dictionary <ApplyParameter, bool>();
                }
                else
                {
                    SelfConvertibleApplyProviders = previousState.SelfConvertibleApplyProviders;
                }
                owner.State = this;
            }