Example #1
0
        public void ValidateMember(bool optimizationDone)
        {
            Debug.Assert(Logic() != null);

            // TODO: copy out destroy the memo so we can't apply checks here
            bool beforeCopyOut = Stmt().optimizer_.copyoutCounter_ == 0;

            if (beforeCopyOut)
            {
                // the node itself is a non-memo node
                Debug.Assert(!(Logic() is LogicMemoRef));

                if (group_.IsSolverOptimizedGroup())
                {
                    return;
                }

                // all its children shall be memo nodes and can be deref'ed to non-memo node
                Logic().children_.ForEach(x => Debug.Assert(
                                              x is LogicMemoRef xl && !(xl.Deref() is LogicMemoRef)));

                if (physic_ != null)
                {
                    // the physical node itself is non-memo node
                    Debug.Assert(!(physic_ is PhysicMemoRef));

                    // all its children shall be memo nodes and can be deref'ed to non-memo node
                    physic_.children_.ForEach(x => Debug.Assert(
                                                  x is PhysicMemoRef xp && !(xp.Logic().Deref() is LogicMemoRef)));
                }
            }
        }