コード例 #1
0
ファイル: Instantiator.cs プロジェクト: wcatykid/GeoShader
        ////
        //// Constructs the coverage relationship amongst all figure components
        ////
        //private static void HandleAllFigureIntrinsicFacts(List<GroundedClause> figure)
        //{
        //    for (int f1 = 0; f1 < figure.Count; f1++)
        //    {
        //        for (int f2 = 0; f2 < figure.Count; f2++)
        //        {
        //            if (f1 != f2)
        //            {
        //                if (figure[f1].Covers(figure[f2])) figure[f1].AddComponent(figure[f2].clauseId);
        //            }
        //        }
        //    }
        //}

        //
        // Preprocess the given clauses
        //
        private static void HandleAllGivens(List <GroundedClause> figure, List <GroundedClause> givens)
        {
            ////
            //// Link the boolean facts to the intrinsic facts through coverage (implication)
            ////
            //foreach (GroundedClause given in givens)
            //{
            //    foreach (GroundedClause component in figure)
            //    {
            //        if (given.Covers(component))
            //        {
            //            given.AddComponent(component.clauseId);
            //            given.AddComponentList(component.figureComponents);
            //        }
            //    }
            //}

            //
            // Are any of the givens congruent relationships?
            //
            foreach (GroundedClause clause in givens)
            {
                if (clause is CongruentTriangles)
                {
                    CongruentTriangles conTris = clause as CongruentTriangles;
                    if (conTris.VerifyCongruentTriangles())
                    {
                        // indicate that these triangles are congruent to prevent future 'reproving' congruent
                        conTris.ProcessGivens();
                    }
                    // This is not a valid congruence.
                    else
                    {
                        // Remove?
                    }
                }
                //else if (clause is SimilarTriangles)
                //{
                //    SimilarTriangles simTris = clause as SimilarTriangles;
                //    if (simTris.VerifyCongruentTriangles())
                //    {
                //        // indicate that these triangles are congruent to prevent future 'reproving' congruent
                //        simTris.ProcessGivens();
                //    }
                //    // This is not a valid similarity.
                //    else
                //    {
                //        // Remove?
                //    }
                //}
            }
        }