private Expr CreateValueExpr(ConstantDataTypes dataType, object value) { // Create a term for the new value in Z3 Expr newValue = null; switch (dataType) { // Bool case ConstantDataTypes.Boolean: bool boolValue = (bool)value; switch (boolValue) { case true: newValue = _context.MkTrue(); break; case false: newValue = _context.MkFalse(); break; } break; // Int case ConstantDataTypes.Integer: int intValue = (int)value; newValue = _context.MkInt(intValue); break; } return(newValue); }
// Constructor public Constant(string constantSID, ConstantDataTypes dataType, Expr expr) { _constantSID = constantSID; _dataType = dataType; _expr = expr; }