コード例 #1
0
        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);
        }
コード例 #2
0
ファイル: StandardVisitor.cs プロジェクト: luckysunda/hice-dt
 public virtual Cmd VisitCommentCmd(CommentCmd node)
 {
     Contract.Requires(node != null);
     Contract.Ensures(Contract.Result <Cmd>() != null);
     return(node);
 }
コード例 #3
0
 public override Cmd VisitCommentCmd(CommentCmd node)
 {
     throw new NotImplementedException();
 }