[Mlir-commits] [mlir] [mlir][SMT] upstream `SMT` dialect (PR #131480)

Fehr Mathieu llvmlistbot at llvm.org
Thu Apr 3 16:16:10 PDT 2025


================
@@ -0,0 +1,475 @@
+//===- SMTOps.td - SMT dialect operations ------------------*- tablegen -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef MLIR_DIALECT_SMT_SMTOPS_TD
+#define MLIR_DIALECT_SMT_SMTOPS_TD
+
+include "mlir/Dialect/SMT/IR/SMTDialect.td"
+include "mlir/Dialect/SMT/IR/SMTAttributes.td"
+include "mlir/Dialect/SMT/IR/SMTTypes.td"
+include "mlir/IR/EnumAttr.td"
+include "mlir/IR/OpAsmInterface.td"
+include "mlir/Interfaces/InferTypeOpInterface.td"
+include "mlir/Interfaces/SideEffectInterfaces.td"
+include "mlir/Interfaces/ControlFlowInterfaces.td"
+
+class SMTOp<string mnemonic, list<Trait> traits = []> :
+  Op<SMTDialect, mnemonic, traits>;
+
+def DeclareFunOp : SMTOp<"declare_fun", [
+  DeclareOpInterfaceMethods<OpAsmOpInterface, ["getAsmResultNames"]>
+]> {
+  let summary = "declare a symbolic value of a given sort";
----------------
math-fehr wrote:

I am wondering if we should keep the `declare_fun` name for this operation.
As far as I understand, this operation refers to both `declare-fun` and `declare-const`, so this could be a bit misleading.

The options I would see is either separate this method in two (`declare_const` and `declare_fun`), or rename it to `declare`.
I'm wondering if you have an opinion @maerhart as well?

https://github.com/llvm/llvm-project/pull/131480


More information about the Mlir-commits mailing list