Exemplo n.º 1
0
            ///////////////////////////////////////////////////////////////////////////////////
            private void WriteApplication(string opName, IEnumerable <VCExpr> /*!>!*/ args, LineariserOptions options)
            {
                Contract.Requires(cce.NonNullElements(args));
                Contract.Requires(options != null);
                Contract.Assert(opName != null);

                bool hasArgs = false;

                foreach (VCExpr e in args)
                {
                    Contract.Assert(e != null);
                    if (!hasArgs)
                    {
                        wr.Write("({0}", opName);
                    }
                    wr.Write(" ");
                    ExprLineariser.Linearise(e, options);
                    hasArgs = true;
                }

                if (hasArgs)
                {
                    wr.Write(")");
                }
                else
                {
                    wr.Write("{0}", opName);
                }
            }
Exemplo n.º 2
0
        public static string ToString(VCExpr e, UniqueNamer namer, SMTLibProverOptions opts, ISet <VCExprVar> namedAssumes = null, IList <string> optReqs = null, ISet <VCExprVar> tryAssumes = null)
        {
            Contract.Requires(e != null);
            Contract.Requires(namer != null);
            Contract.Ensures(Contract.Result <string>() != null);

            StringWriter         sw  = new StringWriter();
            SMTLibExprLineariser lin = new SMTLibExprLineariser(sw, namer, opts, namedAssumes, optReqs);

            Contract.Assert(lin != null);
            lin.Linearise(e, LineariserOptions.Default);
            return(cce.NonNull(sw.ToString()));
        }