예제 #1
0
        public Page37Problem2(bool onoff, bool complete)
            : base(onoff, complete)
        {
            problemName = "Page 37 Problem 2";

            Point a = new Point("A", -4, 0); points.Add(a);
            Point b = new Point("B", 0, 0); points.Add(b);
            Point c = new Point("C", -4, 7); points.Add(c);

            Point x = new Point("X", 1, 3); points.Add(x);
            Point y = new Point("Y", 1, 0); points.Add(y);
            Point z = new Point("Z", 7, 0); points.Add(z);
            Point p = new Point("P", 5, 7); points.Add(p);

            Segment ab = new Segment(a, b); segments.Add(ab);
            Segment bc = new Segment(b, c); segments.Add(bc);
            Segment xy = new Segment(x, y); segments.Add(xy);
            Segment yz = new Segment(y, z); segments.Add(yz);
            Segment yp = new Segment(y, p); segments.Add(yp);

                        parser = new LiveGeometry.TutorParser.HardCodedParserMain(points, collinear, segments, circles, onoff);
            given.Add(new Complementary((Angle)parser.Get(new Angle(a, b, c)), (Angle)parser.Get(new Angle(x, y, p))));
            Addition sum = new Addition((Angle)parser.Get(new Angle(p, y, z)), (Angle)parser.Get(new Angle(x, y, p)));
            given.Add(new GeometricAngleEquation(sum, new NumericValue(90)));

            goals.Add(new GeometricCongruentAngles((Angle)parser.Get(new Angle(a, b, c)), (Angle)parser.Get(new Angle(p, y, z))));
        }
예제 #2
0
        // Demonstration of theorem "Median of a trapezoid is half the sum of the bases"
        /*
         *         D_______E
         *         /       \
         * L______/M________\N
         *       /           \
         *      /_____________\
         *     A               B
         */
        public Page174Theorem416_2(bool onoff, bool complete)
            : base(onoff, complete)
        {
            problemName = "Page 174 Theorem 4-16 Part 2";

            Point a = new Point("A", 0, 0); points.Add(a);
            Point b = new Point("B", 10, 0); points.Add(b);
            Point c = new Point("C", 8, 4); points.Add(c);
            Point d = new Point("D", 2, 4); points.Add(d);

            Point l = new Point("L", -7, 2); points.Add(l);
            Point m = new Point("M", 1, 2); points.Add(m);
            Point n = new Point("N", 9, 2); points.Add(n);

            Segment ab = new Segment(a, b); segments.Add(ab);
            Segment cd = new Segment(c, d); segments.Add(cd);

            List<Point> pts = new List<Point>();
            pts.Add(a);
            pts.Add(m);
            pts.Add(d);
            collinear.Add(new Collinear(pts));

            pts = new List<Point>();
            pts.Add(b);
            pts.Add(n);
            pts.Add(c);
            collinear.Add(new Collinear(pts));

            pts = new List<Point>();
            pts.Add(l);
            pts.Add(m);
            pts.Add(n);
            collinear.Add(new Collinear(pts));

            parser = new GeometryTutorLib.TutorParser.HardCodedParserMain(points, collinear, segments, circles, onoff);

            Segment ad = (Segment)parser.Get(new Segment(a, d));
            Segment bc = (Segment)parser.Get(new Segment(b, c));
            Segment ln = (Segment)parser.Get(new Segment(l, n));
            Quadrilateral quad = (Quadrilateral)parser.Get(new Quadrilateral(ad, bc, cd, ab));
            Addition sum = new Addition(ab, cd);

            //If segment MN is the median of the trapezoid, and segment LN is congruent to the sum of AB and CD, then
            //segment AD must bisect segment LN

            given.Add(new Strengthened(quad, new Trapezoid(quad)));
            given.Add(new SegmentBisector(parser.GetIntersection(ln, ad), ln));
            given.Add(new SegmentBisector(parser.GetIntersection(ln, bc), ln));
            given.Add(new GeometricSegmentEquation(ln, sum));

            goals.Add(new SegmentBisector(parser.GetIntersection(ad, ln), ad));
        }
예제 #3
0
        public static List<EdgeAggregator> Instantiate(GroundedClause c)
        {
            annotation.active = EngineUIBridge.JustificationSwitch.SEGMENT_ADDITION_AXIOM;

            List<EdgeAggregator> newGrounded = new List<EdgeAggregator>();
            InMiddle im = c as InMiddle;

            if (im == null) return newGrounded;

            Segment s1 = new Segment(im.segment.Point1, im.point);
            Segment s2 = new Segment(im.point, im.segment.Point2);
            Addition sum = new Addition(s1, s2);
            GeometricSegmentEquation eq = new GeometricSegmentEquation(sum, im.segment);
            eq.MakeAxiomatic();

            // For hypergraph
            List<GroundedClause> antecedent = Utilities.MakeList<GroundedClause>(im);
            newGrounded.Add(new EdgeAggregator(antecedent, eq, annotation));

            return newGrounded;
        }
        private static List<EdgeAggregator> InstantiateToTheorem(Trapezoid trapezoid, GroundedClause original)
        {
            List<EdgeAggregator> newGrounded = new List<EdgeAggregator>();

            // If median has not been checked, check now
            if (!trapezoid.IsMedianChecked()) trapezoid.FindMedian();
            // Generate only if the median is valid (exists in the original figure)
            if (!trapezoid.IsMedianValid()) return newGrounded;

            Addition sum = new Addition(trapezoid.baseSegment, trapezoid.oppBaseSegment);
            Multiplication product = new Multiplication(new NumericValue(2), trapezoid.median);

            GeometricSegmentEquation gseq = new GeometricSegmentEquation(product, sum);

            // For hypergraph
            List<GroundedClause> antecedent = new List<GroundedClause>();
            antecedent.Add(original);

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

            return newGrounded;
        }
