45 return isa<BitVectorType>(
unwrap(type));
49 return wrap(BitVectorType::get(
unwrap(ctx), width));
53 return wrap(BitVectorType::name);
73 return isa<SMTFuncType>(
unwrap(type));
77 const MlirType *domainTypes,
80 domainTypesVec.reserve(numberOfDomainTypes);
82 for (
size_t i = 0; i < numberOfDomainTypes; i++)
83 domainTypesVec.push_back(
unwrap(domainTypes[i]));
85 return wrap(SMTFuncType::get(
unwrap(ctx), domainTypesVec,
unwrap(rangeType)));
91 size_t numberOfSortParams,
92 const MlirType *sortParams) {
94 sortParamsVec.reserve(numberOfSortParams);
96 for (
size_t i = 0; i < numberOfSortParams; i++)
97 sortParamsVec.push_back(
unwrap(sortParams[i]));
107 return symbolizeBVCmpPredicate(
unwrap(str)).has_value();
111 return symbolizeIntPredicate(
unwrap(str)).has_value();
115 return isa<BitVectorAttr, BVCmpPredicateAttr, IntPredicateAttr>(
unwrap(attr));
120 return wrap(BitVectorAttr::get(
unwrap(ctx), value, width));
124 auto predicate = symbolizeBVCmpPredicate(
unwrap(str));
125 assert(predicate.has_value() &&
"invalid predicate");
127 return wrap(BVCmpPredicateAttr::get(
unwrap(ctx), predicate.value()));
131 auto predicate = symbolizeIntPredicate(
unwrap(str));
132 assert(predicate.has_value() &&
"invalid predicate");
134 return wrap(IntPredicateAttr::get(
unwrap(ctx), predicate.value()));
#define MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(Name, Namespace, ClassName)
MlirAttribute mlirSMTAttrGetIntPredicate(MlirContext ctx, MlirStringRef str)
Creates a smt::IntPredicateAttr with the given string.
MlirStringRef mlirSMTIntTypeGetName(void)
bool mlirSMTTypeIsASMTFunc(MlirType type)
Checks if the given type is a smt::FuncType.
MlirAttribute mlirSMTAttrGetBitVector(MlirContext ctx, uint64_t value, unsigned width)
Creates a smt::BitVectorAttr with the given value and width.
MlirType mlirSMTTypeGetArray(MlirContext ctx, MlirType domainType, MlirType rangeType)
Creates an array type with the given domain and range types.
bool mlirSMTTypeIsABool(MlirType type)
Checks if the given type is a smt::BoolType.
bool mlirSMTAttrCheckBVCmpPredicate(MlirContext ctx, MlirStringRef str)
Checks if the given string is a valid smt::BVCmpPredicate.
MlirType mlirSMTTypeGetInt(MlirContext ctx)
Creates a smt::IntType.
MlirType mlirSMTTypeGetBitVector(MlirContext ctx, int32_t width)
Creates a smt::BitVectorType with the given width.
MlirAttribute mlirSMTAttrGetBVCmpPredicate(MlirContext ctx, MlirStringRef str)
Creates a smt::BVCmpPredicateAttr with the given string.
bool mlirSMTTypeIsASort(MlirType type)
Checks if the given type is a smt::SortType.
MlirStringRef mlirSMTBoolTypeGetName(void)
bool mlirSMTAttrIsASMTAttribute(MlirAttribute attr)
Checks if the given attribute is a smt::SMTAttribute.
bool mlirSMTTypeIsAnySMTValueType(MlirType type)
Checks if the given type is any SMT value type.
bool mlirSMTTypeIsAArray(MlirType type)
Checks if the given type is a smt::ArrayType.
MlirType mlirSMTTypeGetBool(MlirContext ctx)
Creates a smt::BoolType.
MlirType mlirSMTTypeGetSort(MlirContext ctx, MlirIdentifier identifier, size_t numberOfSortParams, const MlirType *sortParams)
Creates a smt::SortType with the given identifier and sort parameters.
bool mlirSMTTypeIsAInt(MlirType type)
Checks if the given type is a smt::IntType.
MlirType mlirSMTTypeGetSMTFunc(MlirContext ctx, size_t numberOfDomainTypes, const MlirType *domainTypes, MlirType rangeType)
Creates a smt::FuncType with the given domain and range types.
bool mlirSMTAttrCheckIntPredicate(MlirContext ctx, MlirStringRef str)
Checks if the given string is a valid smt::IntPredicate.
MlirStringRef mlirSMTBitVectorTypeGetName(void)
bool mlirSMTTypeIsABitVector(MlirType type)
Checks if the given type is a smt::BitVectorType.
MLIR_CAPI_EXPORTED bool mlirSMTTypeIsAnyNonFuncSMTValueType(MlirType type)
Checks if the given type is any non-func SMT value type.
MlirDiagnostic wrap(mlir::Diagnostic &diagnostic)
mlir::Diagnostic & unwrap(MlirDiagnostic diagnostic)
bool isAnySMTValueType(mlir::Type type)
Returns whether the given type is an SMT value type.
bool isAnyNonFuncSMTValueType(mlir::Type type)
Returns whether the given type is an SMT value type (excluding functions).
Include the generated interface declarations.
A pointer to a sized fragment of a string, not necessarily null-terminated.