示例#1
0
        //
        // For generation of transitive Parallel Lines
        //
        private static List <EdgeAggregator> CreateTransitiveParallelSegments(Parallel parallel1, Parallel parallel2)
        {
            List <EdgeAggregator> newGrounded = new List <EdgeAggregator>();

            // If there is a deduction relationship between the given congruences, do not perform another substitution
            // CTA: remove?
            if (parallel1.HasGeneralPredecessor(parallel2))
            {
                return(newGrounded);
            }

            int numSharedExps = parallel1.SharesNumClauses(parallel2);

            switch (numSharedExps)
            {
            case 0:
                // Nothing is shared: do nothing
                break;

            case 1:
                // Expected case to create a new congruence relationship
                return(Parallel.CreateTransitiveParallel(parallel1, parallel2));

            case 2:
                // This is either reflexive or the exact same congruence relationship (which shouldn't happen)
                break;

            default:

                throw new Exception("Parallel Statements may only have 0, 1, or 2 common expressions; not, " + numSharedExps);
            }

            return(newGrounded);
        }