Пример #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
        private bool UnEvalExprPatterns(object obj)
        {
            if (_cache.Count == 0)
            {
                return(false);
            }
            var shapeSymExpr = obj as AGShapeExpr;

            if (shapeSymExpr != null)
            {
                return(RelationGraph.DeleteNode(shapeSymExpr.ShapeSymbol));
            }
            var termExpr = obj as AGPropertyExpr;

            if (termExpr != null)
            {
                return(RelationGraph.DeleteNode(termExpr.Goal));
            }
            var queryExpr = obj as AGQueryExpr;

            if (queryExpr != null)
            {
                return(RelationGraph.DeleteNode(queryExpr.QueryTag));
            }
            return(false);
        }