Beispiel #1
0
 public TypeSymbolToSortMapper(CompilationInfo info, IEnumerable <ITypeSymbol> handleAsValueType)
 {
     _info              = info;
     BoolSortMapping    = new BoolSortMapping(_info);
     BigIntSortMapping  = new BigIntSortMapping(_info);
     _handleAsValueType = new HashSet <ITypeSymbol>(handleAsValueType);
 }
        public StructSortMapping(CompilationInfo info, INamedTypeSymbol symbol)
            : base(info)
        {
            Symbol = symbol;
            // The order of the following array fixes the order of the fields in the tuple
            FieldSymbols = Symbol.GetMembers().OfType <IFieldSymbol>().ToArray();
            if (!FieldSymbols.All(s => !s.IsStatic))
            {
                throw new SyntaxErrorException("Static fields are not supported");
            }
            // Get the sort mappings for the fields
            var fieldInfo = FieldSymbols.Select(s => new { Symbol = s, Mapping = Mapper.GetSortMapping(s.Type) });

            // Create the tuplesort with the fields' sorts
            Sort = Ctx.MkTupleSort(Mapper.CreateZ3Symbol(Symbol),
                                   fieldInfo.Select(x => Mapper.CreateZ3Symbol(x.Symbol)).ToArray(),
                                   fieldInfo.Select(x => x.Mapping.Sort).ToArray());
            FieldSortMappings = fieldInfo.Select(x => x.Mapping).ToArray();
            Mapper.RegisterStructSortMapping(this);
        }
        public TransducerSource(Z3Provider automataCtx, SemanticModel model, INamedTypeSymbol declarationType, INamedTypeSymbol transducerType)
            : base(declarationType)
        {
            Contract.Requires(!transducerType.IsUnboundGenericType);
            Contract.Requires(!declarationType.IsAbstract);

            if (declarationType.IsGenericType)
            {
                throw new SyntaxErrorException("");
            }

            _transducerType = transducerType;

            _info = new CompilationInfo
            {
                AutomataCtx = automataCtx,
                Model       = model,
            };
            _info.Mapper             = new TypeSymbolToSortMapper(_info, new ITypeSymbol[] { DeclarationType });
            _info.Lifter             = new MethodLifter(_info);
            _info.InvocationExplorer = new InvocationExplorer(_info);
        }
 public DefaultValueEvaluator(CompilationInfo info)
     : base(info)
 {
 }
Beispiel #5
0
 public BoolSortMapping(CompilationInfo info)
     : base(info, info.Ctx.BoolSort)
 {
 }
Beispiel #6
0
 public BaseSortMapping(CompilationInfo info, TSort sort)
     : base(info)
 {
     _sort = sort;
 }
Beispiel #7
0
 public BaseSortMapping(CompilationInfo info)
     : base(info)
 {
 }
Beispiel #8
0
 public SortMapping(CompilationInfo info)
 {
     _info = info;
 }
Beispiel #9
0
 public BigIntSortMapping(CompilationInfo info)
     : base(info, info.Ctx.IntSort)
 {
 }
Beispiel #10
0
 public IntSortMapping(CompilationInfo info, bool isSigned, uint size)
     : base(info, info.Ctx.MkBitVecSort(size))
 {
     IsSigned = isSigned;
 }