public List <Cmd> DesugarCallCmd(CallCmd c) { var retCmds = new List <Cmd>(((StateCmd)c.Desugaring).Cmds); for (int i = 0; i < retCmds.Count; i++) { if (retCmds[i] is HavocCmd) { retCmds[i] = new CommentCmd("Procedure call desugaring"); } //we're going to translate all assume of the form (temp == uf_fun(...)) into assignments else if (retCmds[i] is AssumeCmd) { try { var assume = retCmds[i] as AssumeCmd; var eq = assume.Expr as NAryExpr; if (eq != null && eq.Args.Count == 2 && ((BinaryOperator)eq.Fun).Op == BinaryOperator.Opcode.Eq) { var lhs = new List <AssignLhs>(); lhs.Add(new SimpleAssignLhs(eq.Args[0].tok, ((IdentifierExpr)eq.Args[0]))); var rhs = new List <Expr>(); rhs.Add(eq.Args[1]); retCmds[i] = new AssignCmd(assume.tok, lhs, rhs); } } catch { } } } return(retCmds); }
public virtual Cmd VisitCommentCmd(CommentCmd node) { Contract.Requires(node != null); Contract.Ensures(Contract.Result <Cmd>() != null); return(node); }
public override Cmd VisitCommentCmd(CommentCmd node) { throw new NotImplementedException(); }