public bool constructModel(C5TreeNode node, Dictionary<string, Expr> attr2Expr) { Debug.Assert(attr2Expr != null); Expr oldmodel = model; List<Expr> stack = new List<Expr>(); stack.Add(Expr.True); List<List<Expr>> finalformula = node.constructBoogieExpr(stack, attr2Expr); if (finalformula.Count() == 0) { model = Expr.False; return !ExtendsExpr.EqualityComparer(model, oldmodel); } model = ExtendsExpr.disjunction(finalformula); if (ExtendsExpr.EqualityComparer(model, oldmodel)) { //Console.WriteLine("old model: "); //Console.WriteLine(oldmodel.ToString()); //Console.WriteLine("new model: "); //Console.WriteLine(model.ToString()); return false; } else return true; }
/* public bool TypeCheck(List<Type> argTypes, out string msg) { msg = ""; foreach(var argType in argTypes) { if (!argType.IsInt || !argType.IsBool) { msg = "Illegal type, expecting int or bool"; return false; } } return true; } */ public bool constructModel(string funcName, C5TreeNode root, Dictionary<string, Dictionary<string, Expr>> attr2Expr, Dictionary<string, int> functionID) { Debug.Assert(attr2Expr.Keys.Contains(funcName)); Debug.Assert(functionID.Keys.Contains(funcName)); return constructModel(root.children[functionID[funcName]], attr2Expr[funcName]); }