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); }
/// <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); }
/// <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); }
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); }
/// <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); }