Пример #1
0
        public override bool Equals(Object obj)
        {
            Midpoint midptObj = obj as Midpoint;

            if (midptObj == null)
            {
                return(false);
            }
            return(point.Equals(midptObj.point) && segment.Equals(midptObj.segment) && base.Equals(obj));
        }
Пример #2
0
        public override bool CanBeStrengthenedTo(GroundedClause gc)
        {
            Midpoint midpoint = gc as Midpoint;

            if (midpoint == null)
            {
                return(false);
            }

            return(this.point.StructurallyEquals(midpoint.point) && this.segment.StructurallyEquals(midpoint.segment));
        }
Пример #3
0
        public override bool StructurallyEquals(Object obj)
        {
            Midpoint midptObj = obj as Midpoint;

            if (midptObj == null)
            {
                return(false);
            }

            return(point.StructurallyEquals(midptObj.point) && segment.StructurallyEquals(midptObj.segment));
        }
Пример #4
0
        public static List<EdgeAggregator> InstantiateMidpointTheorem(GroundedClause original, Midpoint midpt)
        {
            List<EdgeAggregator> newGrounded = new List<EdgeAggregator>();

            // Construct 2AM
            Multiplication product1 = new Multiplication(new NumericValue(2), new Segment(midpt.point, midpt.segment.Point1));
            // Construct 2BM
            Multiplication product2 = new Multiplication(new NumericValue(2), new Segment(midpt.point, midpt.segment.Point2));

            // 2X = AB
            GeometricSegmentEquation newEq1 = new GeometricSegmentEquation(product1, midpt.segment);
            GeometricSegmentEquation newEq2 = new GeometricSegmentEquation(product2, midpt.segment);

            // For hypergraph
            List<GroundedClause> antecedent = Utilities.MakeList<GroundedClause>(original);

            newGrounded.Add(new EdgeAggregator(antecedent, newEq1, annotation));
            newGrounded.Add(new EdgeAggregator(antecedent, newEq2, annotation));

            return newGrounded;
        }
Пример #5
0
        private static List<EdgeAggregator> InstantiateFromMidpoint(InMiddle im, Midpoint midpt, GroundedClause original)
        {
            List<EdgeAggregator> newGrounded = new List<EdgeAggregator>();

            // Does this ImMiddle apply to this midpoint?
            if (!im.point.StructurallyEquals(midpt.point)) return newGrounded;
            if (!im.segment.StructurallyEquals(midpt.segment)) return newGrounded;

            // For hypergraph
            List<GroundedClause> antecedent = Utilities.MakeList<GroundedClause>(original);

            // Backward: Midpoint(M, Segment(A, B)) -> InMiddle(A, M, B)
            newGrounded.Add(new EdgeAggregator(antecedent, im, annotation));

            //
            // Forward: Midpoint(M, Segment(A, B)) -> Congruent(Segment(A,M), Segment(M,B))
            //
            Segment left = new Segment(midpt.segment.Point1, midpt.point);
            Segment right = new Segment(midpt.point, midpt.segment.Point2);
            GeometricCongruentSegments ccss = new GeometricCongruentSegments(left, right);
            newGrounded.Add(new EdgeAggregator(antecedent, ccss, annotation));

            return newGrounded;
        }