internal SatSolverHelper(ISatSolver satSolver, ValueMappings <Instruction> mappings) { Contract.Requires(satSolver != null); Contract.Requires(mappings != null); this.satSolver = satSolver; this.mappings = mappings; this.expressionMap = new Hashtable <Instruction, object>(); this.andOp = new Operation() { OperationCode = OperationCode.And }; this.orOp = new Operation() { OperationCode = OperationCode.Or }; }
/// <summary> /// Provides several maps from expressions to concrete and abstract values. /// </summary> public ValueMappings(IPlatformType platformType, ISatSolver /*?*/ satSolver = null) { Contract.Requires(platformType != null); if (satSolver != null) { this.satSolverHelper = new SatSolverHelper <Instruction>(satSolver, this); } this.Int8Interval = new Interval(new MetadataConstant() { Value = sbyte.MinValue, Type = platformType.SystemInt8 }, new MetadataConstant() { Value = sbyte.MaxValue, Type = platformType.SystemInt8 }); this.Int16Interval = new Interval(new MetadataConstant() { Value = short.MinValue, Type = platformType.SystemInt16 }, new MetadataConstant() { Value = short.MaxValue, Type = platformType.SystemInt16 }); this.Int32Interval = new Interval(new MetadataConstant() { Value = int.MinValue, Type = platformType.SystemInt32 }, new MetadataConstant() { Value = int.MaxValue, Type = platformType.SystemInt32 }); this.Int64Interval = new Interval(new MetadataConstant() { Value = long.MinValue, Type = platformType.SystemInt64 }, new MetadataConstant() { Value = long.MaxValue, Type = platformType.SystemInt64 }); this.UInt8Interval = new Interval(new MetadataConstant() { Value = byte.MinValue, Type = platformType.SystemUInt8 }, new MetadataConstant() { Value = byte.MaxValue, Type = platformType.SystemUInt8 }); this.UInt16Interval = new Interval(new MetadataConstant() { Value = ushort.MinValue, Type = platformType.SystemUInt16 }, new MetadataConstant() { Value = ushort.MaxValue, Type = platformType.SystemUInt16 }); this.UInt32Interval = new Interval(new MetadataConstant() { Value = uint.MinValue, Type = platformType.SystemUInt32 }, new MetadataConstant() { Value = uint.MaxValue, Type = platformType.SystemUInt32 }); this.UInt64Interval = new Interval(new MetadataConstant() { Value = ulong.MinValue, Type = platformType.SystemUInt64 }, new MetadataConstant() { Value = ulong.MaxValue, Type = platformType.SystemUInt64 }); }