示例#1
0
        private bool InternalValidate(Expr expr, Query query, out object trace)
        {
            trace = null;
            RelationGraph.AddNode(query);

            var queryExpr = new AGQueryExpr(expr, query);

            queryExpr.RetrieveRenderKnowledge();
            if (queryExpr.RenderKnowledge == null)
            {
                return(false);
            }
            if (queryExpr.RenderKnowledge.Count == 0)
            {
                return(false);
            }
            var agEquationExpr = queryExpr.RenderKnowledge[0] as AGEquationExpr;

            if (agEquationExpr == null)
            {
                return(false);
            }
            agEquationExpr.IsSelected = true;
            agEquationExpr.GenerateSolvingTrace();

            if (agEquationExpr.AutoTrace == null)
            {
                return(false);
            }
            trace = agEquationExpr.AutoTrace;

            RelationGraph.DeleteNode(query);
            return(true);
        }
示例#2
0
        /// <summary>
        /// Goal Input Patter Match
        /// </summary>
        /// <param name="expr"></param>
        /// <param name="goal"></param>
        /// <param name="output"></param>
        /// <param name="userInput"></param>
        /// <returns></returns>
        private bool EvalExprPatterns(Expr expr, EqGoal goal, out object output, bool userInput = false)
        {
            object obj = null;

            if (!userInput)
            {
                obj = RelationGraph.AddNode(goal);
            }
            output = new AGPropertyExpr(expr, goal);
            return(true);
        }
示例#3
0
        /// <summary>
        /// ShapeSymbol Input Pattern Match
        /// </summary>
        /// <param name="expr"></param>
        /// <param name="ss"></param>
        /// <param name="output"></param>
        /// <returns></returns>
        private bool EvalExprPatterns(Expr expr, ShapeSymbol ss, out object output, bool userInput = false)
        {
            if (!userInput)
            {
                RelationGraph.AddNode(ss);
            }

            //expr = ExprG.Generate(ss);
            output = new AGShapeExpr(expr, ss);
            return(true);
        }
示例#4
0
        private bool EvalExprPatterns(Expr expr, Equation eq, out object output, bool userInput = false)
        {
            object obj = null;

            if (!userInput)
            {
                obj = RelationGraph.AddNode(eq);
            }
            output = new AGEquationExpr(expr, eq);
            return(true);
        }
示例#5
0
        /// <summary>
        /// Relation Input Pattern Match
        /// </summary>
        /// <param name="expr"></param>
        /// <param name="str"></param>
        /// <param name="st"></param>
        /// <param name="query"></param>
        /// <param name="output"></param>
        /// <returns></returns>
        private bool EvalExprPatterns(Expr expr, Query query, out object output, bool userInput = false)
        {
            object obj = null;

            if (!userInput)
            {
                obj = RelationGraph.AddNode(query);
            }
            output = new AGQueryExpr(expr, query);
            return(obj != null);
            //return EvalNonDeterministic(expr, obj, out output);
        }