//////////////////////////////////////////////////////////////////////////////////// //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)); }
//////////////////////////////////////////////////////////////////////////////////// //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)); }
//////////////////////////////////////////////////////////////////////////////////// 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)); }
//////////////////////////////////////////////////////////////////////////////////// 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)); } } }
//////////////////////////////////////////////////////////////////////////////////// //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)); }
//////////////////////////////////////////////////////////////////////////////////// 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(); }