예제 #5
0
        private static List<EdgeAggregator> InstantiateAngles(Angle angle1, Angle angle2)
        {
            List<EdgeAggregator> newGrounded = new List<EdgeAggregator>();

            // An angle may have multiple names
            if (angle1.Equates(angle2)) return newGrounded;

            if (!angle1.GetVertex().Equals(angle2.GetVertex())) return newGrounded;

            // Determine the shared segment if we have an adjacent situation
            Segment shared = angle1.IsAdjacentTo(angle2);

            if (shared == null) return newGrounded;

            //
            // If we combine these two angles, the result is a third angle, which, when measured,
            // would be less than 180; this is contradictory since we measuare angles greedily and no circular angle is measured as > 180
            //
            if (angle1.measure + angle2.measure > 180) return newGrounded;

            // Angle(A, B, C), Angle(C, B, D) -> Angle(A, B, C) + Angle(C, B, D) = Angle(A, B, D)
            Point vertex = angle1.GetVertex();
            Point exteriorPt1 = angle2.OtherPoint(shared);
            Point exteriorPt2 = angle1.OtherPoint(shared);
            Angle newAngle = new Angle(exteriorPt1, vertex, exteriorPt2);
            Addition sum = new Addition(angle1, angle2);
            GeometricAngleEquation geoAngEq = new GeometricAngleEquation(sum, newAngle);
            geoAngEq.MakeAxiomatic(); // This is an axiomatic equation

            // For hypergraph construction
            List<GroundedClause> antecedent = new List<GroundedClause>();
            antecedent.Add(angle1);
            antecedent.Add(angle2);

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

            return newGrounded;
        }
예제 #6
0
        //
        // Triangle(A, B, C) -> m\angle ABC + m\angle CAB + m\angle BCA = 180^o
        //
        public static List<EdgeAggregator> Instantiate(GroundedClause c)
        {
            annotation.active = EngineUIBridge.JustificationSwitch.SUM_ANGLES_IN_TRIANGLE_180;

            List<EdgeAggregator> newGrounded = new List<EdgeAggregator>();

            Triangle tri = c as Triangle;
            if (tri == null) return newGrounded;

            // Generate, by definition the sum of the three angles equal 180^o
            Angle a1 = new Angle(tri.Point1, tri.Point2, tri.Point3);
            Angle a2 = new Angle(tri.Point3, tri.Point1, tri.Point2);
            Angle a3 = new Angle(tri.Point2, tri.Point3, tri.Point1);

            Addition add = new Addition(a1, a2);
            Addition overallAdd = new Addition(add, a3);
            NumericValue value = new NumericValue(180); // Sum is 180^o
            GeometricAngleEquation eq = new GeometricAngleEquation(overallAdd, value);

            List<GroundedClause> antecedent = Utilities.MakeList<GroundedClause>(tri);
            newGrounded.Add(new EdgeAggregator(antecedent, eq, annotation));

            return newGrounded;
        }
예제 #7
0
        //
        // Inflate am entire flattened side of an equation
        //
        private static GroundedClause InflateEntireSide(List<GroundedClause> side)
        {
            GroundedClause singleExp;

            if (side.Count <= 1)
            {
                singleExp = InflateTerm(side[0]);
            }
            else
            {
                singleExp = new Addition(InflateTerm(side[0]), InflateTerm(side[1]));
                for (int i = 2; i < side.Count; i++)
                {
                    singleExp = new Addition(singleExp, InflateTerm(side[i]));
                }
            }

            return singleExp;
        }
        private static EdgeAggregator ConstructExteriorRelationship(Triangle tri, Angle extAngle)
        {
            //
            // Acquire the remote angles
            //
            Angle remote1 = null;
            Angle remote2 = null;

            tri.AcquireRemoteAngles(extAngle.GetVertex(), out remote1, out remote2);

            //
            // Construct the new equation
            //
            Addition sum = new Addition(remote1, remote2);
            GeometricAngleEquation eq = new GeometricAngleEquation(extAngle, sum);

            //
            // For the hypergraph
            //
            List<GroundedClause> antecedent = Utilities.MakeList<GroundedClause>(tri);
            antecedent.Add(extAngle);

            return new EdgeAggregator(antecedent, eq, annotation);
        }