Esempio n. 1
0
        ////////////////////////////////////////////////////////////////////////////////////
        //TODO: Old semantics - go to arguments?
        private Term makeExpression(BvConcatExpr bce, bool old)
        {
            ExpressionList arguments = new ExpressionList();

            arguments.append(makeExpression(bce.E0, old));
            arguments.append(makeExpression(bce.E1, old));

            return(new Programs.Terms.Boogie.BoogieFunctionApplication(bce, new Logic.Boogie.BoogieFunction(new BoogieBitVectorConcatenation(bce)), arguments));
        }
Esempio n. 2
0
        ////////////////////////////////////////////////////////////////////////////////////
        //TODO: Old semantics - go to arguments?
        private Term makeExpression(BvExtractExpr bee, bool old)
        {
            ExpressionList arguments = new ExpressionList();

            arguments.append(makeExpression(bee.Bitvector, old));
            //TODO: maybe no expression?
            arguments.append(new Boogie.BoogieFunctionApplication(bee, new Logic.Boogie.BoogieFunction(new BoogieIntegerConstant(bee.Start)), new ExpressionList()));
            arguments.append(new Boogie.BoogieFunctionApplication(bee, new Logic.Boogie.BoogieFunction(new BoogieIntegerConstant(bee.End)), new ExpressionList()));

            return(new Slicer.Programs.Terms.Boogie.BoogieFunctionApplication(bee, new Logic.Boogie.BoogieFunction(new BoogieBitVectorExtractor(bee)), arguments));
        }
Esempio n. 3
0
        ////////////////////////////////////////////////////////////////////////////////////
        internal ReferenceExpression makeReferenceExpression(MapAssignLhs assignLhs)
        {
            ReferenceExpression map = makeReferenceExpression(assignLhs.Map);

            ExpressionList indices = new ExpressionList();

//            indices.append(map);
            foreach (Microsoft.Boogie.Expr e in assignLhs.Indexes)
            {
                indices.append(makeExpression(e));
            }

            return(new Programs.Terms.Basic.MapLookup(map, indices));
        }
Esempio n. 4
0
        ////////////////////////////////////////////////////////////////////////////////////
        private void addMapLookupIndices(ExpressionList indices, NAryExpr fae, bool old)
        {
            bool first = true;

            foreach (Microsoft.Boogie.Expr e in fae.Args)
            {
                if (first)
                {
                    first = false;
                }
                else
                {
                    indices.append(makeExpression(e, old));
                }
            }
        }
Esempio n. 5
0
        ////////////////////////////////////////////////////////////////////////////////////
        //TODO: Old semantics - go to arguments?
        private Term makeExpression(NAryExpr fae, bool old)
        {
            if (fae.Fun.FunctionName.CompareTo("MapSelect") == 0)
            {
                return(makeMapLookupExpression(fae, old));
            }

            ExpressionList arguments = new ExpressionList();

            foreach (Microsoft.Boogie.Expr e in fae.Args)
            {
                arguments.append(makeExpression(e, old));
            }

            return(new Boogie.BoogieFunctionApplication(fae, new Logic.Boogie.BoogieFunction(new BoogieNAryFunction(fae)), arguments));
        }
Esempio n. 6
0
        ////////////////////////////////////////////////////////////////////////////////////
        private Term makeMapLookupExpression(NAryExpr fae, bool old)
        {
            ExpressionList      arguments = new ExpressionList();
            ReferenceExpression map       = null;

            foreach (Microsoft.Boogie.Expr e in fae.Args)
            {
                if (map == null)
                {
                    map = makeReferenceExpression(e);
                }
                else
                {
                    arguments.append(makeExpression(e, old));
                }
            }
            return(new Boogie.BoogieMapLookup(fae, map, arguments));

            throw new NotImplementedException();
        }