45 return isa<BitVectorType>(
unwrap(type));
49 return wrap(BitVectorType::get(
unwrap(ctx), width));
53 return wrap(BitVectorType::name);
57 return wrap(BitVectorType::getTypeID());
69 return wrap(BoolType::getTypeID());
83 return isa<SMTFuncType>(
unwrap(type));
87 const MlirType *domainTypes,
90 domainTypesVec.reserve(numberOfDomainTypes);
92 for (
size_t i = 0; i < numberOfDomainTypes; i++)
93 domainTypesVec.push_back(
unwrap(domainTypes[i]));
95 return wrap(SMTFuncType::get(
unwrap(ctx), domainTypesVec,
unwrap(rangeType)));
101 size_t numberOfSortParams,
102 const MlirType *sortParams) {
104 sortParamsVec.reserve(numberOfSortParams);
106 for (
size_t i = 0; i < numberOfSortParams; i++)
107 sortParamsVec.push_back(
unwrap(sortParams[i]));
117 return symbolizeBVCmpPredicate(
unwrap(str)).has_value();
121 return symbolizeIntPredicate(
unwrap(str)).has_value();
125 return isa<BitVectorAttr, BVCmpPredicateAttr, IntPredicateAttr>(
unwrap(attr));
130 return wrap(BitVectorAttr::get(
unwrap(ctx), value, width));
134 auto predicate = symbolizeBVCmpPredicate(
unwrap(str));
135 assert(predicate.has_value() &&
"invalid predicate");
137 return wrap(BVCmpPredicateAttr::get(
unwrap(ctx), predicate.value()));
141 auto predicate = symbolizeIntPredicate(
unwrap(str));
142 assert(predicate.has_value() &&
"invalid predicate");
144 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.
MlirTypeID mlirSMTIntTypeGetTypeID(void)
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.
MlirTypeID mlirSMTBitVectorTypeGetTypeID(void)
MlirTypeID mlirSMTBoolTypeGetTypeID(void)
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.