Exemplo n.º 1
0
 public virtual AtomicRE VisitAtomicRE(AtomicRE node)
 {
     Contract.Requires(node != null);
     Contract.Ensures(Contract.Result <AtomicRE>() != null);
     node.b = this.VisitBlock(node.b);
     return(node);
 }
Exemplo n.º 2
0
Arquivo: Wlp.cs Projeto: wrwg/boogie
        public static VCExpr RegExpr(RE r, VCExpr N, VCContext ctxt)
        {
            Contract.Requires(r != null);
            Contract.Requires(N != null);
            Contract.Requires(ctxt != null);
            Contract.Ensures(Contract.Result <VCExpr>() != null);

            if (r is AtomicRE)
            {
                AtomicRE ar = (AtomicRE)r;
                return(Block(ar.b, N, ctxt));
            }
            else if (r is Sequential)
            {
                Sequential s = (Sequential)r;
                return(RegExpr(s.first, RegExpr(s.second, N, ctxt), ctxt));
            }
            else if (r is Choice)
            {
                Choice ch = (Choice)r;
                VCExpr res;
                if (ch.rs == null || ch.rs.Count == 0)
                {
                    res = N;
                }
                else
                {
                    VCExpr currentWLP = RegExpr(cce.NonNull(ch.rs[0]), N, ctxt);
                    for (int i = 1, n = ch.rs.Count; i < n; i++)
                    {
                        currentWLP = ctxt.Ctxt.ExprGen.And(currentWLP, RegExpr(cce.NonNull(ch.rs[i]), N, ctxt));
                    }

                    res = currentWLP;
                }

                return(res);
            }
            else
            {
                Contract.Assert(false);
                throw new cce.UnreachableException(); // unexpected RE subtype
            }
        }
Exemplo n.º 3
0
 public override AtomicRE VisitAtomicRE(AtomicRE node)
 {
     return(base.VisitAtomicRE((AtomicRE)node.Clone()));
 }
Exemplo n.º 4
0
 public override AtomicRE VisitAtomicRE(AtomicRE node)
 {
     //Contract.Requires(node != null);
     Contract.Ensures(Contract.Result <AtomicRE>() != null);
     return(base.VisitAtomicRE((AtomicRE)node.Clone()));
 }
Exemplo n.º 5
0
 public override AtomicRE VisitAtomicRE(AtomicRE node)
 {
     problematicNode = node;
     return(node);
 }