private static List<EdgeAggregator> InstantiateToTheorem(Quadrilateral quad, CongruentSegments cs, Parallel parallel)
        {
            List<EdgeAggregator> newGrounded = new List<EdgeAggregator>();

            // Are the pairs on the opposite side of this quadrilateral?
            if (!quad.HasOppositeCongruentSides(cs)) return newGrounded;
            if (!quad.HasOppositeParallelSides(parallel)) return newGrounded;

            // Do the congruent segments coincide with these parallel segments?
            if (!parallel.segment1.HasSubSegment(cs.cs1) && !parallel.segment2.HasSubSegment(cs.cs1)) return newGrounded;
            if (!parallel.segment1.HasSubSegment(cs.cs2) && !parallel.segment2.HasSubSegment(cs.cs2)) return newGrounded;

            //
            // Create the new Rhombus object
            //
            Strengthened newParallelogram = new Strengthened(quad, new Parallelogram(quad));

            // For hypergraph
            List<GroundedClause> antecedent = new List<GroundedClause>();
            antecedent.Add(quad);
            antecedent.Add(cs);
            antecedent.Add(parallel);

            newGrounded.Add(new EdgeAggregator(antecedent, newParallelogram, annotation));

            return newGrounded;
        }
示例#2
0
        private static List<EdgeAggregator> InstantiateToRhombus(Quadrilateral quad, CongruentSegments cs1, CongruentSegments cs2, CongruentSegments cs3)
        {
            List<EdgeAggregator> newGrounded = new List<EdgeAggregator>();

            //
            // The 3 congruent segments pairs must relate; one pair must link the two others.
            // Determine the link segments as well as the opposite sides.
            //
            CongruentSegments link = null;
            CongruentSegments opp1 = null;
            CongruentSegments opp2 = null;
            if (cs1.SharedSegment(cs2) != null && cs1.SharedSegment(cs3) != null)
            {
                link = cs1;
                opp1 = cs2;
                opp2 = cs3;
            }
            else if (cs2.SharedSegment(cs1) != null && cs2.SharedSegment(cs3) != null)
            {
                link = cs2;
                opp1 = cs1;
                opp2 = cs3;
            }
            else if (cs3.SharedSegment(cs1) != null && cs3.SharedSegment(cs2) != null)
            {
                link = cs3;
                opp1 = cs1;
                opp2 = cs2;
            }
            else return newGrounded;

            // Are the pairs on the opposite side of this quadrilateral?
            if (!quad.HasOppositeCongruentSides(opp1)) return newGrounded;
            if (!quad.HasOppositeCongruentSides(opp2)) return newGrounded;

            //
            // Create the new Rhombus object
            //
            Strengthened newRhombus = new Strengthened(quad, new Rhombus(quad));

            // For hypergraph
            List<GroundedClause> antecedent = new List<GroundedClause>();
            antecedent.Add(quad);
            antecedent.Add(cs1);
            antecedent.Add(cs2);
            antecedent.Add(cs3);

            newGrounded.Add(new EdgeAggregator(antecedent, newRhombus, annotation));

            return newGrounded;
        }
        private static List<EdgeAggregator> InstantiateToTheorem(Quadrilateral quad, CongruentSegments cs1, CongruentSegments cs2)
        {
            List<EdgeAggregator> newGrounded = new List<EdgeAggregator>();

            // Are the pairs on the opposite side of this quadrilateral?
            if (!quad.HasOppositeCongruentSides(cs1)) return newGrounded;
            if (!quad.HasOppositeCongruentSides(cs2)) return newGrounded;

            //
            // Create the new Rhombus object
            //
            Strengthened newParallelogram = new Strengthened(quad, new Parallelogram(quad));

            // For hypergraph
            List<GroundedClause> antecedent = new List<GroundedClause>();
            antecedent.Add(quad);
            antecedent.Add(cs1);
            antecedent.Add(cs2);

            newGrounded.Add(new EdgeAggregator(antecedent, newParallelogram, annotation));

            return newGrounded;
        }