public BasicCmdIsaVisitor(IVariableTranslationFactory variableFactory) { this.variableFactory = variableFactory; boogieVarTranslation = variableFactory.CreateTranslation(); //by sharing TypeVarTranslation, changes in the bound variables will be visible in the type visitor typeIsaVisitor = new TypeIsaVisitor(boogieVarTranslation.TypeVarTranslation); }
public ApplicableIsaVisitor(TypeParamInstantiation typeInst, IList <Term> args, IVariableTranslation <TypeVariable> typeVarTranslation) { _typeInst = typeInst; _args = args; typeIsaVisitor = new TypeIsaVisitor(typeVarTranslation); }
/// <summary> /// Returns the properties associated with <paramref name="v"/> in its variable declaration. /// The first element of the result tuple is the type and the second element is the where clause. /// </summary> public static Tuple <Term, Term> VarDeclTuple(Variable v, TypeIsaVisitor typeIsaVisitor, Func <Absy, Term> boogieToIsa) { var vType = typeIsaVisitor.Translate(v.TypedIdent.Type); var vWhereClause = v.TypedIdent.WhereExpr != null ? IsaCommonTerms.SomeOption(boogieToIsa(v.TypedIdent.WhereExpr)) : IsaCommonTerms.NoneOption(); return(Tuple.Create(vType, vWhereClause)); }
/// <summary> /// Computes the variable declaration. /// </summary> /// <param name="v">input variable</param> /// <param name="id">id to be used for variable. If it is null, then the id will not be included in the result (in which case /// can instead invoke <see cref="VarDeclWithoutName"/>.</param> /// <param name="typeIsaVisitor">type isabelle visitor</param> /// <param name="boogieToIsa">boogie to isabelle translator</param> /// <returns>Variable declaration representation of <paramref name="v"/>. /// The identifier <paramref name="id"/> is excluded if it is null.</returns> public static Term VarDecl(Variable v, Term id, TypeIsaVisitor typeIsaVisitor, Func <Absy, Term> boogieToIsa) { var(vType, vWhereClause) = VarDeclTuple(v, typeIsaVisitor, boogieToIsa); if (id != null) { return(new TermTuple(new List <Term> { id, vType, vWhereClause })); } return(new TermTuple(new List <Term> { vType, vWhereClause })); }
public static Term VarDeclWithoutName(Variable v, TypeIsaVisitor typeIsaVisitor, Func <Absy, Term> boogieToIsa) { return(VarDecl(v, null, typeIsaVisitor, boogieToIsa)); }