MLIR 22.0.0git
SMT.h
Go to the documentation of this file.
1//===- SMT.h - C interface for the SMT dialect --------------------*- C -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef MLIR_C_DIALECT_SMT_H
10#define MLIR_C_DIALECT_SMT_H
11
12#include "mlir-c/IR.h"
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18//===----------------------------------------------------------------------===//
19// Dialect API.
20//===----------------------------------------------------------------------===//
21
23
24//===----------------------------------------------------------------------===//
25// Type API.
26//===----------------------------------------------------------------------===//
27
28/// Checks if the given type is any non-func SMT value type.
30
31/// Checks if the given type is any SMT value type.
33
34/// Checks if the given type is a smt::ArrayType.
35MLIR_CAPI_EXPORTED bool mlirSMTTypeIsAArray(MlirType type);
36
37/// Creates an array type with the given domain and range types.
38MLIR_CAPI_EXPORTED MlirType mlirSMTTypeGetArray(MlirContext ctx,
39 MlirType domainType,
40 MlirType rangeType);
41
42/// Checks if the given type is a smt::BitVectorType.
44
45/// Creates a smt::BitVectorType with the given width.
46MLIR_CAPI_EXPORTED MlirType mlirSMTTypeGetBitVector(MlirContext ctx,
47 int32_t width);
48
50
51/// Checks if the given type is a smt::BoolType.
52MLIR_CAPI_EXPORTED bool mlirSMTTypeIsABool(MlirType type);
53
54/// Creates a smt::BoolType.
55MLIR_CAPI_EXPORTED MlirType mlirSMTTypeGetBool(MlirContext ctx);
56
58
59/// Checks if the given type is a smt::IntType.
60MLIR_CAPI_EXPORTED bool mlirSMTTypeIsAInt(MlirType type);
61
62/// Creates a smt::IntType.
63MLIR_CAPI_EXPORTED MlirType mlirSMTTypeGetInt(MlirContext ctx);
64
66
67/// Checks if the given type is a smt::FuncType.
69
70/// Creates a smt::FuncType with the given domain and range types.
71MLIR_CAPI_EXPORTED MlirType mlirSMTTypeGetSMTFunc(MlirContext ctx,
72 size_t numberOfDomainTypes,
73 const MlirType *domainTypes,
74 MlirType rangeType);
75
76/// Checks if the given type is a smt::SortType.
77MLIR_CAPI_EXPORTED bool mlirSMTTypeIsASort(MlirType type);
78
79/// Creates a smt::SortType with the given identifier and sort parameters.
80MLIR_CAPI_EXPORTED MlirType mlirSMTTypeGetSort(MlirContext ctx,
81 MlirIdentifier identifier,
82 size_t numberOfSortParams,
83 const MlirType *sortParams);
84
85//===----------------------------------------------------------------------===//
86// Attribute API.
87//===----------------------------------------------------------------------===//
88
89/// Checks if the given string is a valid smt::BVCmpPredicate.
91 MlirStringRef str);
92
93/// Checks if the given string is a valid smt::IntPredicate.
95 MlirStringRef str);
96
97/// Checks if the given attribute is a smt::SMTAttribute.
98MLIR_CAPI_EXPORTED bool mlirSMTAttrIsASMTAttribute(MlirAttribute attr);
99
100/// Creates a smt::BitVectorAttr with the given value and width.
101MLIR_CAPI_EXPORTED MlirAttribute mlirSMTAttrGetBitVector(MlirContext ctx,
102 uint64_t value,
103 unsigned width);
104
105/// Creates a smt::BVCmpPredicateAttr with the given string.
106MLIR_CAPI_EXPORTED MlirAttribute
107mlirSMTAttrGetBVCmpPredicate(MlirContext ctx, MlirStringRef str);
108
109/// Creates a smt::IntPredicateAttr with the given string.
110MLIR_CAPI_EXPORTED MlirAttribute mlirSMTAttrGetIntPredicate(MlirContext ctx,
111 MlirStringRef str);
112
113#ifdef __cplusplus
114}
115#endif
116
117#endif // MLIR_C_DIALECT_SMT_H
MLIR_CAPI_EXPORTED MlirAttribute mlirSMTAttrGetIntPredicate(MlirContext ctx, MlirStringRef str)
Creates a smt::IntPredicateAttr with the given string.
Definition SMT.cpp:130
MLIR_CAPI_EXPORTED MlirType mlirSMTTypeGetSort(MlirContext ctx, MlirIdentifier identifier, size_t numberOfSortParams, const MlirType *sortParams)
Creates a smt::SortType with the given identifier and sort parameters.
Definition SMT.cpp:90
MLIR_CAPI_EXPORTED bool mlirSMTTypeIsASort(MlirType type)
Checks if the given type is a smt::SortType.
Definition SMT.cpp:88
MLIR_CAPI_EXPORTED MlirType mlirSMTTypeGetBitVector(MlirContext ctx, int32_t width)
Creates a smt::BitVectorType with the given width.
Definition SMT.cpp:48
MLIR_CAPI_EXPORTED bool mlirSMTTypeIsASMTFunc(MlirType type)
Checks if the given type is a smt::FuncType.
Definition SMT.cpp:72
MLIR_CAPI_EXPORTED bool mlirSMTTypeIsAnyNonFuncSMTValueType(MlirType type)
Checks if the given type is any non-func SMT value type.
Definition SMT.cpp:28
MLIR_CAPI_EXPORTED MlirStringRef mlirSMTBoolTypeGetName(void)
Definition SMT.cpp:62
MLIR_CAPI_EXPORTED MlirType mlirSMTTypeGetInt(MlirContext ctx)
Creates a smt::IntType.
Definition SMT.cpp:66
MLIR_CAPI_EXPORTED bool mlirSMTTypeIsAnySMTValueType(MlirType type)
Checks if the given type is any SMT value type.
Definition SMT.cpp:32
MLIR_CAPI_EXPORTED bool mlirSMTTypeIsABool(MlirType type)
Checks if the given type is a smt::BoolType.
Definition SMT.cpp:56
MLIR_CAPI_EXPORTED MlirType mlirSMTTypeGetSMTFunc(MlirContext ctx, size_t numberOfDomainTypes, const MlirType *domainTypes, MlirType rangeType)
Creates a smt::FuncType with the given domain and range types.
Definition SMT.cpp:76
MLIR_CAPI_EXPORTED bool mlirSMTAttrIsASMTAttribute(MlirAttribute attr)
Checks if the given attribute is a smt::SMTAttribute.
Definition SMT.cpp:114
MLIR_CAPI_EXPORTED bool mlirSMTTypeIsAInt(MlirType type)
Checks if the given type is a smt::IntType.
Definition SMT.cpp:64
MLIR_CAPI_EXPORTED MlirType mlirSMTTypeGetBool(MlirContext ctx)
Creates a smt::BoolType.
Definition SMT.cpp:58
MLIR_CAPI_EXPORTED bool mlirSMTAttrCheckBVCmpPredicate(MlirContext ctx, MlirStringRef str)
Checks if the given string is a valid smt::BVCmpPredicate.
Definition SMT.cpp:106
MLIR_CAPI_EXPORTED MlirAttribute mlirSMTAttrGetBVCmpPredicate(MlirContext ctx, MlirStringRef str)
Creates a smt::BVCmpPredicateAttr with the given string.
Definition SMT.cpp:123
MLIR_CAPI_EXPORTED MlirStringRef mlirSMTIntTypeGetName(void)
Definition SMT.cpp:70
MLIR_CAPI_EXPORTED MlirStringRef mlirSMTBitVectorTypeGetName(void)
Definition SMT.cpp:52
MLIR_CAPI_EXPORTED MlirType mlirSMTTypeGetArray(MlirContext ctx, MlirType domainType, MlirType rangeType)
Creates an array type with the given domain and range types.
Definition SMT.cpp:38
MLIR_CAPI_EXPORTED bool mlirSMTTypeIsAArray(MlirType type)
Checks if the given type is a smt::ArrayType.
Definition SMT.cpp:36
MLIR_CAPI_EXPORTED bool mlirSMTAttrCheckIntPredicate(MlirContext ctx, MlirStringRef str)
Checks if the given string is a valid smt::IntPredicate.
Definition SMT.cpp:110
MLIR_CAPI_EXPORTED MlirAttribute mlirSMTAttrGetBitVector(MlirContext ctx, uint64_t value, unsigned width)
Creates a smt::BitVectorAttr with the given value and width.
Definition SMT.cpp:118
MLIR_CAPI_EXPORTED bool mlirSMTTypeIsABitVector(MlirType type)
Checks if the given type is a smt::BitVectorType.
Definition SMT.cpp:44
#define MLIR_DECLARE_CAPI_DIALECT_REGISTRATION(Name, Namespace)
Definition IR.h:215
#define MLIR_CAPI_EXPORTED
Definition Support.h:46
A pointer to a sized fragment of a string, not necessarily null-terminated.
Definition Support.h:75