Ejemplo n.º 1
0
 public TypeSymbolToSortMapper(CompilationInfo info, IEnumerable <ITypeSymbol> handleAsValueType)
 {
     _info              = info;
     BoolSortMapping    = new BoolSortMapping(_info);
     BigIntSortMapping  = new BigIntSortMapping(_info);
     _handleAsValueType = new HashSet <ITypeSymbol>(handleAsValueType);
 }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
 public DefaultValueEvaluator(CompilationInfo info)
     : base(info)
 {
 }
Ejemplo n.º 5
0
 public BoolSortMapping(CompilationInfo info)
     : base(info, info.Ctx.BoolSort)
 {
 }
Ejemplo n.º 6
0
 public BaseSortMapping(CompilationInfo info, TSort sort)
     : base(info)
 {
     _sort = sort;
 }
Ejemplo n.º 7
0
 public BaseSortMapping(CompilationInfo info)
     : base(info)
 {
 }
Ejemplo n.º 8
0
 public SortMapping(CompilationInfo info)
 {
     _info = info;
 }
Ejemplo n.º 9
0
 public BigIntSortMapping(CompilationInfo info)
     : base(info, info.Ctx.IntSort)
 {
 }
Ejemplo n.º 10
0
 public IntSortMapping(CompilationInfo info, bool isSigned, uint size)
     : base(info, info.Ctx.MkBitVecSort(size))
 {
     IsSigned = isSigned;
 }