예제 #1
0
 public static TypeIsa BoogieFuncInterpType(TypeIsa absValType)
 {
     return(new ArrowType(IsaCommonTypes.GetListType(BoogieType()),
                          new ArrowType(IsaCommonTypes.GetListType(ValType(absValType)),
                                        IsaCommonTypes.GetOptionType(ValType(absValType)))
                          ));
 }
        public static TypeIsa GetDataTypeSingle(string name, TypeIsa arg)
        {
            var list = new List <TypeIsa> {
                arg
            };

            return(new DataType(name, list));
        }
예제 #3
0
 public static Term Let(Identifier boundVar, TypeIsa boundVarType, Term termSubst, Term body)
 {
     return(new TermApp(
                new TermApp(new TermIdent(new SimpleIdentifier("Let")), termSubst),
                TermQuantifier.Lambda(new List <Identifier> {
         boundVar
     },
                                      new List <TypeIsa> {
         boundVarType
     }, body)
                ));
 }
예제 #4
0
        private int HandleAbbrevOrDef(OuterDecl d, string topLevel, TypeIsa type, string equality,
                                      Tuple <IList <Term>, Term> equation)
        {
            _sb.Append(topLevel + " ").Append(d.Name);
            if (type != null)
            {
                _sb.Append(" :: ");
                AppendInner(_typeIsaPrinter.Visit(type));
            }

            _sb.AppendLine().Append(IsaPrettyPrinterHelper.Indent(1)).Append("where");
            _sb.AppendLine().Append(IsaPrettyPrinterHelper.Indent(2));

            var args = _termPrinter.VisitList(equation.Item1).SpaceAggregate();

            AppendInner(
                () => _sb.Append(d.Name).Append(" ").Append(args).Append(" " + equality + " ")
                .Append(_termPrinter.Visit(equation.Item2))
                );

            return(0);
        }
예제 #5
0
 //returns PureTyIsaTransformer that instantiates U and T with the concrete instantiations
 public static PureTyIsaTransformer ConretePureTyIsaTransformer(TypeIsa abstractValueType)
 {
     //instantiate type in VC representing Boogie values with Boogie value type
     //instantiate type in VC representing Boogie types with Boogie closed type
     return(new PureTyIsaTransformer(IsaBoogieType.ValType(abstractValueType), IsaBoogieVC.BoogieClosedType()));
 }
예제 #6
0
 public static TypeIsa StateType(TypeIsa absValType)
 {
     return(IsaCommonTypes.GetDataTypeSingle("state", absValType));
 }
예제 #7
0
 public static TypeIsa NormalStateType(TypeIsa absValType)
 {
     return(new DataType("nstate", new List <TypeIsa> {
         absValType
     }));
 }
예제 #8
0
 public static TypeIsa AbstractValueTyFunType(TypeIsa absValType)
 {
     return(new DataType("absval_ty_fun", new List <TypeIsa> {
         absValType
     }));
 }
예제 #9
0
 public static TypeIsa ValType(TypeIsa absValType)
 {
     return(new DataType("val", new List <TypeIsa> {
         absValType
     }));
 }
예제 #10
0
 public static TypeIsa FunInterpType(TypeIsa absValType)
 {
     return(new DataType("fun_interp", new List <TypeIsa> {
         absValType
     }));
 }
예제 #11
0
 public static TypeIsa GetListType(TypeIsa elemType)
 {
     return(GetDataTypeSingle("list", elemType));
 }
예제 #12
0
 public static TypeIsa GetSetType(TypeIsa elemType)
 {
     return(GetDataTypeSingle("set", elemType));
 }
예제 #13
0
 public static TypeIsa GetOptionType(TypeIsa elemType)
 {
     return(GetDataTypeSingle("option", elemType));
 }