├── .dockerignore ├── include ├── Target │ ├── Btor │ │ ├── btor2parser │ │ │ ├── CMakeLists.txt │ │ │ ├── btor2mem.h │ │ │ ├── btor2stack.h │ │ │ └── btor2parser.h │ │ ├── CMakeLists.txt │ │ └── BtorIRToBtorTranslation.h │ └── CMakeLists.txt ├── Dialect │ ├── Btor │ │ ├── CMakeLists.txt │ │ └── IR │ │ │ ├── CMakeLists.txt │ │ │ ├── BtorTypes.td │ │ │ ├── BtorTypes.h │ │ │ ├── BtorAttributes.h │ │ │ ├── BtorBase.td │ │ │ ├── BtorAttributes.td │ │ │ └── Btor.h │ ├── Smt │ │ ├── CMakeLists.txt │ │ └── IR │ │ │ ├── CMakeLists.txt │ │ │ ├── SmtOps.td │ │ │ ├── Smt.h │ │ │ └── SmtBase.td │ └── CMakeLists.txt ├── CMakeLists.txt └── Conversion │ ├── CMakeLists.txt │ ├── Passes.h │ ├── BtorToArithmetic │ └── ConvertBtorToArithmeticPass.h │ ├── BtorToVector │ └── ConvertBtorToVectorPass.h │ ├── BtorNDToLLVM │ └── ConvertBtorNDToLLVMPass.h │ ├── BtorToLLVM │ └── ConvertBtorToLLVMPass.h │ └── Passes.td ├── lib ├── Target │ ├── CMakeLists.txt │ └── Btor │ │ └── CMakeLists.txt ├── Dialect │ ├── CMakeLists.txt │ ├── Smt │ │ ├── CMakeLists.txt │ │ └── IR │ │ │ ├── SmtOps.cpp │ │ │ └── SmtDialect.cpp │ └── Btor │ │ ├── CMakeLists.txt │ │ └── IR │ │ ├── BtorTypes.cpp │ │ ├── BtorDialect.cpp │ │ └── BtorAttributes.cpp ├── CMakeLists.txt └── Conversion │ ├── CMakeLists.txt │ ├── BtorToArithmetic │ └── CMakeLists.txt │ ├── BtorToVector │ ├── CMakeLists.txt │ └── BtorToVector.cpp │ ├── BtorToLLVM │ └── CMakeLists.txt │ ├── BtorNDToLLVM │ ├── CMakeLists.txt │ └── BtorNDToLLVM.cpp │ └── PassDetail.h ├── .gitignore ├── assets ├── btor2mlir.png └── strategies.png ├── utils └── cex │ ├── CMakeLists.txt │ ├── witness │ ├── configs │ │ ├── sea-vac.yaml │ │ ├── sea.yaml │ │ └── sea-cex.yaml │ ├── get_cex_seahorn.sh │ └── witness_generator.py │ ├── cex.h │ └── cex.cpp ├── test ├── Btor │ ├── div-export.btor │ ├── redor-export.btor │ ├── btor-translate.mlir │ ├── div_zero.btor │ ├── mod_zero.btor │ ├── rem_zero.btor │ ├── redor.btor │ ├── concat-export.btor │ ├── concat.btor │ ├── array.btor2 │ ├── interacting-init.btor │ ├── redor.btor.mlir │ ├── array-export.btor2 │ ├── mod_zero.btor.mlir │ ├── rem_zero.btor.mlir │ ├── interacting-init.export │ ├── div_zero.btor.mlir │ ├── concat.btor.mlir │ ├── wolf-19C.btor.mlir.opt.ll.smt2 │ ├── wolf-export.btor │ ├── wolf-19C.btor │ ├── div_zero.btor.mlir.opt.ll.smt2 │ ├── array.btor2.mlir │ ├── interacting-init.mlir │ ├── btor-opt.mlir │ ├── dummy.mlir │ ├── wolf-19C.btor.mlir │ ├── rem_zero.btor.mlir.opt │ ├── redor.btor.mlir.opt │ ├── div_zero.btor.mlir.opt │ ├── concat.btor.mlir.opt │ ├── array.btor2.mlir.opt │ ├── mod_zero.btor.mlir.opt │ ├── redor.btor.mlir.opt.ll.smt2 │ ├── wolf-19C.btor.mlir.opt │ ├── div_zero.btor.mlir.opt.ll │ ├── mod_zero.btor.mlir.opt.ll │ ├── rem_zero.btor.mlir.opt.ll │ ├── concat.btor.mlir.opt.ll │ ├── redor.btor.mlir.opt.ll │ ├── array.btor2.mlir.opt.ll │ └── wolf-19C.btor.mlir.opt.ll ├── CMakeLists.txt ├── Crab │ └── crab-opt.mlir ├── lit.cfg.py └── lit.site.cfg.py.in ├── results ├── 25-btormc │ ├── 25-btormc_19B_wolf_0202231740.csv │ ├── 25-btormc_20_0202231750.csv │ ├── 25-btormc_19_beem_0202231720.csv │ ├── 25-btormc_19A_wolf_0202231735.csv │ ├── 25-btormc_18D_wolf_0202231715.csv │ ├── 25-btormc_19_goel_0202231725.csv │ ├── 25-btormc_19_mann_0202231730.csv │ └── 25-btormc_19C_wolf_0202231740.csv ├── boolector │ ├── boolector_19B_wolf_0330231148.csv │ ├── boolector_20_0330231158.csv │ ├── boolector_19A_wolf_0330231148.csv │ ├── boolector_19_beem_0330231127.csv │ ├── boolector_18D_wolf_0330231124.csv │ ├── boolector_19_goel_0330231132.csv │ ├── boolector_19_mann_0330231142.csv │ └── boolector_19C_wolf_0330231148.csv ├── vcGen │ ├── vcGen_19B_wolf_0321231836.csv │ ├── vcGen_20_032123184.csv │ ├── vcGen_19A_wolf_0321231831.csv │ ├── vcGen_19_beem_0321231815.csv │ ├── vcGen_18D_wolf_0321231812.csv │ ├── vcGen_19_goel_0321231820.csv │ ├── vcGen_19_mann_0321231826.csv │ └── vcGen_19C_wolf_0321231836.csv └── seahorn │ ├── seahorn_19B_wolf_0321232002.csv │ ├── seahorn_20_0321232013.csv │ ├── seahorn_19A_wolf_0321231957.csv │ ├── seahorn_19_beem_0321231934.csv │ ├── seahorn_18D_wolf_0321231929.csv │ ├── seahorn_19_goel_0321231939.csv │ ├── seahorn_19_mann_0321231949.csv │ └── seahorn_19C_wolf_0321232002.csv ├── tools ├── smt2mlir-opt │ ├── CMakeLists.txt │ └── smt2mlir-opt.cpp ├── btor2mlir-opt │ ├── CMakeLists.txt │ └── btor2mlir-opt.cpp ├── smt2mlir-translate │ ├── CMakeLists.txt │ └── smt2mlir-translate.cpp └── btor2mlir-translate │ ├── CMakeLists.txt │ └── btor2mlir-translate.cpp ├── docker └── btor2mlir.Dockerfile ├── CMakeLists.txt └── README.md /.dockerignore: -------------------------------------------------------------------------------- 1 | debug 2 | release 3 | build 4 | -------------------------------------------------------------------------------- /include/Target/Btor/btor2parser/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/Target/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(Btor) 2 | -------------------------------------------------------------------------------- /include/Target/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(Btor) 2 | -------------------------------------------------------------------------------- /include/Dialect/Btor/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(IR) 2 | -------------------------------------------------------------------------------- /include/Dialect/Smt/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(IR) 2 | -------------------------------------------------------------------------------- /include/Target/Btor/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(btor2parser) 2 | -------------------------------------------------------------------------------- /include/Dialect/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(Btor) 2 | add_subdirectory(Smt) 3 | -------------------------------------------------------------------------------- /lib/Dialect/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(Btor) 2 | add_subdirectory(Smt) 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | debug 2 | build 3 | run-script.sh 4 | clang-debug 5 | .vscode 6 | hwmcc20 7 | -------------------------------------------------------------------------------- /assets/btor2mlir.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agurfinkel/btor2mlir/HEAD/assets/btor2mlir.png -------------------------------------------------------------------------------- /assets/strategies.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agurfinkel/btor2mlir/HEAD/assets/strategies.png -------------------------------------------------------------------------------- /lib/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(Conversion) 2 | add_subdirectory(Dialect) 3 | add_subdirectory(Target) 4 | -------------------------------------------------------------------------------- /include/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(Conversion) 2 | add_subdirectory(Dialect) 3 | add_subdirectory(Target) 4 | -------------------------------------------------------------------------------- /utils/cex/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(cex 2 | cex.cpp) 3 | 4 | install (TARGETS cex 5 | LIBRARY DESTINATION lib 6 | ARCHIVE DESTINATION lib) 7 | -------------------------------------------------------------------------------- /test/Btor/div-export.btor: -------------------------------------------------------------------------------- 1 | 1 sort bitvec 5 2 | 2 constd 1 -1 3 | 3 constd 1 0 4 | 4 constd 1 6 5 | 5 udiv 1 4 3 6 | 6 sort bitvec 1 7 | 7 eq 6 5 2 8 | 8 bad 7 9 | -------------------------------------------------------------------------------- /lib/Conversion/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(BtorToArithmetic) 2 | add_subdirectory(BtorToLLVM) 3 | add_subdirectory(BtorToVector) 4 | add_subdirectory(BtorNDToLLVM) 5 | -------------------------------------------------------------------------------- /test/Btor/redor-export.btor: -------------------------------------------------------------------------------- 1 | 1 sort bitvec 1 2 | 2 constd 1 0 3 | 3 state 1 4 | 4 init 1 3 2 5 | 5 sort bitvec 8 6 | 6 input 5 7 | 7 redand 1 6 8 | 8 bad 3 9 | 9 next 1 3 7 10 | -------------------------------------------------------------------------------- /test/Btor/btor-translate.mlir: -------------------------------------------------------------------------------- 1 | // RUN: btor2mlir-translate --help | FileCheck %s 2 | // CHECK: --deserialize-spirv 3 | // CHECK: --import-llvm 4 | // CHECK: --mlir-to-llvmir 5 | // CHECK: --serialize-spirv 6 | -------------------------------------------------------------------------------- /results/25-btormc/25-btormc_19B_wolf_0202231740.csv: -------------------------------------------------------------------------------- 1 | index,btor_time,status 2 | marlann_compute_cp_fail1-p2.btor,0.742,unsat 3 | marlann_compute_cp_fail2-p0.btor,1.141,unsat 4 | marlann_compute_cp_pass-p2.btor,0.417,unsat 5 | -------------------------------------------------------------------------------- /results/boolector/boolector_19B_wolf_0330231148.csv: -------------------------------------------------------------------------------- 1 | index,btor_time,status 2 | marlann_compute_cp_fail1-p2.btor,0.301,unsat 3 | marlann_compute_cp_fail2-p0.btor,2.103,unsat 4 | marlann_compute_cp_pass-p2.btor,0.302,unsat 5 | -------------------------------------------------------------------------------- /test/Btor/div_zero.btor: -------------------------------------------------------------------------------- 1 | ; division by zero should return -1 2 | ; sat in first cycle 3 | 1 sort bitvec 5 4 | 2 zero 1 5 | 3 ones 1 6 | 4 constd 1 6 7 | 5 udiv 1 4 2 8 | 6 sort bitvec 1 9 | 7 eq 6 5 3 10 | 8 bad 7 11 | -------------------------------------------------------------------------------- /test/Btor/mod_zero.btor: -------------------------------------------------------------------------------- 1 | ; modulus by zero should return lhs 2 | ; sat in first cycle 3 | 1 sort bitvec 5 4 | 2 zero 1 5 | 3 ones 1 6 | 4 constd 1 6 7 | 5 smod 1 4 2 8 | 6 sort bitvec 1 9 | 7 eq 6 5 4 10 | 8 bad 7 11 | -------------------------------------------------------------------------------- /test/Btor/rem_zero.btor: -------------------------------------------------------------------------------- 1 | ; rem with zero should return lhs 2 | ; sat in first cycle 3 | 1 sort bitvec 5 4 | 2 zero 1 5 | 3 ones 1 6 | 4 constd 1 6 7 | 5 urem 1 4 2 8 | 6 sort bitvec 1 9 | 7 eq 6 5 4 10 | 8 bad 7 11 | -------------------------------------------------------------------------------- /results/vcGen/vcGen_19B_wolf_0321231836.csv: -------------------------------------------------------------------------------- 1 | base,Cpu,Mem,BMC,seahorn_total,Result 2 | marlann_compute_cp_fail1-p2.btor,6.99,398,0.27,0.53, 3 | marlann_compute_cp_pass-p2.btor,7.12,399,0.28,0.56, 4 | marlann_compute_cp_fail2-p0.btor,7.12,395,0.25,0.52, 5 | -------------------------------------------------------------------------------- /test/Btor/redor.btor: -------------------------------------------------------------------------------- 1 | ; expect sat in 2 2 | 1 sort bitvec 8 3 | 2 input 1 4 | 3 sort bitvec 1 5 | 4 zero 3 6 | 5 state 3 7 | 6 init 3 5 4 8 | 7 redand 3 2 9 | 8 next 3 5 7 10 | 9 bad 5 11 | ;7 zero 1 12 | ;8 redxor 3 2 13 | ;9 next 3 5 8 14 | ;10 bad 5 15 | -------------------------------------------------------------------------------- /test/Btor/concat-export.btor: -------------------------------------------------------------------------------- 1 | 1 sort bitvec 8 2 | 2 constd 1 0 3 | 3 state 1 4 | 4 init 1 3 2 5 | 5 sort bitvec 1 6 | 6 constd 5 0 7 | 7 sort bitvec 7 8 | 8 constd 7 -1 9 | 9 concat 1 8 6 10 | 10 constd 1 -2 11 | 11 eq 5 3 10 12 | 12 bad 11 13 | 13 next 1 3 9 14 | -------------------------------------------------------------------------------- /results/seahorn/seahorn_19B_wolf_0321232002.csv: -------------------------------------------------------------------------------- 1 | base,Cpu,Mem,BMC,seahorn_total,Result 2 | marlann_compute_cp_pass-p2.btor,6.63,425,0.15,0.42,TRUE 3 | marlann_compute_cp_fail1-p2.btor,6.78,425,0.14,0.42,TRUE 4 | marlann_compute_cp_fail2-p0.btor,7.64,691,0.93,1.21,TRUE 5 | -------------------------------------------------------------------------------- /include/Dialect/Smt/IR/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(LLVM_TARGET_DEFINITIONS SmtOps.td) 2 | mlir_tablegen(SmtOpsEnums.h.inc -gen-enum-decls) 3 | mlir_tablegen(SmtOpsEnums.cpp.inc -gen-enum-defs) 4 | add_mlir_dialect(SmtOps smt) 5 | 6 | add_mlir_doc(SmtOps SmtOps Dialects/ -gen-op-doc) 7 | -------------------------------------------------------------------------------- /test/Btor/concat.btor: -------------------------------------------------------------------------------- 1 | ; sat in second step 2 | 1 sort bitvec 8 3 | 2 sort bitvec 7 4 | 3 sort bitvec 1 5 | 4 zero 3 6 | 5 ones 2 7 | 6 zero 1 8 | 7 const 1 11111110 9 | 8 concat 1 5 4 10 | 9 state 1 11 | 10 init 1 9 6 12 | 11 next 1 9 8 13 | 12 eq 3 9 7 14 | 13 bad 12 15 | -------------------------------------------------------------------------------- /test/Btor/array.btor2: -------------------------------------------------------------------------------- 1 | 1 sort bitvec 4 2 | 2 sort array 1 1 3 | 3 one 1 4 | 4 constd 1 8 5 | 5 state 2 6 | 6 init 2 5 3 7 | 7 read 1 5 4 8 | 8 one 1 9 | 9 add 1 7 8 10 | 10 write 2 5 4 9 11 | 11 next 2 5 10 12 | 12 ones 1 13 | 13 sort bitvec 1 14 | 14 eq 13 7 12 15 | 15 bad 14 16 | -------------------------------------------------------------------------------- /test/Btor/interacting-init.btor: -------------------------------------------------------------------------------- 1 | 1 sort bitvec 8 2 | 2 input 1 3 | 3 sort bitvec 1 4 | 4 zero 1 5 | 5 state 1 6 | 6 add 1 5 2 7 | 7 init 1 5 4 8 | 8 state 1 9 | 9 init 1 8 6 10 | 10 eq 3 5 6 11 | 11 bad 10 12 | 12 state 1 13 | 13 and 1 12 4 14 | 14 state 1 15 | 15 init 1 14 13 16 | 17 | -------------------------------------------------------------------------------- /test/Btor/redor.btor.mlir: -------------------------------------------------------------------------------- 1 | module { 2 | func @main() { 3 | %0 = btor.constant false 4 | br ^bb1(%0 : i1) 5 | ^bb1(%1: i1): // 2 preds: ^bb0, ^bb1 6 | %2 = btor.input 0 : i8 7 | %3 = btor.redand %2 : i8 8 | btor.assert_not(%1) 9 | br ^bb1(%3 : i1) 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /test/Btor/array-export.btor2: -------------------------------------------------------------------------------- 1 | 1 sort bitvec 4 2 | 2 constd 1 1 3 | 3 sort array 1 1 4 | 4 state 3 5 | 5 init 3 4 2 6 | 6 constd 1 1 7 | 7 constd 1 -8 8 | 8 read 1 4 7 9 | 9 add 1 8 6 10 | 10 write 3 4 7 9 11 | 11 constd 1 -1 12 | 12 sort bitvec 1 13 | 13 eq 12 8 11 14 | 14 bad 13 15 | 15 next 3 4 10 16 | -------------------------------------------------------------------------------- /test/Btor/mod_zero.btor.mlir: -------------------------------------------------------------------------------- 1 | module { 2 | func @main() { 3 | br ^bb1 4 | ^bb1: // 2 preds: ^bb0, ^bb1 5 | %0 = btor.constant 6 : i5 6 | %1 = btor.constant 0 : i5 7 | %2 = btor.smod %0, %1 : i5 8 | %3 = btor.cmp eq, %2, %0 : i5 9 | btor.assert_not(%3) 10 | br ^bb1 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /test/Btor/rem_zero.btor.mlir: -------------------------------------------------------------------------------- 1 | module { 2 | func @main() { 3 | br ^bb1 4 | ^bb1: // 2 preds: ^bb0, ^bb1 5 | %0 = btor.constant 6 : i5 6 | %1 = btor.constant 0 : i5 7 | %2 = btor.urem %0, %1 : i5 8 | %3 = btor.cmp eq, %2, %0 : i5 9 | btor.assert_not(%3) 10 | br ^bb1 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/Dialect/Smt/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_mlir_dialect_library(MLIRSmt 2 | IR/SmtDialect.cpp 3 | IR/SmtOps.cpp 4 | 5 | ADDITIONAL_HEADER_DIRS 6 | ${PROJECT_SOURCE_DIR}/include/Dialect/Smt 7 | 8 | DEPENDS 9 | MLIRSmtOpsIncGen 10 | 11 | LINK_LIBS PUBLIC 12 | MLIRIR 13 | ) 14 | -------------------------------------------------------------------------------- /test/Btor/interacting-init.export: -------------------------------------------------------------------------------- 1 | 1 sort bitvec 8 2 | 2 constd 1 0 3 | 3 input 1 4 | 4 add 1 2 3 5 | 5 state 1 6 | 6 and 1 5 2 7 | 7 state 1 8 | 8 state 1 9 | 9 state 1 10 | 10 init 1 7 2 11 | 11 init 1 8 4 12 | 12 init 1 9 6 13 | 13 input 1 14 | 14 add 1 7 13 15 | 15 sort bitvec 1 16 | 16 eq 15 7 14 17 | 17 bad 16 18 | -------------------------------------------------------------------------------- /lib/Conversion/BtorToArithmetic/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_mlir_conversion_library(MLIRBtorToArithmetic 2 | BtorToArithmetic.cpp 3 | 4 | ADDITIONAL_HEADER_DIRS 5 | ${PROJECT_SOURCE_DIR}/Conversion/BtorToArithmetic 6 | 7 | DEPENDS 8 | BTORConversionPassIncGen 9 | 10 | LINK_LIBS PUBLIC 11 | MLIRIR 12 | ) -------------------------------------------------------------------------------- /lib/Conversion/BtorToVector/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_mlir_conversion_library(MLIRBtorToVector 2 | BtorToVector.cpp 3 | 4 | ADDITIONAL_HEADER_DIRS 5 | ${PROJECT_SOURCE_DIR}/Conversion/BtorToVector 6 | 7 | DEPENDS 8 | BTORConversionPassIncGen 9 | 10 | LINK_LIBS PUBLIC 11 | MLIRIR 12 | MLIRVector 13 | ) -------------------------------------------------------------------------------- /test/Btor/div_zero.btor.mlir: -------------------------------------------------------------------------------- 1 | module { 2 | func @main() { 3 | br ^bb1 4 | ^bb1: // 2 preds: ^bb0, ^bb1 5 | %0 = btor.constant -1 : i5 6 | %1 = btor.constant 0 : i5 7 | %2 = btor.constant 6 : i5 8 | %3 = btor.udiv %2, %1 : i5 9 | %4 = btor.cmp eq, %3, %0 : i5 10 | btor.assert_not(%4) 11 | br ^bb1 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /lib/Target/Btor/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_mlir_dialect_library(MLIRBtorTranslate 2 | BtorToBtorIRTranslation.cpp 3 | BtorIRToBtorTranslation.cpp 4 | ${PROJECT_SOURCE_DIR}/include/Target/Btor/btor2parser/btor2parser.c 5 | 6 | ADDITIONAL_HEADER_DIRS 7 | ${PROJECT_SOURCE_DIR}/include/Target/Btor 8 | 9 | LINK_LIBS PUBLIC 10 | MLIRIR 11 | ) 12 | -------------------------------------------------------------------------------- /include/Conversion/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(LLVM_TARGET_DEFINITIONS Passes.td) 2 | mlir_tablegen(Passes.h.inc -gen-pass-decls -name BtorConversion) 3 | mlir_tablegen(Passes.capi.h.inc -gen-pass-capi-header --prefix BtorConversion) 4 | mlir_tablegen(Passes.capi.cpp.inc -gen-pass-capi-impl --prefix BtorConversion) 5 | add_public_tablegen_target(BTORConversionPassIncGen) 6 | 7 | add_mlir_doc(Passes BtorConversionPasses ./ -gen-pass-doc) -------------------------------------------------------------------------------- /test/Btor/concat.btor.mlir: -------------------------------------------------------------------------------- 1 | module { 2 | func @main() { 3 | %0 = btor.constant 0 : i8 4 | br ^bb1(%0 : i8) 5 | ^bb1(%1: i8): // 2 preds: ^bb0, ^bb1 6 | %2 = btor.constant false 7 | %3 = btor.constant -1 : i7 8 | %4 = btor.concat %3, %2 : i7, i1, i8 9 | %5 = btor.constant -2 : i8 10 | %6 = btor.cmp eq, %1, %5 : i8 11 | btor.assert_not(%6) 12 | br ^bb1(%4 : i8) 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /lib/Conversion/BtorToLLVM/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_mlir_conversion_library(MLIRBtorToLLVM 2 | BtorToLLVM.cpp 3 | 4 | ADDITIONAL_HEADER_DIRS 5 | ${PROJECT_SOURCE_DIR}/Conversion/BtorToLLVM 6 | 7 | DEPENDS 8 | BTORConversionPassIncGen 9 | intrinsics_gen 10 | 11 | LINK_COMPONENTS 12 | Core 13 | 14 | LINK_LIBS PUBLIC 15 | MLIRLLVMCommonConversion 16 | MLIRLLVMIR 17 | MLIRTransforms 18 | ) -------------------------------------------------------------------------------- /test/Btor/wolf-19C.btor.mlir.opt.ll.smt2: -------------------------------------------------------------------------------- 1 | (declare-fun main@entry_0 () Bool) 2 | (declare-fun main@entry.split_0 () Bool) 3 | (declare-fun sea.sp0_0 () (_ BitVec 64)) 4 | 5 | (assert (and (= #b000 ((_ extract 2 0) sea.sp0_0)) 6 | (bvule sea.sp0_0 #x00000000c0000000) 7 | (bvuge sea.sp0_0 #x00000000bf700000) 8 | (=> main@entry.split_0 (and main@entry.split_0 main@entry_0)) 9 | main@entry.split_0)) 10 | (check-sat) 11 | -------------------------------------------------------------------------------- /lib/Dialect/Btor/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_mlir_dialect_library(MLIRBtor 2 | IR/BtorDialect.cpp 3 | IR/BtorOps.cpp 4 | IR/BtorTypes.cpp 5 | IR/BtorAttributes.cpp 6 | 7 | ADDITIONAL_HEADER_DIRS 8 | ${PROJECT_SOURCE_DIR}/include/Dialect/Btor 9 | 10 | DEPENDS 11 | MLIRBtorOpsIncGen 12 | BtorAttributesIncGen 13 | 14 | LINK_LIBS PUBLIC 15 | MLIRDialect 16 | MLIRIR 17 | ) 18 | -------------------------------------------------------------------------------- /lib/Conversion/BtorNDToLLVM/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_mlir_conversion_library(MLIRBtorNDToLLVM 2 | BtorNDToLLVM.cpp 3 | 4 | ADDITIONAL_HEADER_DIRS 5 | ${PROJECT_SOURCE_DIR}/Conversion/BtorNDToLLVM 6 | 7 | DEPENDS 8 | BTORConversionPassIncGen 9 | intrinsics_gen 10 | 11 | LINK_COMPONENTS 12 | Core 13 | 14 | LINK_LIBS PUBLIC 15 | MLIRLLVMCommonConversion 16 | MLIRLLVMIR 17 | MLIRTransforms 18 | ) -------------------------------------------------------------------------------- /test/Btor/wolf-export.btor: -------------------------------------------------------------------------------- 1 | 1 sort bitvec 1 2 | 2 constd 1 0 3 | 3 state 1 4 | 4 state 1 5 | 5 sort bitvec 33 6 | 6 state 5 7 | 7 state 5 8 | 8 init 1 3 2 9 | 9 init 1 4 2 10 | 10 constd 1 -1 11 | 11 xnor 5 6 7 12 | 12 constd 5 2 13 | 13 constd 5 2 14 | 14 slice 1 11 2 2 15 | 15 not 1 14 16 | 16 and 1 4 15 17 | 17 and 1 16 10 18 | 18 constd 5 50 19 | 19 and 1 3 10 20 | 20 bad 19 21 | 21 next 1 3 17 22 | 22 next 1 4 10 23 | 23 next 5 6 18 24 | 24 next 5 7 18 25 | -------------------------------------------------------------------------------- /test/Btor/wolf-19C.btor: -------------------------------------------------------------------------------- 1 | ; should be unsat (tests xnor, xor operations) 2 | 1 sort bitvec 1 3 | 2 sort bitvec 33 4 | 3 const 1 0 5 | 4 const 1 1 6 | 5 state 1 state0 7 | 6 init 1 5 3 8 | 7 and 1 5 4 9 | 8 bad 7 10 | 9 state 1 state1 11 | 10 init 1 9 3 12 | 11 state 2 state2 13 | 12 state 2 state3 14 | 13 xnor 2 11 12 15 | 14 slice 1 13 2 2 16 | 15 not 1 14 17 | 16 and 1 9 15 18 | 17 and 1 16 4 19 | 18 next 1 5 17 20 | 19 next 1 9 4 21 | 20 constd 2 50 22 | 21 next 2 11 20 23 | 22 next 2 12 20 24 | -------------------------------------------------------------------------------- /results/25-btormc/25-btormc_20_0202231750.csv: -------------------------------------------------------------------------------- 1 | index,btor_time,status 2 | rast-p00.btor,166.635,unsat 3 | rast-p01.btor,1.693,unsat 4 | rast-p03.btor,0.038,sat 5 | rast-p04.btor,1.738,unsat 6 | rast-p06.btor,0.033,sat 7 | rast-p11.btor,2.758,unsat 8 | rast-p14.btor,299.446, 9 | rast-p16.btor,11.381,unsat 10 | rast-p17.btor,4.23,unsat 11 | rast-p18.btor,0.06,sat 12 | rast-p19.btor,0.04,sat 13 | rast-p21.btor,1.894,unsat 14 | simple_alu.btor,0.01,unsat 15 | stack-p1.btor,0.013,sat 16 | stack-p2.btor,0.588,unsat 17 | -------------------------------------------------------------------------------- /tools/smt2mlir-opt/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS) 2 | get_property(conversion_libs GLOBAL PROPERTY MLIR_CONVERSION_LIBS) 3 | set(LIBS 4 | ${dialect_libs} 5 | ${conversion_libs} 6 | MLIROptLib 7 | MLIRSmt 8 | ) 9 | add_llvm_executable(smt2mlir-opt smt2mlir-opt.cpp) 10 | 11 | llvm_update_compile_flags(smt2mlir-opt) 12 | target_link_libraries(smt2mlir-opt PRIVATE ${LIBS}) 13 | 14 | mlir_check_all_link_libraries(smt2mlir-opt) 15 | -------------------------------------------------------------------------------- /utils/cex/witness/configs/sea-vac.yaml: -------------------------------------------------------------------------------- 1 | verify_options: 2 | # Unify all assumes - needed for Vacuity check 3 | horn-unify-assumes: true 4 | # don't ignore control flow 5 | horn-vcgen-only-dataflow: false 6 | # don't reduce by data dependence 7 | horn-bmc-coi: false 8 | horn-bv2-vacuity-check: "all" 9 | # unwinding assertions 10 | # Note: checked only by the incremental checking during vacuity 11 | assert-on-backedge: true 12 | # evaluate branch sentinel intrinsic 13 | eval-branch-sentinel: '' -------------------------------------------------------------------------------- /results/boolector/boolector_20_0330231158.csv: -------------------------------------------------------------------------------- 1 | index,btor_time,status 2 | rast-p00.btor,129.068,unsat 3 | rast-p01.btor,1.198,unsat 4 | rast-p03.btor,0.172,sat 5 | rast-p04.btor,1.569,unsat 6 | rast-p06.btor,0.054,sat 7 | rast-p11.btor,0.383,unsat 8 | rast-p14.btor,299.714,unknown 9 | rast-p16.btor,9.102,unsat 10 | rast-p17.btor,6.141,unsat 11 | rast-p18.btor,0.03,sat 12 | rast-p19.btor,0.063,sat 13 | rast-p21.btor,1.404,unsat 14 | simple_alu.btor,0.001, 15 | stack-p1.btor,12.076,sat 16 | stack-p2.btor,0.002,unsat 17 | -------------------------------------------------------------------------------- /tools/btor2mlir-opt/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS) 2 | get_property(conversion_libs GLOBAL PROPERTY MLIR_CONVERSION_LIBS) 3 | set(LIBS 4 | ${dialect_libs} 5 | ${conversion_libs} 6 | MLIROptLib 7 | MLIRBtor 8 | ) 9 | add_llvm_executable(btor2mlir-opt btor2mlir-opt.cpp) 10 | 11 | llvm_update_compile_flags(btor2mlir-opt) 12 | target_link_libraries(btor2mlir-opt PRIVATE ${LIBS}) 13 | 14 | mlir_check_all_link_libraries(btor2mlir-opt) 15 | -------------------------------------------------------------------------------- /lib/Dialect/Smt/IR/SmtOps.cpp: -------------------------------------------------------------------------------- 1 | //===- SmtOps.cpp - Smt dialect ops ---------------*- C++ -*-===// 2 | // 3 | // This file is licensed 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 | #include "Dialect/Smt/IR/Smt.h" 10 | 11 | #define GET_OP_CLASSES 12 | #include "Dialect/Smt/IR/SmtOps.cpp.inc" 13 | -------------------------------------------------------------------------------- /test/Btor/div_zero.btor.mlir.opt.ll.smt2: -------------------------------------------------------------------------------- 1 | ;; Produced with Z3_solver_to_string() 2 | (declare-fun sea.sp0_0 () (_ BitVec 64)) 3 | (declare-fun main@%_0_0 () Bool) 4 | (declare-fun main@entry_0 () Bool) 5 | (declare-fun main@entry.split_0 () Bool) 6 | (assert (= #b000 ((_ extract 2 0) sea.sp0_0))) 7 | (assert (bvule sea.sp0_0 #x00000000c0000000)) 8 | (assert (bvuge sea.sp0_0 #x00000000bf700000)) 9 | (assert (not main@%_0_0)) 10 | (assert (=> main@entry.split_0 (and main@entry.split_0 main@entry_0))) 11 | (assert main@entry.split_0) 12 | 13 | (check-sat) 14 | -------------------------------------------------------------------------------- /include/Dialect/Btor/IR/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(LLVM_TARGET_DEFINITIONS BtorOps.td) 2 | add_mlir_dialect(BtorOps btor) 3 | 4 | set(LLVM_TARGET_DEFINITIONS BtorAttributes.td) 5 | mlir_tablegen(BtorAttributes.h.inc -gen-attrdef-decls) 6 | mlir_tablegen(BtorAttributes.cpp.inc -gen-attrdef-defs) 7 | mlir_tablegen(BtorOpsEnums.h.inc -gen-enum-decls) 8 | mlir_tablegen(BtorOpsEnums.cpp.inc -gen-enum-defs) 9 | add_public_tablegen_target(BtorAttributesIncGen) 10 | 11 | add_mlir_doc(BtorAttributes BtorAttributes Dialects/ -gen-attrdef-doc) 12 | add_mlir_doc(BtorOps BtorOps Dialects/ -gen-op-doc) -------------------------------------------------------------------------------- /test/Btor/array.btor2.mlir: -------------------------------------------------------------------------------- 1 | module { 2 | func @main() { 3 | %0 = btor.constant 1 : i4 4 | %1 = btor.array %0 : vector<16xi4> 5 | br ^bb1(%1 : vector<16xi4>) 6 | ^bb1(%2: vector<16xi4>): // 2 preds: ^bb0, ^bb1 7 | %3 = btor.constant 1 : i4 8 | %4 = btor.constant -8 : i4 9 | %5 = btor.read %2[%4] : vector<16xi4>, i4 10 | %6 = btor.add %5, %3 : i4 11 | %7 = btor.write %6, %2[%4] : vector<16xi4> 12 | %8 = btor.constant -1 : i4 13 | %9 = btor.cmp eq, %5, %8 : i4 14 | btor.assert_not(%9) 15 | br ^bb1(%7 : vector<16xi4>) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /test/Btor/interacting-init.mlir: -------------------------------------------------------------------------------- 1 | module { 2 | func @main() { 3 | %0 = btor.constant 0 : i8 4 | %1 = btor.input 0 : i8 5 | %2 = btor.add %0, %1 : i8 6 | %3 = btor.nd_state 2 : i8 7 | %4 = btor.and %3, %0 : i8 8 | br ^bb1(%0, %2, %3, %4 : i8, i8, i8, i8) 9 | ^bb1(%5: i8, %6: i8, %7: i8, %8: i8): // 2 preds: ^bb0, ^bb1 10 | %9 = btor.input 0 : i8 11 | %10 = btor.add %5, %9 : i8 12 | %11 = btor.cmp eq, %5, %10 : i8 13 | btor.assert_not(%11) 14 | %12 = btor.nd_state 2 : i8 15 | br ^bb1(%5, %6, %12, %8 : i8, i8, i8, i8) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /utils/cex/cex.h: -------------------------------------------------------------------------------- 1 | //===- cex.h - Counter Example Harness for SeaHorn -----------------*- C++ -*-===// 2 | // 3 | // This file is licensed 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 | #ifndef CEX_H 9 | #define CEX_H 10 | 11 | extern "C" { 12 | 13 | extern void __VERIFIER_error(void); 14 | extern void __VERIFIER_assert(bool, int property); 15 | 16 | } 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /include/Conversion/Passes.h: -------------------------------------------------------------------------------- 1 | #ifndef BTOR_CONVERSION_PASSES_H 2 | #define BTOR_CONVERSION_PASSES_H 3 | 4 | #include "Conversion/BtorToArithmetic/ConvertBtorToArithmeticPass.h" 5 | #include "Conversion/BtorToLLVM/ConvertBtorToLLVMPass.h" 6 | #include "Conversion/BtorToVector/ConvertBtorToVectorPass.h" 7 | #include "Conversion/BtorNDToLLVM/ConvertBtorNDToLLVMPass.h" 8 | 9 | namespace mlir { 10 | namespace btor { 11 | /// Generate the code for registering conversion passes. 12 | #define GEN_PASS_REGISTRATION 13 | #include "Conversion/Passes.h.inc" 14 | } // namespace btor 15 | } // namespace mlir 16 | 17 | #endif // BTOR_CONVERSION_PASSES_H -------------------------------------------------------------------------------- /tools/smt2mlir-translate/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(LLVM_LINK_COMPONENTS 2 | Support 3 | ) 4 | 5 | get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS) 6 | get_property(translation_libs GLOBAL PROPERTY MLIR_TRANSLATION_LIBS) 7 | 8 | add_llvm_executable(smt2mlir-translate 9 | smt2mlir-translate.cpp 10 | ) 11 | llvm_update_compile_flags(smt2mlir-translate) 12 | target_link_libraries(smt2mlir-translate 13 | PRIVATE 14 | ${dialect_libs} 15 | ${translation_libs} 16 | MLIRIR 17 | MLIRParser 18 | MLIRPass 19 | MLIRSPIRV 20 | MLIRTranslation 21 | MLIRSupport 22 | ) 23 | 24 | mlir_check_link_libraries(smt2mlir-translate) 25 | -------------------------------------------------------------------------------- /tools/btor2mlir-translate/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(LLVM_LINK_COMPONENTS 2 | Support 3 | ) 4 | 5 | get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS) 6 | get_property(translation_libs GLOBAL PROPERTY MLIR_TRANSLATION_LIBS) 7 | 8 | add_llvm_executable(btor2mlir-translate 9 | btor2mlir-translate.cpp 10 | ) 11 | llvm_update_compile_flags(btor2mlir-translate) 12 | target_link_libraries(btor2mlir-translate 13 | PRIVATE 14 | ${dialect_libs} 15 | ${translation_libs} 16 | MLIRIR 17 | MLIRParser 18 | MLIRPass 19 | MLIRSPIRV 20 | MLIRTranslation 21 | MLIRSupport 22 | ) 23 | 24 | mlir_check_link_libraries(btor2mlir-translate) 25 | -------------------------------------------------------------------------------- /results/vcGen/vcGen_20_032123184.csv: -------------------------------------------------------------------------------- 1 | base,Cpu,Mem,BMC,seahorn_total,Result 2 | simple_alu.btor,0.70,562,,, 3 | stack-p2.btor,1.27,354,0.01,0.06, 4 | rast-p18.btor,2.54,365,0.04,0.27, 5 | rast-p06.btor,2.65,364,0.05,0.29, 6 | rast-p19.btor,2.69,368,0.05,0.29, 7 | rast-p03.btor,7.38,470,0.43,0.96, 8 | rast-p21.btor,8.88,507,0.53,1.16, 9 | stack-p1.btor,9.27,412,0.39,0.78, 10 | rast-p01.btor,17.37,658,1.14,2.28, 11 | rast-p04.btor,17.39,657,1.17,2.32, 12 | rast-p11.btor,38.76,1010,2.20,4.05, 13 | rast-p00.btor,40.26,1016,2.43,4.41, 14 | rast-p16.btor,41.01,1029,2.40,4.45, 15 | rast-p17.btor,41.20,1029,2.55,4.70, 16 | rast-p14.btor,41.80,1030,2.42,4.50, 17 | -------------------------------------------------------------------------------- /test/Btor/btor-opt.mlir: -------------------------------------------------------------------------------- 1 | // RUN: btor2mlir-opt %s | btor2mlir-opt | FileCheck %s 2 | 3 | module { 4 | func.func @next( %arg0: i3, %arg1: i3 ) -> (i3, i3) { 5 | // create assumption 6 | %cmp_ne = btor.cmp "ne", %arg0, %arg1 : i3 7 | btor.constraint ( %cmp_ne ) 8 | // apply transition relation 9 | %c_0 = btor.constant 1 : i3 10 | %add_1 = btor.add %arg0, %c_0 : i3 11 | %sub_1 = btor.sub %arg1, %c_0 : i3 12 | // create assertion 13 | %bad = btor.cmp "ne", %add_1, %sub_1 : i3 14 | %redop = btor.redand %bad : i1 15 | btor.assert_not ( %bad ) 16 | return %add_1, %sub_1 : i3, i3 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /test/Btor/dummy.mlir: -------------------------------------------------------------------------------- 1 | // RUN: btor2mlir-opt %s | btor2mlir-opt | FileCheck %s 2 | 3 | module { 4 | // CHECK-LABEL: func @bar() 5 | func.func @bar() { 6 | %0 = btor.constant 1 : i32 7 | %1 = btor.constant 2 : i3 8 | // CHECK: %{{.*}} = addi %{{.*}}, %{{.*}} : i32 9 | %res = btor.not %0 : i32 10 | %t = btor.concat %0, %1 : i32, i3, i35 11 | %05 = btor.constant 15 : i35 12 | %slice = btor.slice %05, %t, %t : i35, i1 13 | %ext = btor.uext %res : i32 to i35 14 | %cmp = btor.cmp "eq", %t, %ext : i35 15 | %ite = btor.ite %cmp, %t, %05 : i35 16 | // %res = btor.cmp "eq", %0, %0 : i32 17 | return 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | configure_lit_site_cfg( 2 | ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in 3 | ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py 4 | MAIN_CONFIG 5 | ${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py 6 | ) 7 | 8 | set(BTOR_TEST_DEPENDS 9 | FileCheck count not 10 | btor2mlir-opt 11 | btor2mlir-translate 12 | ) 13 | 14 | add_lit_testsuite(check-btor2mlir "Running the btor regression tests" 15 | ${CMAKE_CURRENT_BINARY_DIR} 16 | DEPENDS ${BTOR_TEST_DEPENDS} 17 | ) 18 | set_target_properties(check-btor2mlir PROPERTIES FOLDER "Tests") 19 | 20 | add_lit_testsuites(BTOR2MLIR ${CMAKE_CURRENT_SOURCE_DIR} DEPENDS ${BTOR_TEST_DEPENDS}) 21 | -------------------------------------------------------------------------------- /results/seahorn/seahorn_20_0321232013.csv: -------------------------------------------------------------------------------- 1 | base,Cpu,Mem,BMC,seahorn_total,Result 2 | simple_alu.btor,0.43,314,,0.00, 3 | stack-p2.btor,1.14,354,0.01,0.06,TRUE 4 | rast-p18.btor,2.39,415,0.09,0.33,FALSE 5 | rast-p06.btor,2.49,415,0.10,0.33,FALSE 6 | rast-p19.btor,2.56,415,0.09,0.33,FALSE 7 | rast-p03.btor,6.85,453,0.28,0.80,FALSE 8 | rast-p21.btor,8.10,492,0.48,1.10,TRUE 9 | rast-p01.btor,15.42,650,0.42,1.56,TRUE 10 | rast-p04.btor,15.47,652,0.40,1.52,TRUE 11 | rast-p11.btor,35.70,885,1.82,3.69,TRUE 12 | rast-p17.btor,41.46,1051,4.47,6.59,TRUE 13 | rast-p16.btor,44.27,1054,7.32,9.41,TRUE 14 | stack-p1.btor,48.26,1251,39.80,40.20,FALSE 15 | rast-p00.btor,149.75,1037,115.35,117.32,TRUE 16 | rast-p14.btor,34.00,448,,, 17 | -------------------------------------------------------------------------------- /test/Btor/wolf-19C.btor.mlir: -------------------------------------------------------------------------------- 1 | module { 2 | func @main() { 3 | %0 = btor.constant false 4 | %1 = btor.nd_state 2 : i33 5 | %2 = btor.nd_state 3 : i33 6 | br ^bb1(%0, %0, %1, %2 : i1, i1, i33, i33) 7 | ^bb1(%3: i1, %4: i1, %5: i33, %6: i33): // 2 preds: ^bb0, ^bb1 8 | %7 = btor.constant true 9 | %8 = btor.xnor %5, %6 : i33 10 | %9 = btor.constant 2 : i33 11 | %10 = btor.constant 2 : i33 12 | %11 = btor.slice %8, %9, %10 : i33, i1 13 | %12 = btor.not %11 : i1 14 | %13 = btor.and %4, %12 : i1 15 | %14 = btor.and %13, %7 : i1 16 | %15 = btor.constant 50 : i33 17 | %16 = btor.and %3, %7 : i1 18 | btor.assert_not(%16) 19 | br ^bb1(%14, %7, %15, %15 : i1, i1, i33, i33) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /results/boolector/boolector_19A_wolf_0330231148.csv: -------------------------------------------------------------------------------- 1 | index,btor_time 2 | picorv32_mutAX_nomem-p0.btor,0.001 3 | picorv32_mutAX_nomem-p2.btor,0.002 4 | picorv32_mutAX_nomem-p5.btor,0.001 5 | picorv32_mutAY_nomem-p1.btor,0.002 6 | picorv32_mutAY_nomem-p4.btor,0.002 7 | picorv32_mutAY_nomem-p6.btor,0.002 8 | picorv32_mutBX_nomem-p0.btor,0.002 9 | picorv32_mutBX_nomem-p5.btor,0.001 10 | picorv32_mutBX_nomem-p8.btor,0.002 11 | picorv32_mutBY_nomem-p1.btor,0.0 12 | picorv32_mutBY_nomem-p3.btor,0.002 13 | picorv32_mutBY_nomem-p4.btor,0.002 14 | picorv32_mutBY_nomem-p6.btor,0.002 15 | picorv32_mutBY_nomem-p7.btor,0.002 16 | picorv32_mutCX_nomem-p0.btor,0.001 17 | picorv32_mutCX_nomem-p8.btor,0.002 18 | picorv32_mutCY_nomem-p0.btor,0.002 19 | picorv32_mutCY_nomem-p3.btor,0.002 20 | -------------------------------------------------------------------------------- /test/Btor/rem_zero.btor.mlir.opt: -------------------------------------------------------------------------------- 1 | module attributes {llvm.data_layout = ""} { 2 | llvm.func @__VERIFIER_error() 3 | llvm.func @main() { 4 | llvm.br ^bb1 5 | ^bb1: // 2 preds: ^bb0, ^bb2 6 | %0 = llvm.mlir.constant(6 : i5) : i5 7 | %1 = llvm.mlir.constant(0 : i5) : i5 8 | %2 = llvm.mlir.constant(0 : i5) : i5 9 | %3 = llvm.urem %0, %1 : i5 10 | %4 = llvm.icmp "eq" %1, %2 : i5 11 | %5 = llvm.select %4, %0, %3 : i1, i5 12 | %6 = llvm.icmp "eq" %5, %0 : i5 13 | %7 = llvm.mlir.constant(true) : i1 14 | %8 = llvm.xor %6, %7 : i1 15 | llvm.cond_br %8, ^bb2, ^bb3 16 | ^bb2: // pred: ^bb1 17 | llvm.br ^bb1 18 | ^bb3: // pred: ^bb1 19 | llvm.call @__VERIFIER_error() : () -> () 20 | llvm.unreachable 21 | } 22 | } 23 | 24 | -------------------------------------------------------------------------------- /test/Btor/redor.btor.mlir.opt: -------------------------------------------------------------------------------- 1 | module attributes {llvm.data_layout = ""} { 2 | llvm.func @__VERIFIER_error() 3 | llvm.func @btor2mlir_print_input_num(i64, i64, i64) 4 | llvm.func @nd_bv8() -> i8 5 | llvm.func @main() { 6 | %0 = llvm.mlir.constant(false) : i1 7 | llvm.br ^bb1(%0 : i1) 8 | ^bb1(%1: i1): // 2 preds: ^bb0, ^bb2 9 | %2 = llvm.call @nd_bv8() : () -> i8 10 | %3 = llvm.trunc %2 : i8 to i8 11 | %4 = llvm.mlir.constant(-1 : i8) : i8 12 | %5 = llvm.icmp "eq" %3, %4 : i8 13 | %6 = llvm.mlir.constant(true) : i1 14 | %7 = llvm.xor %1, %6 : i1 15 | llvm.cond_br %7, ^bb2, ^bb3 16 | ^bb2: // pred: ^bb1 17 | llvm.br ^bb1(%5 : i1) 18 | ^bb3: // pred: ^bb1 19 | llvm.call @__VERIFIER_error() : () -> () 20 | llvm.unreachable 21 | } 22 | } 23 | 24 | -------------------------------------------------------------------------------- /results/25-btormc/25-btormc_19_beem_0202231720.csv: -------------------------------------------------------------------------------- 1 | index,btor_time,status 2 | anderson.3.prop1-back-serstep.btor2,0.368,sat 3 | at.6.prop1-back-serstep.btor2,80.771,sat 4 | blocks.4.prop1-back-serstep.btor2,299.529, 5 | brp2.2.prop1-func-interl.btor2,2.358,unsat 6 | brp2.3.prop1-back-serstep.btor2,4.601,unsat 7 | brp2.6.prop3-back-serstep.btor2,4.788,unsat 8 | elevator.4.prop1-func-interl.btor2,0.003, 9 | frogs.5.prop1-func-interl.btor2,88.887,unsat 10 | krebs.3.prop1-func-interl.btor2,0.94,unsat 11 | mcs.3.prop1-back-serstep.btor2,298.93399999999997, 12 | msmie.3.prop1-func-interl.btor2,298.13, 13 | peg_solitaire.3.prop1-back-serstep.btor2,299.767, 14 | pgm_protocol.3.prop5-func-interl.btor2,4.934,unsat 15 | pgm_protocol.7.prop1-back-serstep.btor2,15.755,unsat 16 | rushhour.4.prop1-func-interl.btor2,47.959,unsat 17 | -------------------------------------------------------------------------------- /results/boolector/boolector_19_beem_0330231127.csv: -------------------------------------------------------------------------------- 1 | index,btor_time,status 2 | anderson.3.prop1-back-serstep.btor2,4.816,sat 3 | at.6.prop1-back-serstep.btor2,0.001, 4 | blocks.4.prop1-back-serstep.btor2,299.818,unknown 5 | brp2.2.prop1-func-interl.btor2,1.068,unsat 6 | brp2.3.prop1-back-serstep.btor2,3.469,unsat 7 | brp2.6.prop3-back-serstep.btor2,2.951,unsat 8 | elevator.4.prop1-func-interl.btor2,4.884,unsat 9 | frogs.5.prop1-func-interl.btor2,16.506,unsat 10 | krebs.3.prop1-func-interl.btor2,0.001,unsat 11 | mcs.3.prop1-back-serstep.btor2,299.76800000000003,unknown 12 | msmie.3.prop1-func-interl.btor2,0.002, 13 | peg_solitaire.3.prop1-back-serstep.btor2,0.002, 14 | pgm_protocol.3.prop5-func-interl.btor2,0.002, 15 | pgm_protocol.7.prop1-back-serstep.btor2,0.002, 16 | rushhour.4.prop1-func-interl.btor2,18.395,unsat 17 | -------------------------------------------------------------------------------- /test/Crab/crab-opt.mlir: -------------------------------------------------------------------------------- 1 | module { 2 | func.func @main() -> i32 { 3 | %0 = crab.const 0 : i32 4 | %1 = crab.const 0 : i32 5 | cf.br ^bb1(%0, %1 : i32, i32) 6 | ^bb1(%2: i32, %3: i32): // 2 preds: ^bb0, ^bb2 7 | %4 = crab.havoc() : i32 8 | crab.nd_br ^bb2(%2, %4 : i32, i32), ^bb3(%4, %3 : i32, i32) 9 | ^bb2(%5: i32, %6: i32): // pred: ^bb1 10 | %7 = crab.const 9 : i32 11 | crab.assume ne(%5, %7) : i32 12 | %8 = crab.const 1 : i32 13 | %9 = crab.add(%2, %8) : i32 14 | %10 = crab.add(%3, %8) : i32 15 | cf.br ^bb1(%9, %10 : i32, i32) 16 | ^bb3(%11: i32, %12: i32): // pred: ^bb1 17 | %13 = crab.const 10 : i32 18 | crab.assume uge(%11, %13) : i32 19 | crab.assert eq(%11, %12) : i32 20 | %14 = crab.const 0 : i32 21 | return %14 : i32 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /results/25-btormc/25-btormc_19A_wolf_0202231735.csv: -------------------------------------------------------------------------------- 1 | index,btor_time,status 2 | picorv32_mutAX_nomem-p0.btor,298.122, 3 | picorv32_mutAX_nomem-p2.btor,298.303, 4 | picorv32_mutAX_nomem-p5.btor,298.074, 5 | picorv32_mutAY_nomem-p1.btor,299.181, 6 | picorv32_mutAY_nomem-p4.btor,106.463,sat 7 | picorv32_mutAY_nomem-p6.btor,298.933, 8 | picorv32_mutBX_nomem-p0.btor,298.358, 9 | picorv32_mutBX_nomem-p5.btor,298.051, 10 | picorv32_mutBX_nomem-p8.btor,297.832, 11 | picorv32_mutBY_nomem-p1.btor,298.246, 12 | picorv32_mutBY_nomem-p3.btor,298.738, 13 | picorv32_mutBY_nomem-p4.btor,298.636, 14 | picorv32_mutBY_nomem-p6.btor,298.928, 15 | picorv32_mutBY_nomem-p7.btor,298.519, 16 | picorv32_mutCX_nomem-p0.btor,298.707, 17 | picorv32_mutCX_nomem-p8.btor,297.528, 18 | picorv32_mutCY_nomem-p0.btor,298.332, 19 | picorv32_mutCY_nomem-p3.btor,298.801, 20 | -------------------------------------------------------------------------------- /include/Dialect/Smt/IR/SmtOps.td: -------------------------------------------------------------------------------- 1 | //===- SmtOps.td - Smt dialect ops -----------*- tablegen -*-===// 2 | // 3 | // This file is licensed 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 SMT_OPS 10 | #define SMT_OPS 11 | 12 | include "SmtBase.td" 13 | 14 | //===----------------------------------------------------------------------===// 15 | // Base Smt operation definition. 16 | //===----------------------------------------------------------------------===// 17 | 18 | class Smt_Op traits = []> : 19 | Op; 20 | 21 | #endif // SMT_OPS 22 | -------------------------------------------------------------------------------- /test/Btor/div_zero.btor.mlir.opt: -------------------------------------------------------------------------------- 1 | module attributes {llvm.data_layout = ""} { 2 | llvm.func @__VERIFIER_error() 3 | llvm.func @main() { 4 | llvm.br ^bb1 5 | ^bb1: // 2 preds: ^bb0, ^bb2 6 | %0 = llvm.mlir.constant(-1 : i5) : i5 7 | %1 = llvm.mlir.constant(0 : i5) : i5 8 | %2 = llvm.mlir.constant(6 : i5) : i5 9 | %3 = llvm.mlir.constant(0 : i5) : i5 10 | %4 = llvm.udiv %2, %1 : i5 11 | %5 = llvm.icmp "eq" %1, %3 : i5 12 | %6 = llvm.mlir.constant(-1 : i5) : i5 13 | %7 = llvm.select %5, %6, %4 : i1, i5 14 | %8 = llvm.icmp "eq" %7, %0 : i5 15 | %9 = llvm.mlir.constant(true) : i1 16 | %10 = llvm.xor %8, %9 : i1 17 | llvm.cond_br %10, ^bb2, ^bb3 18 | ^bb2: // pred: ^bb1 19 | llvm.br ^bb1 20 | ^bb3: // pred: ^bb1 21 | llvm.call @__VERIFIER_error() : () -> () 22 | llvm.unreachable 23 | } 24 | } 25 | 26 | -------------------------------------------------------------------------------- /include/Conversion/BtorToArithmetic/ConvertBtorToArithmeticPass.h: -------------------------------------------------------------------------------- 1 | #ifndef BTOR_CONVERSION_BTORTOARITHMETIC_CONVERTBTORTOARITHMETICPASS_H_ 2 | #define BTOR_CONVERSION_BTORTOARITHMETIC_CONVERTBTORTOARITHMETICPASS_H_ 3 | 4 | #include 5 | 6 | namespace mlir { 7 | // struct LogicalResult; 8 | class Pass; 9 | 10 | class RewritePatternSet; 11 | // using OwningRewritePatternList = RewritePatternSet; 12 | 13 | namespace btor { 14 | /// Collect a set of patterns to lower from btor to arithmetic dialect 15 | void populateBtorToArithmeticConversionPatterns(RewritePatternSet &patterns); 16 | 17 | /// Creates a pass to convert the Btor dialect into the arithmetic dialect. 18 | std::unique_ptr createConvertBtorToArithmeticPass(); 19 | 20 | } // namespace btor 21 | } // namespace mlir 22 | 23 | #endif // BTOR_CONVERSION_BTORTOARITHMETIC_CONVERTBTORTOARITHMETICPASS_H_ -------------------------------------------------------------------------------- /include/Conversion/BtorToVector/ConvertBtorToVectorPass.h: -------------------------------------------------------------------------------- 1 | #ifndef BTOR_CONVERSION_BTORTOVECTOR_CONVERTBTORTOVECTORPASS_H_ 2 | #define BTOR_CONVERSION_BTORTOVECTOR_CONVERTBTORTOVECTORPASS_H_ 3 | 4 | #include "Conversion/BtorToLLVM/ConvertBtorToLLVMPass.h" 5 | #include 6 | 7 | namespace mlir { 8 | class Pass; 9 | 10 | class RewritePatternSet; 11 | 12 | namespace btor { 13 | /// Collect a set of patterns to lower from btor to vector dialect 14 | void populateBtorToVectorConversionPatterns(BtorToLLVMTypeConverter &converter, 15 | RewritePatternSet &patterns); 16 | 17 | /// Creates a pass to convert the Btor dialect into the vector dialect. 18 | std::unique_ptr createLowerToVectorPass(); 19 | 20 | } // namespace btor 21 | } // namespace mlir 22 | 23 | #endif // BTOR_CONVERSION_BTORTOVECTOR_CONVERTBTORTOVECTORPASS_H_ 24 | -------------------------------------------------------------------------------- /lib/Conversion/PassDetail.h: -------------------------------------------------------------------------------- 1 | #ifndef BTORCONVERSION_PASSDETAIL_H_ 2 | #define BTORCONVERSION_PASSDETAIL_H_ 3 | 4 | #include "mlir/Pass/Pass.h" 5 | #include "mlir/Dialect/Arithmetic/IR/Arithmetic.h" 6 | #include "mlir/Dialect/Vector/IR/VectorOps.h" 7 | 8 | namespace mlir { 9 | class ModuleOp; 10 | 11 | // Forward declaration from Dialect.h 12 | template 13 | void registerDialect(DialectRegistry ®istry); 14 | 15 | namespace arith { 16 | class ArithmeticDialect; 17 | } // namespace arith 18 | 19 | namespace btor { 20 | class BtorDialect; 21 | } // end namespace btor 22 | 23 | namespace LLVM { 24 | class LLVMDialect; 25 | } // end namespace LLVM 26 | 27 | namespace vector { 28 | class VectorDialect; 29 | } // end namespace vector 30 | 31 | #define GEN_PASS_CLASSES 32 | #include "Conversion/Passes.h.inc" 33 | 34 | } // end namespace mlir 35 | 36 | #endif // BTORCONVERSION_PASSDETAIL_H_ -------------------------------------------------------------------------------- /test/Btor/concat.btor.mlir.opt: -------------------------------------------------------------------------------- 1 | module attributes {llvm.data_layout = ""} { 2 | llvm.func @verifier.error() 3 | llvm.func @main() { 4 | %0 = llvm.mlir.constant(0 : i8) : i8 5 | llvm.br ^bb1(%0 : i8) 6 | ^bb1(%1: i8): // 2 preds: ^bb0, ^bb2 7 | %2 = llvm.mlir.constant(false) : i1 8 | %3 = llvm.mlir.constant(-1 : i7) : i7 9 | %4 = llvm.mlir.constant(1 : i8) : i8 10 | %5 = llvm.zext %3 : i7 to i8 11 | %6 = llvm.shl %5, %4 : i8 12 | %7 = llvm.zext %2 : i1 to i8 13 | %8 = llvm.or %6, %7 : i8 14 | %9 = llvm.mlir.constant(-2 : i8) : i8 15 | %10 = llvm.icmp "eq" %1, %9 : i8 16 | %11 = llvm.mlir.constant(true) : i1 17 | %12 = llvm.xor %10, %11 : i1 18 | llvm.cond_br %12, ^bb2, ^bb3 19 | ^bb2: // pred: ^bb1 20 | llvm.br ^bb1(%8 : i8) 21 | ^bb3: // pred: ^bb1 22 | llvm.call @verifier.error() : () -> () 23 | llvm.unreachable 24 | } 25 | } 26 | 27 | -------------------------------------------------------------------------------- /lib/Dialect/Btor/IR/BtorTypes.cpp: -------------------------------------------------------------------------------- 1 | //===- BtorTypes.cpp - Btor dialect ---------------*- C++ -*-===// 2 | // 3 | // This file is licensed 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 | #include "Dialect/Btor/IR/BtorTypes.h" 10 | #include "Dialect/Btor/IR/Btor.h" 11 | #include "mlir/IR/Builders.h" 12 | #include "mlir/IR/DialectImplementation.h" 13 | #include "llvm/ADT/TypeSwitch.h" 14 | 15 | using namespace mlir; 16 | using namespace mlir::btor; 17 | 18 | #define GET_TYPEDEF_CLASSES 19 | #include "Dialect/Btor/IR/BtorOpsTypes.cpp.inc" 20 | 21 | void BtorDialect::registerTypes() { 22 | addTypes< 23 | #define GET_TYPEDEF_LIST 24 | #include "Dialect/Btor/IR/BtorOpsTypes.cpp.inc" 25 | >(); 26 | } -------------------------------------------------------------------------------- /results/seahorn/seahorn_19A_wolf_0321231957.csv: -------------------------------------------------------------------------------- 1 | base,Cpu,Mem,BMC,seahorn_total,Result 2 | picorv32_mutBY_nomem-p3.btor,165.91,612,,, 3 | picorv32_mutAY_nomem-p4.btor,157.73,615,,, 4 | picorv32_mutAY_nomem-p6.btor,153.12,615,,, 5 | picorv32_mutCY_nomem-p0.btor,169.20,613,,, 6 | picorv32_mutBY_nomem-p1.btor,186.51,610,,, 7 | picorv32_mutBY_nomem-p7.btor,149.35,610,,, 8 | picorv32_mutCY_nomem-p3.btor,149.93,610,,, 9 | picorv32_mutAY_nomem-p1.btor,153.76,613,,, 10 | picorv32_mutBY_nomem-p4.btor,148.32,616,,, 11 | picorv32_mutBY_nomem-p6.btor,141.54,612,,, 12 | picorv32_mutCX_nomem-p8.btor,267.51,826,,, 13 | picorv32_mutAX_nomem-p0.btor,232.17,826,,, 14 | picorv32_mutAX_nomem-p2.btor,48.07,424,,, 15 | picorv32_mutBX_nomem-p0.btor,237.94,830,,, 16 | picorv32_mutBX_nomem-p8.btor,232.08,827,,, 17 | picorv32_mutAX_nomem-p5.btor,296.01,825,,, 18 | picorv32_mutBX_nomem-p5.btor,262.35,826,,, 19 | picorv32_mutCX_nomem-p0.btor,245.33,826,,, 20 | -------------------------------------------------------------------------------- /results/vcGen/vcGen_19A_wolf_0321231831.csv: -------------------------------------------------------------------------------- 1 | base,Cpu,Mem,BMC,seahorn_total,Result 2 | picorv32_mutBY_nomem-p3.btor,188.62,615,,, 3 | picorv32_mutAY_nomem-p1.btor,157.32,614,,, 4 | picorv32_mutBY_nomem-p1.btor,158.00,612,,, 5 | picorv32_mutAY_nomem-p6.btor,154.39,613,,, 6 | picorv32_mutCY_nomem-p3.btor,176.79,614,,, 7 | picorv32_mutBY_nomem-p7.btor,154.83,611,,, 8 | picorv32_mutCY_nomem-p0.btor,204.10,610,,, 9 | picorv32_mutAY_nomem-p4.btor,156.51,614,,, 10 | picorv32_mutBY_nomem-p6.btor,149.28,609,,, 11 | picorv32_mutAX_nomem-p0.btor,284.89,829,,, 12 | picorv32_mutBX_nomem-p5.btor,243.69,825,,, 13 | picorv32_mutBY_nomem-p4.btor,154.14,618,,, 14 | picorv32_mutAX_nomem-p2.btor,243.88,828,,, 15 | picorv32_mutCX_nomem-p8.btor,240.39,826,,, 16 | picorv32_mutAX_nomem-p5.btor,296.98,829,,, 17 | picorv32_mutBX_nomem-p8.btor,247.39,825,,, 18 | picorv32_mutBX_nomem-p0.btor,53.72,423,,, 19 | picorv32_mutCX_nomem-p0.btor,242.57,826,,, 20 | -------------------------------------------------------------------------------- /results/vcGen/vcGen_19_beem_0321231815.csv: -------------------------------------------------------------------------------- 1 | base,Cpu,Mem,BMC,seahorn_total,Result 2 | krebs.3.prop1-func-interl.btor2,3.68,352,0.01,0.07, 3 | anderson.3.prop1-back-serstep.btor2,23.58,509,0.52,0.98, 4 | frogs.5.prop1-func-interl.btor2,38.52,756,1.65,3.15, 5 | mcs.3.prop1-back-serstep.btor2,71.01,667,1.23,2.30, 6 | brp2.6.prop3-back-serstep.btor2,71.88,538,1.00,1.85, 7 | brp2.3.prop1-back-serstep.btor2,72.10,537,0.98,1.84, 8 | blocks.4.prop1-back-serstep.btor2,74.22,755,1.92,3.23, 9 | at.6.prop1-back-serstep.btor2,88.28,763,1.76,3.17, 10 | brp2.2.prop1-func-interl.btor2,104.53,511,0.56,1.09, 11 | rushhour.4.prop1-func-interl.btor2,122.20,2796,7.74,12.43, 12 | elevator.4.prop1-func-interl.btor2,131.42,525,0.69,1.37, 13 | msmie.3.prop1-func-interl.btor2,25.28,359,,, 14 | pgm_protocol.3.prop5-func-interl.btor2,22.87,359,,, 15 | pgm_protocol.7.prop1-back-serstep.btor2,26.97,370,,, 16 | peg_solitaire.3.prop1-back-serstep.btor2,23.60,368,,, 17 | -------------------------------------------------------------------------------- /test/Btor/array.btor2.mlir.opt: -------------------------------------------------------------------------------- 1 | module attributes {llvm.data_layout = ""} { 2 | llvm.func @__VERIFIER_error() 3 | llvm.func @main() { 4 | %0 = llvm.mlir.constant(dense<1> : vector<16xi4>) : vector<16xi4> 5 | llvm.br ^bb1(%0 : vector<16xi4>) 6 | ^bb1(%1: vector<16xi4>): // 2 preds: ^bb0, ^bb2 7 | %2 = llvm.mlir.constant(1 : i4) : i4 8 | %3 = llvm.mlir.constant(-8 : i4) : i4 9 | %4 = llvm.extractelement %1[%3 : i4] : vector<16xi4> 10 | %5 = llvm.add %4, %2 : i4 11 | %6 = llvm.insertelement %5, %1[%3 : i4] : vector<16xi4> 12 | %7 = llvm.mlir.constant(-1 : i4) : i4 13 | %8 = llvm.icmp "eq" %4, %7 : i4 14 | %9 = llvm.mlir.constant(true) : i1 15 | %10 = llvm.xor %8, %9 : i1 16 | llvm.cond_br %10, ^bb2, ^bb3 17 | ^bb2: // pred: ^bb1 18 | llvm.br ^bb1(%6 : vector<16xi4>) 19 | ^bb3: // pred: ^bb1 20 | llvm.call @__VERIFIER_error() : () -> () 21 | llvm.unreachable 22 | } 23 | } 24 | 25 | -------------------------------------------------------------------------------- /include/Conversion/BtorNDToLLVM/ConvertBtorNDToLLVMPass.h: -------------------------------------------------------------------------------- 1 | #ifndef BTOR_CONVERSION_BTORNDTOLLVM_CONVERTBTORNDTOLLVMPASS_H_ 2 | #define BTOR_CONVERSION_BTORNDTOLLVM_CONVERTBTORNDTOLLVMPASS_H_ 3 | 4 | #include 5 | 6 | #include "Conversion/BtorToLLVM/ConvertBtorToLLVMPass.h" 7 | 8 | namespace mlir { 9 | class BtorToLLVMTypeConverter; 10 | class RewritePatternSet; 11 | class Pass; 12 | 13 | namespace btor { 14 | 15 | /// Collect a set of patterns to lower from btor nd operations to LLVM dialect 16 | void populateBTORNDTOLLVMConversionPatterns(BtorToLLVMTypeConverter &converter, 17 | RewritePatternSet &patterns); 18 | 19 | /// Creates a pass to convert the Btor dialect nd bitvector operations into the LLVM dialect. 20 | std::unique_ptr createLowerBtorNDToLLVMPass(); 21 | 22 | } // namespace btor 23 | } // namespace mlir 24 | 25 | #endif // BTOR_CONVERSION_BTORNDTOLLVM_CONVERTBTORNDTOLLVMPASS_H_ -------------------------------------------------------------------------------- /results/seahorn/seahorn_19_beem_0321231934.csv: -------------------------------------------------------------------------------- 1 | base,Cpu,Mem,BMC,seahorn_total,Result 2 | krebs.3.prop1-func-interl.btor2,3.24,354,0.01,0.05,TRUE 3 | anderson.3.prop1-back-serstep.btor2,30.93,2141,8.74,9.20,FALSE 4 | brp2.6.prop3-back-serstep.btor2,76.25,1190,5.17,6.05,TRUE 5 | brp2.3.prop1-back-serstep.btor2,80.44,1198,9.34,10.19,TRUE 6 | frogs.5.prop1-func-interl.btor2,80.66,1486,45.46,46.98,TRUE 7 | brp2.2.prop1-func-interl.btor2,104.57,527,0.32,0.86,TRUE 8 | elevator.4.prop1-func-interl.btor2,133.98,703,0.93,1.64,TRUE 9 | at.6.prop1-back-serstep.btor2,157.24,1208,72.05,73.51,FALSE 10 | rushhour.4.prop1-func-interl.btor2,248.40,1934,137.83,142.89,TRUE 11 | blocks.4.prop1-back-serstep.btor2,70.18,417,,, 12 | mcs.3.prop1-back-serstep.btor2,68.30,379,,, 13 | msmie.3.prop1-func-interl.btor2,21.65,358,,, 14 | pgm_protocol.3.prop5-func-interl.btor2,19.11,361,,, 15 | pgm_protocol.7.prop1-back-serstep.btor2,22.31,371,,, 16 | peg_solitaire.3.prop1-back-serstep.btor2,18.94,369,,, 17 | -------------------------------------------------------------------------------- /include/Dialect/Btor/IR/BtorTypes.td: -------------------------------------------------------------------------------- 1 | #ifndef BTOR_TYPES 2 | #define BTOR_TYPES 3 | 4 | include "BtorBase.td" 5 | 6 | class Btor_BaseType traits = []> 7 | : TypeDef { 8 | let mnemonic = typeMnemonic; 9 | } 10 | 11 | def Btor_BitVec : Btor_BaseType<"BitVec", "bv"> { 12 | let summary = "bit vector behaving similar to unsinged int"; 13 | let description = [{Bit vectors have designated width.}]; 14 | 15 | let parameters = (ins "unsigned" : $width); 16 | 17 | let assemblyFormat = "`<` $width `>`"; 18 | 19 | let genVerifyDecl = 0; 20 | } 21 | 22 | def Btor_Array : Btor_BaseType<"Array", "array"> { 23 | let summary = "btor array"; 24 | let description = [{A Btor array parametrized by two btor bit vectors}]; 25 | 26 | let parameters = (ins "BitVecType" : $shape, "BitVecType" : $element); 27 | 28 | let assemblyFormat = "`<` $shape `,` $element `>`"; 29 | 30 | let genVerifyDecl = 0; 31 | } 32 | #endif // BTOR_TYPES 33 | -------------------------------------------------------------------------------- /lib/Dialect/Btor/IR/BtorDialect.cpp: -------------------------------------------------------------------------------- 1 | //===- BtorDialect.cpp - Btor dialect ---------------*- C++ -*-===// 2 | // 3 | // This file is licensed 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 | #include "Dialect/Btor/IR/Btor.h" 10 | #include "mlir/IR/Builders.h" 11 | 12 | using namespace mlir; 13 | using namespace mlir::btor; 14 | 15 | #include "Dialect/Btor/IR/BtorOpsDialect.cpp.inc" 16 | 17 | //===----------------------------------------------------------------------===// 18 | // Btor dialect. 19 | //===----------------------------------------------------------------------===// 20 | 21 | void BtorDialect::initialize() { 22 | registerTypes(); 23 | registerAttrs(); 24 | addOperations< 25 | #define GET_OP_LIST 26 | #include "Dialect/Btor/IR/BtorOps.cpp.inc" 27 | >(); 28 | } 29 | -------------------------------------------------------------------------------- /tools/smt2mlir-translate/smt2mlir-translate.cpp: -------------------------------------------------------------------------------- 1 | //===- smt-translate.cpp ---------------------------------*- C++ -*-===// 2 | // 3 | // This file is licensed 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 | // This is a command line utility that translates a file from/to MLIR using one 10 | // of the registered translations. 11 | // 12 | //===----------------------------------------------------------------------===// 13 | 14 | #include "mlir/InitAllTranslations.h" 15 | #include "mlir/Support/LogicalResult.h" 16 | #include "mlir/Translation.h" 17 | 18 | #include "Dialect/Smt/IR/Smt.h" 19 | 20 | int main(int argc, char **argv) { 21 | mlir::registerAllTranslations(); 22 | 23 | return failed( 24 | mlir::mlirTranslateMain(argc, argv, "MLIR Translation Testing Tool")); 25 | } 26 | -------------------------------------------------------------------------------- /lib/Dialect/Smt/IR/SmtDialect.cpp: -------------------------------------------------------------------------------- 1 | //===- SmtDialect.cpp - Smt dialect ---------------*- C++ -*-===// 2 | // 3 | // This file is licensed 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 | #include "Dialect/Smt/IR/Smt.h" 10 | 11 | #include "Dialect/Smt/IR/SmtOpsDialect.cpp.inc" 12 | 13 | // Pull in all enum type definitions and utility function declarations. 14 | #include "Dialect/Smt/IR/SmtOpsEnums.cpp.inc" 15 | 16 | using namespace mlir; 17 | using namespace mlir::smt; 18 | 19 | //===----------------------------------------------------------------------===// 20 | // Smt dialect. 21 | //===----------------------------------------------------------------------===// 22 | 23 | void SmtDialect::initialize() { 24 | addOperations< 25 | #define GET_OP_LIST 26 | #include "Dialect/Smt/IR/SmtOps.cpp.inc" 27 | >(); 28 | } 29 | -------------------------------------------------------------------------------- /include/Dialect/Btor/IR/BtorTypes.h: -------------------------------------------------------------------------------- 1 | //===- BtorTypes.h - Btor dialect ops -----------------*- C++ -*-===// 2 | // 3 | // This file is licensed 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 BTOR_IR_BTOR_TYPES_H 10 | #define BTOR_IR_BTOR_TYPES_H 11 | 12 | #include "mlir/IR/BuiltinTypes.h" 13 | #include "mlir/IR/Dialect.h" 14 | #include "mlir/IR/OpDefinition.h" 15 | #include "mlir/IR/OpImplementation.h" 16 | #include "mlir/Interfaces/InferTypeOpInterface.h" 17 | #include "mlir/Interfaces/SideEffectInterfaces.h" 18 | 19 | //===----------------------------------------------------------------------===// 20 | // Btor Dialect Types 21 | //===----------------------------------------------------------------------===// 22 | 23 | #define GET_TYPEDEF_CLASSES 24 | #include "Dialect/Btor/IR/BtorOpsTypes.h.inc" 25 | 26 | using namespace mlir; 27 | using namespace mlir::btor; 28 | 29 | #endif // BTOR_IR_BTOR_TYPES_H -------------------------------------------------------------------------------- /include/Dialect/Btor/IR/BtorAttributes.h: -------------------------------------------------------------------------------- 1 | //===- BtorAttrs.h - Btor dialect ops -----------------*- C++ -*-===// 2 | // 3 | // This file is licensed 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 BTOR_IR_BTOR_ATTRS_H 10 | #define BTOR_IR_BTOR_ATTRS_H 11 | 12 | #include "mlir/IR/Dialect.h" 13 | #include "mlir/IR/BuiltinTypes.h" 14 | #include "mlir/IR/OpDefinition.h" 15 | #include "mlir/IR/OpImplementation.h" 16 | #include "mlir/Interfaces/InferTypeOpInterface.h" 17 | #include "mlir/Interfaces/SideEffectInterfaces.h" 18 | 19 | 20 | //===----------------------------------------------------------------------===// 21 | // Btor Dialect Attributes 22 | //===----------------------------------------------------------------------===// 23 | 24 | #define GET_ATTRDEF_CLASSES 25 | #include "Dialect/Btor/IR/BtorAttributes.h.inc" 26 | 27 | using namespace mlir; 28 | using namespace mlir::btor; 29 | 30 | #endif // BTOR_IR_BTOR_ATTRS_H -------------------------------------------------------------------------------- /test/Btor/mod_zero.btor.mlir.opt: -------------------------------------------------------------------------------- 1 | module attributes {llvm.data_layout = ""} { 2 | llvm.func @__VERIFIER_error() 3 | llvm.func @main() { 4 | llvm.br ^bb1 5 | ^bb1: // 2 preds: ^bb0, ^bb2 6 | %0 = llvm.mlir.constant(6 : i5) : i5 7 | %1 = llvm.mlir.constant(0 : i5) : i5 8 | %2 = llvm.mlir.constant(0 : i5) : i5 9 | %3 = llvm.mlir.constant(0 : i5) : i5 10 | %4 = llvm.srem %0, %1 : i5 11 | %5 = llvm.icmp "eq" %1, %3 : i5 12 | %6 = llvm.select %5, %0, %4 : i1, i5 13 | %7 = llvm.icmp "slt" %6, %2 : i5 14 | %8 = llvm.icmp "slt" %1, %2 : i5 15 | %9 = llvm.icmp "ne" %1, %2 : i5 16 | %10 = llvm.xor %7, %8 : i1 17 | %11 = llvm.and %10, %9 : i1 18 | %12 = llvm.mlir.constant(0 : i5) : i5 19 | %13 = llvm.sub %12, %6 : i5 20 | %14 = llvm.select %11, %13, %6 : i1, i5 21 | %15 = llvm.icmp "eq" %14, %0 : i5 22 | %16 = llvm.mlir.constant(true) : i1 23 | %17 = llvm.xor %15, %16 : i1 24 | llvm.cond_br %17, ^bb2, ^bb3 25 | ^bb2: // pred: ^bb1 26 | llvm.br ^bb1 27 | ^bb3: // pred: ^bb1 28 | llvm.call @__VERIFIER_error() : () -> () 29 | llvm.unreachable 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /include/Dialect/Btor/IR/BtorBase.td: -------------------------------------------------------------------------------- 1 | //===- BtorBase.td - Btor dialect -----------*- tablegen -*-===// 2 | // 3 | // This file is licensed 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 BTOR_BASE 10 | #define BTOR_BASE 11 | 12 | include "mlir/IR/OpBase.td" 13 | 14 | //===----------------------------------------------------------------------===// 15 | // Btor dialect definition. 16 | //===----------------------------------------------------------------------===// 17 | 18 | def Btor_Dialect : Dialect { 19 | let name = "btor"; 20 | let summary = "A BTOR2 MLIR dialect"; 21 | let cppNamespace = "::mlir::btor"; 22 | let extraClassDeclaration = [{ 23 | private: 24 | // Register the custom btor Types. 25 | void registerTypes(); 26 | 27 | // Register the custom btor attributes. 28 | void registerAttrs(); 29 | public: 30 | }]; 31 | } 32 | 33 | #endif // BTOR_DIALECT 34 | -------------------------------------------------------------------------------- /tools/btor2mlir-translate/btor2mlir-translate.cpp: -------------------------------------------------------------------------------- 1 | //===- standalone-translate.cpp ---------------------------------*- C++ -*-===// 2 | // 3 | // This file is licensed 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 | // This is a command line utility that translates a file from/to MLIR using one 10 | // of the registered translations. 11 | // 12 | //===----------------------------------------------------------------------===// 13 | 14 | #include "mlir/InitAllTranslations.h" 15 | #include "mlir/Support/LogicalResult.h" 16 | #include "mlir/Translation.h" 17 | 18 | #include "Dialect/Btor/IR/Btor.h" 19 | #include "Target/Btor/BtorToBtorIRTranslation.h" 20 | #include "Target/Btor/BtorIRToBtorTranslation.h" 21 | 22 | int main(int argc, char **argv) { 23 | mlir::registerAllTranslations(); 24 | mlir::btor::registerFromBtorTranslation(); 25 | mlir::btor::registerToBtorTranslation(); 26 | 27 | return failed( 28 | mlir::mlirTranslateMain(argc, argv, "MLIR Translation Testing Tool")); 29 | } 30 | -------------------------------------------------------------------------------- /test/Btor/redor.btor.mlir.opt.ll.smt2: -------------------------------------------------------------------------------- 1 | ;; Produced with Z3_solver_to_string() 2 | (declare-fun sea.sp0_0 () (_ BitVec 64)) 3 | (declare-fun main@entry_0 () Bool) 4 | (declare-fun main@_3_0 () Bool) 5 | (declare-fun main@%_0_0 () (_ BitVec 8)) 6 | (declare-fun main@%_2_0 () (_ BitVec 8)) 7 | (declare-fun |tuple(main@entry_0, main@verifier.error_0)| () Bool) 8 | (declare-fun main@verifier.error_0 () Bool) 9 | (declare-fun main@verifier.error.split_0 () Bool) 10 | (assert (= #b000 ((_ extract 2 0) sea.sp0_0))) 11 | (assert (bvule sea.sp0_0 #x00000000c0000000)) 12 | (assert (bvuge sea.sp0_0 #x00000000bf700000)) 13 | (assert (=> main@_3_0 (and main@_3_0 main@entry_0))) 14 | (assert (=> (and main@_3_0 main@entry_0) (not (= main@%_0_0 #xff)))) 15 | (assert (=> main@_3_0 (= main@%_2_0 #xff))) 16 | (assert (=> |tuple(main@entry_0, main@verifier.error_0)| main@entry_0)) 17 | (assert (=> main@verifier.error_0 18 | (or (and main@verifier.error_0 main@_3_0) 19 | |tuple(main@entry_0, main@verifier.error_0)|))) 20 | (assert (=> |tuple(main@entry_0, main@verifier.error_0)| (= main@%_0_0 #xff))) 21 | (assert (=> main@verifier.error.split_0 22 | (and main@verifier.error.split_0 main@verifier.error_0))) 23 | (assert main@verifier.error.split_0) 24 | 25 | (check-sat) 26 | -------------------------------------------------------------------------------- /tools/smt2mlir-opt/smt2mlir-opt.cpp: -------------------------------------------------------------------------------- 1 | //===- smt2mlir-opt.cpp ---------------------------------------*- C++ -*-===// 2 | // 3 | // This file is licensed 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 | #include "mlir/IR/Dialect.h" 10 | #include "mlir/IR/MLIRContext.h" 11 | #include "mlir/InitAllDialects.h" 12 | #include "mlir/InitAllPasses.h" 13 | #include "mlir/Pass/Pass.h" 14 | #include "mlir/Pass/PassManager.h" 15 | #include "mlir/Support/FileUtilities.h" 16 | #include "mlir/Support/MlirOptMain.h" 17 | #include "llvm/Support/CommandLine.h" 18 | #include "llvm/Support/InitLLVM.h" 19 | #include "llvm/Support/SourceMgr.h" 20 | #include "llvm/Support/ToolOutputFile.h" 21 | 22 | #include "Dialect/Smt/IR/Smt.h" 23 | #include "Conversion/Passes.h" 24 | 25 | int main(int argc, char **argv) { 26 | mlir::registerAllPasses(); 27 | 28 | mlir::DialectRegistry registry; 29 | registry.insert(); 30 | 31 | return mlir::asMainReturnCode( 32 | mlir::MlirOptMain(argc, argv, "Smt optimizer driver\n", registry)); 33 | } 34 | -------------------------------------------------------------------------------- /docker/btor2mlir.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM seahorn/seahorn-llvm14:nightly 2 | 3 | ## install required pacakges 4 | USER root 5 | 6 | ## Install latest cmake 7 | RUN apt -y remove --purge cmake 8 | RUN apt -y update 9 | RUN apt -y install wget python3-pip 10 | RUN python3 -m pip install --upgrade pip 11 | RUN pip3 install cmake --upgrade 12 | RUN apt install -y libmlir-14-dev mlir-14-tools 13 | 14 | 15 | # Assume that docker-build is ran in the top-level directory 16 | WORKDIR /opt 17 | COPY . btor2mlir 18 | 19 | RUN mkdir -p /opt/btor2mlir/build 20 | WORKDIR /opt/btor2mlir/build 21 | 22 | ARG BUILD_TYPE=RelWithDebInfo 23 | 24 | # Build configuration 25 | RUN cmake -G Ninja .. \ 26 | -DCMAKE_C_COMPILER=clang-14 \ 27 | -DCMAKE_CXX_COMPILER=clang++-14 \ 28 | -DMLIR_DIR=/usr/lib/llvm-14/lib/cmake/mlir \ 29 | -DLLVM_DIR=/usr/lib/llvm-14/lib/cmake/llvm \ 30 | -DCMAKE_BUILD_TYPE=BUILD_TYPE \ 31 | -DLLVM_EXTERNAL_LIT=$(which lit) \ 32 | -DLLVM_ENABLE_LLD=ON \ 33 | -DCMAKE_INSTALL_PREFIX=$(pwd)/run && \ 34 | ninja && \ 35 | ninja install 36 | 37 | RUN cp bin/* /usr/bin 38 | 39 | # get btor2tools 40 | WORKDIR /opt 41 | RUN git clone https://github.com/Boolector/btor2tools.git 42 | WORKDIR /opt/btor2tools 43 | RUN ./configure.sh 44 | WORKDIR /opt/btor2tools/build 45 | RUN make 46 | RUN cp bin/* /usr/bin 47 | 48 | WORKDIR /opt/btor2mlir 49 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.13.4) 2 | project(btor2-dialect LANGUAGES CXX C) 3 | 4 | cmake_policy(SET CMP0116 OLD) 5 | 6 | set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON) 7 | 8 | set(CMAKE_CXX_STANDARD 14 CACHE STRING "C++ standard to conform to") 9 | 10 | find_package(MLIR REQUIRED CONFIG) 11 | 12 | message(STATUS "Using MLIRConfig.cmake in: ${MLIR_DIR}") 13 | message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}") 14 | 15 | set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/bin) 16 | set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/lib) 17 | set(MLIR_BINARY_DIR ${CMAKE_BINARY_DIR}) 18 | 19 | list(APPEND CMAKE_MODULE_PATH "${MLIR_CMAKE_DIR}") 20 | list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}") 21 | include(TableGen) 22 | include(LLVMDistributionSupport) 23 | include(AddLLVM) 24 | include(AddMLIR) 25 | include(HandleLLVMOptions) 26 | 27 | include_directories(${LLVM_INCLUDE_DIRS}) 28 | include_directories(${MLIR_INCLUDE_DIRS}) 29 | include_directories(${PROJECT_SOURCE_DIR}/include) 30 | include_directories(${PROJECT_BINARY_DIR}/include) 31 | link_directories(${LLVM_BUILD_LIBRARY_DIR}) 32 | add_definitions(${LLVM_DEFINITIONS}) 33 | 34 | add_subdirectory(include) 35 | add_subdirectory(lib) 36 | add_subdirectory(test) 37 | add_subdirectory(utils/cex) 38 | add_subdirectory(tools/btor2mlir-opt) 39 | add_subdirectory(tools/btor2mlir-translate) 40 | add_subdirectory(tools/smt2mlir-opt) 41 | add_subdirectory(tools/smt2mlir-translate) 42 | -------------------------------------------------------------------------------- /test/Btor/wolf-19C.btor.mlir.opt: -------------------------------------------------------------------------------- 1 | module attributes {llvm.data_layout = ""} { 2 | llvm.func @__VERIFIER_error() 3 | llvm.func @nd_bv64_st3() -> i64 4 | llvm.func @btor2mlir_print_state_num(i64, i64, i64) 5 | llvm.func @nd_bv64_st2() -> i64 6 | llvm.func @main() { 7 | %0 = llvm.mlir.constant(false) : i1 8 | %1 = llvm.call @nd_bv64_st2() : () -> i64 9 | %2 = llvm.trunc %1 : i64 to i33 10 | %3 = llvm.call @nd_bv64_st3() : () -> i64 11 | %4 = llvm.trunc %3 : i64 to i33 12 | llvm.br ^bb1(%0, %0, %2, %4 : i1, i1, i33, i33) 13 | ^bb1(%5: i1, %6: i1, %7: i33, %8: i33): // 2 preds: ^bb0, ^bb2 14 | %9 = llvm.mlir.constant(true) : i1 15 | %10 = llvm.xor %7, %8 : i33 16 | %11 = llvm.mlir.constant(-1 : i33) : i33 17 | %12 = llvm.xor %10, %11 : i33 18 | %13 = llvm.mlir.constant(2 : i33) : i33 19 | %14 = llvm.lshr %12, %13 : i33 20 | %15 = llvm.trunc %14 : i33 to i1 21 | %16 = llvm.mlir.constant(true) : i1 22 | %17 = llvm.xor %15, %16 : i1 23 | %18 = llvm.and %6, %17 : i1 24 | %19 = llvm.and %18, %9 : i1 25 | %20 = llvm.mlir.constant(50 : i33) : i33 26 | %21 = llvm.and %5, %9 : i1 27 | %22 = llvm.mlir.constant(true) : i1 28 | %23 = llvm.xor %21, %22 : i1 29 | llvm.cond_br %23, ^bb2, ^bb3 30 | ^bb2: // pred: ^bb1 31 | llvm.br ^bb1(%19, %9, %20, %20 : i1, i1, i33, i33) 32 | ^bb3: // pred: ^bb1 33 | llvm.call @__VERIFIER_error() : () -> () 34 | llvm.unreachable 35 | } 36 | } 37 | 38 | -------------------------------------------------------------------------------- /results/boolector/boolector_18D_wolf_0330231124.csv: -------------------------------------------------------------------------------- 1 | index,btor_time,status 2 | VexRiscv-regch0-15-p0.btor,18.652,unsat 3 | VexRiscv-regch0-20-p0.btor,0.007,unsat 4 | VexRiscv-regch0-30-p1.btor,0.0,unsat 5 | picorv32-check-p05.btor,8.579,unsat 6 | picorv32-check-p09.btor,8.825,unsat 7 | picorv32-check-p12.btor,8.302,unsat 8 | picorv32-check-p19.btor,6.56,unsat 9 | picorv32-check-p20.btor,12.928,unsat 10 | picorv32-check-p22.btor,8.467,unsat 11 | picorv32-pcregs-p0.btor,129.249,unsat 12 | picorv32-pcregs-p2.btor,135.85,unsat 13 | ponylink-slaveTXlen-unsat.btor,1.181,unsat 14 | zipcpu-busdelay-p00.btor,2.445,unsat 15 | zipcpu-busdelay-p15.btor,4.629,unsat 16 | zipcpu-busdelay-p30.btor,2.589,unsat 17 | zipcpu-busdelay-p36.btor,2.929,unsat 18 | zipcpu-busdelay-p43.btor,0.666,unsat 19 | zipcpu-busdelay-p46.btor,2.492,unsat 20 | zipcpu-busdelay-p47.btor,0.686,unsat 21 | zipcpu-pfcache-p01.btor,1.512,unsat 22 | zipcpu-pfcache-p02.btor,1.561,unsat 23 | zipcpu-pfcache-p13.btor,2.834,unsat 24 | zipcpu-pfcache-p20.btor,1.912,unsat 25 | zipcpu-pfcache-p22.btor,1.577,unsat 26 | zipcpu-pfcache-p24.btor,1.473,unsat 27 | zipcpu-pfcache-p27.btor,2.122,unsat 28 | zipcpu-pfcache-p28.btor,2.814,unsat 29 | zipcpu-zipmmu-p00.btor,3.612,unsat 30 | zipcpu-zipmmu-p02.btor,2.584,unsat 31 | zipcpu-zipmmu-p09.btor,4.522,unsat 32 | zipcpu-zipmmu-p14.btor,2.027,unsat 33 | zipcpu-zipmmu-p26.btor,7.578,unsat 34 | zipcpu-zipmmu-p31.btor,5.618,unsat 35 | zipcpu-zipmmu-p33.btor,5.628,unsat 36 | zipcpu-zipmmu-p39.btor,2.533,unsat 37 | zipcpu-zipmmu-p48.btor,3.891,unsat 38 | -------------------------------------------------------------------------------- /results/25-btormc/25-btormc_18D_wolf_0202231715.csv: -------------------------------------------------------------------------------- 1 | index,btor_time,status 2 | VexRiscv-regch0-15-p0.btor,15.066,unsat 3 | VexRiscv-regch0-20-p0.btor,79.02799999999999,unsat 4 | VexRiscv-regch0-30-p1.btor,0.078,unsat 5 | picorv32-check-p05.btor,6.085,unsat 6 | picorv32-check-p09.btor,6.35,unsat 7 | picorv32-check-p12.btor,9.132,unsat 8 | picorv32-check-p19.btor,7.147,unsat 9 | picorv32-check-p20.btor,11.074,unsat 10 | picorv32-check-p22.btor,27.978,unsat 11 | picorv32-pcregs-p0.btor,299.26, 12 | picorv32-pcregs-p2.btor,298.98, 13 | ponylink-slaveTXlen-unsat.btor,0.238,unsat 14 | zipcpu-busdelay-p00.btor,13.773,unsat 15 | zipcpu-busdelay-p15.btor,5.092,unsat 16 | zipcpu-busdelay-p30.btor,9.278,unsat 17 | zipcpu-busdelay-p36.btor,19.128,unsat 18 | zipcpu-busdelay-p43.btor,1.441,unsat 19 | zipcpu-busdelay-p46.btor,10.123,unsat 20 | zipcpu-busdelay-p47.btor,1.944,unsat 21 | zipcpu-pfcache-p01.btor,10.78,unsat 22 | zipcpu-pfcache-p02.btor,4.858,unsat 23 | zipcpu-pfcache-p13.btor,18.58,unsat 24 | zipcpu-pfcache-p20.btor,8.603,unsat 25 | zipcpu-pfcache-p22.btor,7.852,unsat 26 | zipcpu-pfcache-p24.btor,6.884,unsat 27 | zipcpu-pfcache-p27.btor,14.185,unsat 28 | zipcpu-pfcache-p28.btor,15.848,unsat 29 | zipcpu-zipmmu-p00.btor,11.857,unsat 30 | zipcpu-zipmmu-p02.btor,12.27,unsat 31 | zipcpu-zipmmu-p09.btor,5.935,unsat 32 | zipcpu-zipmmu-p14.btor,4.922,unsat 33 | zipcpu-zipmmu-p26.btor,9.903,unsat 34 | zipcpu-zipmmu-p31.btor,10.072,unsat 35 | zipcpu-zipmmu-p33.btor,16.177,unsat 36 | zipcpu-zipmmu-p39.btor,6.03,unsat 37 | zipcpu-zipmmu-p48.btor,6.153,unsat 38 | -------------------------------------------------------------------------------- /include/Dialect/Smt/IR/Smt.h: -------------------------------------------------------------------------------- 1 | //===- SmtOps.h - Smt dialect ops -----------------*- C++ -*-===// 2 | // 3 | // This file is licensed 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 SMT_SMTOPS_H 10 | #define SMT_SMTOPS_H 11 | 12 | #include "mlir/IR/Dialect.h" 13 | #include "mlir/IR/BuiltinTypes.h" 14 | #include "mlir/IR/OpDefinition.h" 15 | #include "mlir/IR/OpImplementation.h" 16 | #include "mlir/Interfaces/InferTypeOpInterface.h" 17 | #include "mlir/Interfaces/SideEffectInterfaces.h" 18 | 19 | //===----------------------------------------------------------------------===// 20 | // SmtDialect 21 | //===----------------------------------------------------------------------===// 22 | 23 | #include "Dialect/Smt/IR/SmtOpsDialect.h.inc" 24 | 25 | //===----------------------------------------------------------------------===// 26 | // Smt Dialect Enum Attributes 27 | //===----------------------------------------------------------------------===// 28 | 29 | #include "Dialect/Smt/IR/SmtOpsEnums.h.inc" 30 | 31 | //===----------------------------------------------------------------------===// 32 | // Smt Dialect Operations 33 | //===----------------------------------------------------------------------===// 34 | 35 | #define GET_OP_CLASSES 36 | #include "Dialect/Smt/IR/SmtOps.h.inc" 37 | 38 | #endif // SMT_SMTOPS_H 39 | -------------------------------------------------------------------------------- /utils/cex/witness/configs/sea.yaml: -------------------------------------------------------------------------------- 1 | verify_options: 2 | # Optimization level 3 | '-O3': '' 4 | # 5 | # PREPROCESSING 6 | # 7 | inline: '' 8 | enable-loop-idiom: '' 9 | enable-indvar: '' 10 | no-lower-gv-init-struct: '' 11 | externalize-addr-taken-functions: '' 12 | no-kill-vaarg: '' 13 | with-arith-overflow: true 14 | horn-unify-assumes: true 15 | horn-gsa: '' 16 | # do not instrument library functions with memory assertions 17 | no-fat-fns: 'bcmp,memcpy,assert_bytes_match,ensure_linked_list_is_allocated,sea_aws_linked_list_is_valid' 18 | # context-sensitive type-aware alias analysis 19 | dsa: sea-cs-t 20 | # weak support for function pointers. sea-dsa is better but less stable 21 | devirt-functions: 'types' 22 | # bit-precise memory-precise operational semantics 23 | bmc: opsem 24 | horn-vcgen-use-ite: '' 25 | # ignore control flow 26 | horn-vcgen-only-dataflow: true 27 | # reduce by data dependence 28 | horn-bmc-coi: true 29 | # static allocator supports symbolic allocation size 30 | sea-opsem-allocator: static 31 | # stack allocation from a symbolic starting point 32 | horn-explicit-sp0: false 33 | # lambdas for memory 34 | horn-bv2-lambdas: '' 35 | # use z3 simplifier during vcgen 36 | horn-bv2-simplify: false 37 | # wide memory manager to track pointer sizes 38 | horn-bv2-extra-widemem: '' 39 | # intermediate results in human readable form for debugging 40 | '-S': '' 41 | # keep intermediate results for debugging 42 | keep-temps: '' 43 | temp-dir: /tmp/btor2mlir 44 | # time and result stats 45 | horn-stats: true -------------------------------------------------------------------------------- /tools/btor2mlir-opt/btor2mlir-opt.cpp: -------------------------------------------------------------------------------- 1 | //===- standalone-opt.cpp ---------------------------------------*- C++ -*-===// 2 | // 3 | // This file is licensed 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 | #include "mlir/IR/Dialect.h" 10 | #include "mlir/IR/MLIRContext.h" 11 | #include "mlir/InitAllDialects.h" 12 | #include "mlir/InitAllPasses.h" 13 | #include "mlir/Pass/Pass.h" 14 | #include "mlir/Pass/PassManager.h" 15 | #include "mlir/Support/FileUtilities.h" 16 | #include "mlir/Support/MlirOptMain.h" 17 | #include "llvm/Support/CommandLine.h" 18 | #include "llvm/Support/InitLLVM.h" 19 | #include "llvm/Support/SourceMgr.h" 20 | #include "llvm/Support/ToolOutputFile.h" 21 | 22 | #include "Dialect/Btor/IR/Btor.h" 23 | #include "Conversion/Passes.h" 24 | 25 | int main(int argc, char **argv) { 26 | mlir::registerAllPasses(); 27 | mlir::btor::registerBtorConversionPasses(); 28 | 29 | mlir::DialectRegistry registry; 30 | registry.insert(); 31 | registry.insert(); 32 | // Add the following to include *all* MLIR Core dialects, or selectively 33 | // include what you need like above. You only need to register dialects that 34 | // will be *parsed* by the tool, not the one generated 35 | // registerAllDialects(registry); 36 | 37 | return mlir::asMainReturnCode( 38 | mlir::MlirOptMain(argc, argv, "Btor optimizer driver\n", registry)); 39 | } 40 | -------------------------------------------------------------------------------- /test/Btor/div_zero.btor.mlir.opt.ll: -------------------------------------------------------------------------------- 1 | ; ModuleID = 'LLVMDialectModule' 2 | source_filename = "LLVMDialectModule" 3 | 4 | declare i8* @malloc(i64) 5 | 6 | declare void @free(i8*) 7 | 8 | declare void @__VERIFIER_error() 9 | 10 | define void @main() !dbg !3 { 11 | br label %1, !dbg !7 12 | 13 | 1: ; preds = %2, %0 14 | br i1 false, label %2, label %3, !dbg !9 15 | 16 | 2: ; preds = %1 17 | br label %1, !dbg !10 18 | 19 | 3: ; preds = %1 20 | call void @__VERIFIER_error(), !dbg !11 21 | unreachable, !dbg !12 22 | } 23 | 24 | !llvm.dbg.cu = !{!0} 25 | !llvm.module.flags = !{!2} 26 | 27 | !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "mlir", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug) 28 | !1 = !DIFile(filename: "LLVMDialectModule", directory: "/") 29 | !2 = !{i32 2, !"Debug Info Version", i32 3} 30 | !3 = distinct !DISubprogram(name: "main", linkageName: "main", scope: null, file: !4, line: 3, type: !5, scopeLine: 3, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !6) 31 | !4 = !DIFile(filename: "btor2mlir-1/test/Btor/div_zero.btor.mlir.opt", directory: "/home/jetafese") 32 | !5 = !DISubroutineType(types: !6) 33 | !6 = !{} 34 | !7 = !DILocation(line: 4, column: 5, scope: !8) 35 | !8 = !DILexicalBlockFile(scope: !3, file: !4, discriminator: 0) 36 | !9 = !DILocation(line: 17, column: 5, scope: !8) 37 | !10 = !DILocation(line: 19, column: 5, scope: !8) 38 | !11 = !DILocation(line: 21, column: 5, scope: !8) 39 | !12 = !DILocation(line: 22, column: 5, scope: !8) 40 | -------------------------------------------------------------------------------- /test/Btor/mod_zero.btor.mlir.opt.ll: -------------------------------------------------------------------------------- 1 | ; ModuleID = 'LLVMDialectModule' 2 | source_filename = "LLVMDialectModule" 3 | 4 | declare i8* @malloc(i64) 5 | 6 | declare void @free(i8*) 7 | 8 | declare void @__VERIFIER_error() 9 | 10 | define void @main() !dbg !3 { 11 | br label %1, !dbg !7 12 | 13 | 1: ; preds = %2, %0 14 | br i1 false, label %2, label %3, !dbg !9 15 | 16 | 2: ; preds = %1 17 | br label %1, !dbg !10 18 | 19 | 3: ; preds = %1 20 | call void @__VERIFIER_error(), !dbg !11 21 | unreachable, !dbg !12 22 | } 23 | 24 | !llvm.dbg.cu = !{!0} 25 | !llvm.module.flags = !{!2} 26 | 27 | !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "mlir", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug) 28 | !1 = !DIFile(filename: "LLVMDialectModule", directory: "/") 29 | !2 = !{i32 2, !"Debug Info Version", i32 3} 30 | !3 = distinct !DISubprogram(name: "main", linkageName: "main", scope: null, file: !4, line: 3, type: !5, scopeLine: 3, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !6) 31 | !4 = !DIFile(filename: "btor2mlir-1/test/Btor/mod_zero.btor.mlir.opt", directory: "/home/jetafese") 32 | !5 = !DISubroutineType(types: !6) 33 | !6 = !{} 34 | !7 = !DILocation(line: 4, column: 5, scope: !8) 35 | !8 = !DILexicalBlockFile(scope: !3, file: !4, discriminator: 0) 36 | !9 = !DILocation(line: 24, column: 5, scope: !8) 37 | !10 = !DILocation(line: 26, column: 5, scope: !8) 38 | !11 = !DILocation(line: 28, column: 5, scope: !8) 39 | !12 = !DILocation(line: 29, column: 5, scope: !8) 40 | -------------------------------------------------------------------------------- /test/Btor/rem_zero.btor.mlir.opt.ll: -------------------------------------------------------------------------------- 1 | ; ModuleID = 'LLVMDialectModule' 2 | source_filename = "LLVMDialectModule" 3 | 4 | declare i8* @malloc(i64) 5 | 6 | declare void @free(i8*) 7 | 8 | declare void @__VERIFIER_error() 9 | 10 | define void @main() !dbg !3 { 11 | br label %1, !dbg !7 12 | 13 | 1: ; preds = %2, %0 14 | br i1 false, label %2, label %3, !dbg !9 15 | 16 | 2: ; preds = %1 17 | br label %1, !dbg !10 18 | 19 | 3: ; preds = %1 20 | call void @__VERIFIER_error(), !dbg !11 21 | unreachable, !dbg !12 22 | } 23 | 24 | !llvm.dbg.cu = !{!0} 25 | !llvm.module.flags = !{!2} 26 | 27 | !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "mlir", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug) 28 | !1 = !DIFile(filename: "LLVMDialectModule", directory: "/") 29 | !2 = !{i32 2, !"Debug Info Version", i32 3} 30 | !3 = distinct !DISubprogram(name: "main", linkageName: "main", scope: null, file: !4, line: 3, type: !5, scopeLine: 3, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !6) 31 | !4 = !DIFile(filename: "btor2mlir-1/test/Btor/rem_zero.btor.mlir.opt", directory: "/home/jetafese") 32 | !5 = !DISubroutineType(types: !6) 33 | !6 = !{} 34 | !7 = !DILocation(line: 4, column: 5, scope: !8) 35 | !8 = !DILexicalBlockFile(scope: !3, file: !4, discriminator: 0) 36 | !9 = !DILocation(line: 15, column: 5, scope: !8) 37 | !10 = !DILocation(line: 17, column: 5, scope: !8) 38 | !11 = !DILocation(line: 19, column: 5, scope: !8) 39 | !12 = !DILocation(line: 20, column: 5, scope: !8) 40 | -------------------------------------------------------------------------------- /utils/cex/witness/get_cex_seahorn.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "btor2mlir-translate --import-btor $1 > $1.mlir" ; \ 4 | btor2mlir-translate --import-btor $1 > $1.mlir 5 | echo "btor2mlir-translate --export-btor $1.mlir > $1.export.btor" 6 | btor2mlir-translate --export-btor $1.mlir > $1.export.btor ; \ 7 | echo "btor2mlir-opt $1.mlir \ 8 | --convert-btornd-to-llvm \ 9 | --convert-btor-to-vector \ 10 | --convert-arith-to-llvm \ 11 | --convert-std-to-llvm \ 12 | --convert-btor-to-llvm \ 13 | --convert-vector-to-llvm > $1.mlir.opt" ; \ 14 | btor2mlir-opt $1.mlir \ 15 | --convert-btornd-to-llvm \ 16 | --convert-btor-to-vector \ 17 | --convert-arith-to-llvm \ 18 | --convert-std-to-llvm \ 19 | --convert-btor-to-llvm \ 20 | --convert-vector-to-llvm > $1.mlir.opt ; \ 21 | echo "btor2mlir-translate --mlir-to-llvmir $1.mlir.opt > $1.mlir.opt.ll"; \ 22 | btor2mlir-translate --mlir-to-llvmir $1.mlir.opt > $1.mlir.opt.ll ; \ 23 | 24 | # exe-cex 25 | # --oll=$1.mlir.opt.ll.final.ll 26 | echo "time timeout 300 sea yama -y configs/sea-cex.yaml bpf --verbose=2 -m64 $1.mlir.opt.ll -o$1.mlir.opt.ll.smt2" 27 | time timeout 300 sea yama -y configs/sea-cex.yaml bpf --verbose=2 -m64 $1.mlir.opt.ll -o$1.mlir.opt.ll.smt2 28 | 29 | echo "clang++-14 $1.mlir.opt.ll /tmp/h2.ll ../../build/run/lib/libcex.a -o h2.out" 30 | clang++-14 $1.mlir.opt.ll /tmp/h2.ll ../../build/run/lib/libcex.a -o h2.out 31 | 32 | echo "./h2.out > /tmp/h2.txt" 33 | env ./h2.out > /tmp/h2.txt 34 | 35 | echo "python3 witness_generator.py /tmp/h2.txt" 36 | python3 witness_generator.py /tmp/h2.txt 37 | 38 | echo "btorsim -v $1 cex.txt" 39 | btorsim -v $1 cex.txt 40 | -------------------------------------------------------------------------------- /utils/cex/cex.cpp: -------------------------------------------------------------------------------- 1 | #include "cex.h" 2 | #include 3 | 4 | extern "C" { 5 | 6 | void __VERIFIER_error() { 7 | std::cout << "[sea] __VERIFIER_error was executed" << std::endl; 8 | exit(1); 9 | } 10 | 11 | void __VERIFIER_assert(bool x, int property) { 12 | std::cout << "[sea] __VERIFIER_assert was called for property: " << property << std::endl; 13 | } 14 | 15 | void btor2mlir_print_input_num(unsigned num, unsigned value, unsigned width) { 16 | std::cout << "input, " << num << ", " << value << ", " << width << std::endl; 17 | } 18 | 19 | void btor2mlir_print_state_num(unsigned num, unsigned value, unsigned width) { 20 | std::cout << "state, " << num << ", " << value << ", " << width << std::endl; 21 | } 22 | 23 | bool __seahorn_get_value_i1(int ctr, bool *g_arr, int g_arr_sz) { 24 | std::cout << "[sea] __seahorn_get_value_i1(" << ctr << ", " << g_arr_sz << ")\n"; 25 | if (ctr >= g_arr_sz) { 26 | std::cout << "\tout-of-bounds index\n"; 27 | return 0; 28 | } else { 29 | return g_arr[ctr]; 30 | } 31 | } 32 | 33 | #define get_value_helper(ctype, llvmtype) \ 34 | ctype __seahorn_get_value_ ## llvmtype (int ctr, ctype *g_arr, int g_arr_sz) { \ 35 | std::cout << "[sea] __seahorn_get_value_(" << #llvmtype ", " << ctr << ", " << g_arr_sz << ")\n"; \ 36 | if (ctr >= g_arr_sz) { \ 37 | std::cout << "\tout-of-bounds index\n"; \ 38 | return 0; \ 39 | } \ 40 | else { \ 41 | return g_arr[ctr]; \ 42 | } \ 43 | } 44 | 45 | #define get_value_int(bits) get_value_helper(int ## bits ## _t, i ## bits) 46 | 47 | get_value_int(64); 48 | get_value_int(32); 49 | get_value_int(16); 50 | get_value_int(8); 51 | 52 | get_value_helper(intptr_t, ptr_internal); 53 | 54 | } 55 | -------------------------------------------------------------------------------- /include/Dialect/Btor/IR/BtorAttributes.td: -------------------------------------------------------------------------------- 1 | #ifndef BTOR_ATTRS 2 | #define BTOR_ATTRS 3 | 4 | include "mlir/IR/EnumAttr.td" 5 | include "BtorBase.td" 6 | 7 | //===----------------------------------------------------------------------===// 8 | // btor constants definition. 9 | //===----------------------------------------------------------------------===// 10 | 11 | def BTOR_EQ : I64EnumAttrCase<"eq", 0>; 12 | def BTOR_NE : I64EnumAttrCase<"ne", 1>; 13 | def BTOR_SLT : I64EnumAttrCase<"slt", 2>; 14 | def BTOR_SLE : I64EnumAttrCase<"sle", 3>; 15 | def BTOR_SGT : I64EnumAttrCase<"sgt", 4>; 16 | def BTOR_SGE : I64EnumAttrCase<"sge", 5>; 17 | def BTOR_ULT : I64EnumAttrCase<"ult", 6>; 18 | def BTOR_ULE : I64EnumAttrCase<"ule", 7>; 19 | def BTOR_UGT : I64EnumAttrCase<"ugt", 8>; 20 | def BTOR_UGE : I64EnumAttrCase<"uge", 9>; 21 | 22 | def BtorPredicateAttr : I64EnumAttr< 23 | "BtorPredicate", "btor.cmp comparison predicate", 24 | [BTOR_EQ, BTOR_NE, BTOR_SLT, BTOR_SLE, BTOR_SGT, 25 | BTOR_SGE, BTOR_ULT, BTOR_ULE, BTOR_UGT, BTOR_UGE]> { 26 | let cppNamespace = "::mlir::btor"; 27 | } 28 | 29 | //===----------------------------------------------------------------------===// 30 | // btor attributes definition. 31 | //===----------------------------------------------------------------------===// 32 | 33 | class Btor_Attr traits = [], string baseCppClass = "::mlir::Attribute"> 34 | : AttrDef { 35 | let mnemonic = attrMnemonic; 36 | } 37 | 38 | def BitVecAttribute : Btor_Attr<"BitVec", "bvattr"> { 39 | let summary = "bit vector attribute"; 40 | let description = [{ 41 | Bit vector attribute 42 | }]; 43 | let parameters = (ins "BitVecType":$type, "APInt":$value); 44 | } 45 | 46 | #endif // BTOR_ATTRS -------------------------------------------------------------------------------- /include/Dialect/Smt/IR/SmtBase.td: -------------------------------------------------------------------------------- 1 | //===- SmtDialect.td - Smt dialect -----------*- tablegen -*-===// 2 | // 3 | // This file is licensed 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 SMT_DIALECT 10 | #define SMT_DIALECT 11 | 12 | include "mlir/IR/EnumAttr.td" 13 | include "mlir/IR/OpBase.td" 14 | 15 | //===----------------------------------------------------------------------===// 16 | // Smt constants definition. 17 | //===----------------------------------------------------------------------===// 18 | 19 | def Smt_EQ : I64EnumAttrCase<"eq", 0>; 20 | def Smt_NE : I64EnumAttrCase<"ne", 1>; 21 | def Smt_SLT : I64EnumAttrCase<"slt", 2>; 22 | def Smt_SLE : I64EnumAttrCase<"sle", 3>; 23 | def Smt_SGT : I64EnumAttrCase<"sgt", 4>; 24 | def Smt_SGE : I64EnumAttrCase<"sge", 5>; 25 | def Smt_ULT : I64EnumAttrCase<"ult", 6>; 26 | def Smt_ULE : I64EnumAttrCase<"ule", 7>; 27 | def Smt_UGT : I64EnumAttrCase<"ugt", 8>; 28 | def Smt_UGE : I64EnumAttrCase<"uge", 9>; 29 | 30 | def SmtPredicateAttr : I64EnumAttr< 31 | "SmtPredicate", "smt.cmp comparison predicate", 32 | [Smt_EQ, Smt_NE, Smt_SLT, Smt_SLE, Smt_SGT, 33 | Smt_SGE, Smt_ULT, Smt_ULE, Smt_UGT, Smt_UGE]> { 34 | let cppNamespace = "::mlir::smt"; 35 | } 36 | 37 | //===----------------------------------------------------------------------===// 38 | // Smt dialect definition. 39 | //===----------------------------------------------------------------------===// 40 | 41 | def Smt_Dialect : Dialect { 42 | let name = "smt"; 43 | let summary = "An SMT2 MLIR dialect"; 44 | let cppNamespace = "::mlir::smt"; 45 | } 46 | 47 | #endif // SMT_DIALECT 48 | -------------------------------------------------------------------------------- /results/vcGen/vcGen_18D_wolf_0321231812.csv: -------------------------------------------------------------------------------- 1 | base,Cpu,Mem,BMC,seahorn_total,Result 2 | zipcpu-busdelay-p47.btor,9.18,382,0.33,0.76, 3 | zipcpu-busdelay-p30.btor,9.10,380,0.32,0.77, 4 | zipcpu-busdelay-p36.btor,9.63,384,0.36,0.80, 5 | zipcpu-busdelay-p00.btor,10.01,385,0.34,0.78, 6 | zipcpu-busdelay-p43.btor,10.27,385,0.38,0.87, 7 | zipcpu-busdelay-p15.btor,11.25,392,0.37,0.87, 8 | zipcpu-busdelay-p46.btor,9.25,382,0.32,0.75, 9 | VexRiscv-regch0-30-p1.btor,20.39,358,0.02,0.10, 10 | VexRiscv-regch0-20-p0.btor,20.57,358,0.02,0.11, 11 | zipcpu-pfcache-p22.btor,22.22,409,0.39,1.15, 12 | zipcpu-zipmmu-p09.btor,23.57,506,0.90,1.85, 13 | zipcpu-pfcache-p02.btor,23.70,408,0.61,1.09, 14 | zipcpu-pfcache-p27.btor,24.08,412,0.55,1.26, 15 | zipcpu-pfcache-p01.btor,24.16,410,0.65,1.42, 16 | zipcpu-pfcache-p20.btor,24.20,411,0.40,0.98, 17 | zipcpu-zipmmu-p02.btor,24.43,505,0.52,1.28, 18 | zipcpu-pfcache-p24.btor,24.73,411,0.65,1.42, 19 | zipcpu-zipmmu-p14.btor,24.74,506,0.54,1.42, 20 | zipcpu-zipmmu-p33.btor,24.80,508,0.53,1.38, 21 | zipcpu-zipmmu-p39.btor,25.66,504,0.55,1.10, 22 | zipcpu-zipmmu-p00.btor,25.90,508,0.54,1.14, 23 | zipcpu-zipmmu-p26.btor,26.14,506,0.52,1.04, 24 | zipcpu-zipmmu-p31.btor,26.36,507,0.52,1.05, 25 | zipcpu-zipmmu-p48.btor,19.50,503,0.51,1.02, 26 | zipcpu-pfcache-p13.btor,35.21,513,0.62,1.22, 27 | zipcpu-pfcache-p28.btor,31.78,516,0.68,1.33, 28 | VexRiscv-regch0-15-p0.btor,50.25,791,1.82,3.07, 29 | picorv32-pcregs-p0.btor,58.57,885,2.41,3.65, 30 | picorv32-pcregs-p2.btor,60.37,924,3.11,4.42, 31 | picorv32-check-p20.btor,86.56,4099,37.52,39.24, 32 | picorv32-check-p09.btor,97.92,4144,50.83,53.01, 33 | ponylink-slaveTXlen-unsat.btor,119.99,1374,3.73,5.36, 34 | picorv32-check-p22.btor,115.45,4274,70.92,73.51, 35 | picorv32-check-p05.btor,130.97,7910,84.26,86.76, 36 | picorv32-check-p12.btor,132.74,7678,84.10,86.34, 37 | picorv32-check-p19.btor,179.66,7908,128.73,131.78, 38 | -------------------------------------------------------------------------------- /test/Btor/concat.btor.mlir.opt.ll: -------------------------------------------------------------------------------- 1 | ; ModuleID = 'LLVMDialectModule' 2 | source_filename = "LLVMDialectModule" 3 | 4 | declare i8* @malloc(i64) 5 | 6 | declare void @free(i8*) 7 | 8 | declare void @verifier.error() 9 | 10 | define void @main() !dbg !3 { 11 | br label %1, !dbg !7 12 | 13 | 1: ; preds = %5, %0 14 | %2 = phi i8 [ -2, %5 ], [ 0, %0 ] 15 | %3 = icmp eq i8 %2, -2, !dbg !9 16 | %4 = xor i1 %3, true, !dbg !10 17 | br i1 %4, label %5, label %6, !dbg !11 18 | 19 | 5: ; preds = %1 20 | br label %1, !dbg !12 21 | 22 | 6: ; preds = %1 23 | call void @verifier.error(), !dbg !13 24 | unreachable, !dbg !14 25 | } 26 | 27 | !llvm.dbg.cu = !{!0} 28 | !llvm.module.flags = !{!2} 29 | 30 | !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "mlir", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug) 31 | !1 = !DIFile(filename: "LLVMDialectModule", directory: "/") 32 | !2 = !{i32 2, !"Debug Info Version", i32 3} 33 | !3 = distinct !DISubprogram(name: "main", linkageName: "main", scope: null, file: !4, line: 3, type: !5, scopeLine: 3, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !6) 34 | !4 = !DIFile(filename: "../../../../btor2mlir-1/test/Btor/concat.btor.mlir.opt", directory: "/home/jetafese/runbench/svcomp/sea/btor2mlir") 35 | !5 = !DISubroutineType(types: !6) 36 | !6 = !{} 37 | !7 = !DILocation(line: 5, column: 5, scope: !8) 38 | !8 = !DILexicalBlockFile(scope: !3, file: !4, discriminator: 0) 39 | !9 = !DILocation(line: 15, column: 11, scope: !8) 40 | !10 = !DILocation(line: 17, column: 11, scope: !8) 41 | !11 = !DILocation(line: 18, column: 5, scope: !8) 42 | !12 = !DILocation(line: 20, column: 5, scope: !8) 43 | !13 = !DILocation(line: 22, column: 5, scope: !8) 44 | !14 = !DILocation(line: 23, column: 5, scope: !8) 45 | -------------------------------------------------------------------------------- /results/seahorn/seahorn_18D_wolf_0321231929.csv: -------------------------------------------------------------------------------- 1 | base,Cpu,Mem,BMC,seahorn_total,Result 2 | zipcpu-busdelay-p47.btor,8.67,417,0.28,0.71,TRUE 3 | zipcpu-busdelay-p43.btor,9.66,419,0.30,0.79,TRUE 4 | zipcpu-busdelay-p30.btor,9.78,415,1.51,1.92,TRUE 5 | zipcpu-busdelay-p00.btor,12.11,416,3.15,3.57,TRUE 6 | zipcpu-busdelay-p15.btor,12.43,446,2.17,2.73,TRUE 7 | zipcpu-busdelay-p36.btor,14.14,423,5.38,5.82,TRUE 8 | VexRiscv-regch0-30-p1.btor,17.06,358,0.02,0.08,TRUE 9 | VexRiscv-regch0-20-p0.btor,17.75,358,0.03,0.12,TRUE 10 | zipcpu-busdelay-p46.btor,10.17,416,1.72,2.15,TRUE 11 | zipcpu-pfcache-p02.btor,22.07,456,0.21,0.67,TRUE 12 | zipcpu-pfcache-p20.btor,22.10,464,0.24,0.77,TRUE 13 | zipcpu-pfcache-p01.btor,22.43,456,0.36,1.12,TRUE 14 | zipcpu-pfcache-p22.btor,22.66,459,0.37,1.13,TRUE 15 | zipcpu-pfcache-p24.btor,23.45,457,0.37,1.14,TRUE 16 | zipcpu-zipmmu-p09.btor,23.68,512,1.34,2.19,TRUE 17 | zipcpu-zipmmu-p14.btor,23.83,502,0.68,1.22,TRUE 18 | zipcpu-pfcache-p27.btor,24.25,473,0.27,0.93,TRUE 19 | zipcpu-zipmmu-p02.btor,24.88,508,1.56,2.40,TRUE 20 | zipcpu-zipmmu-p33.btor,25.45,508,1.80,2.71,TRUE 21 | zipcpu-zipmmu-p39.btor,25.78,550,1.32,2.26,TRUE 22 | zipcpu-zipmmu-p26.btor,27.65,524,2.98,3.67,TRUE 23 | zipcpu-zipmmu-p00.btor,27.68,509,2.62,3.40,TRUE 24 | zipcpu-zipmmu-p48.btor,19.78,504,1.25,1.76,TRUE 25 | zipcpu-zipmmu-p31.btor,32.93,555,6.98,7.67,TRUE 26 | zipcpu-pfcache-p13.btor,33.14,829,0.69,1.30,TRUE 27 | zipcpu-pfcache-p28.btor,30.82,889,0.97,1.62,TRUE 28 | VexRiscv-regch0-15-p0.btor,87.21,1446,39.51,40.81,TRUE 29 | picorv32-check-p20.btor,98.15,7237,51.36,53.06,TRUE 30 | picorv32-check-p09.btor,113.13,7625,65.54,67.95,TRUE 31 | ponylink-slaveTXlen-unsat.btor,116.57,1532,3.67,5.44,TRUE 32 | picorv32-check-p22.btor,126.24,7848,83.98,86.33,TRUE 33 | picorv32-check-p12.btor,151.40,13240,104.54,107.24,TRUE 34 | picorv32-check-p05.btor,157.80,13442,110.20,112.95,TRUE 35 | picorv32-check-p19.btor,207.16,14318,157.67,160.98,TRUE 36 | picorv32-pcregs-p0.btor,51.77,386,,, 37 | picorv32-pcregs-p2.btor,51.92,389,,, 38 | -------------------------------------------------------------------------------- /test/Btor/redor.btor.mlir.opt.ll: -------------------------------------------------------------------------------- 1 | ; ModuleID = 'LLVMDialectModule' 2 | source_filename = "LLVMDialectModule" 3 | 4 | declare i8* @malloc(i64) 5 | 6 | declare void @free(i8*) 7 | 8 | declare void @__VERIFIER_error() 9 | 10 | declare void @btor2mlir_print_input_num(i64, i64, i64) 11 | 12 | declare i8 @nd_bv8() 13 | 14 | define void @main() !dbg !3 { 15 | br label %1, !dbg !7 16 | 17 | 1: ; preds = %6, %0 18 | %2 = phi i1 [ %4, %6 ], [ false, %0 ] 19 | %3 = call i8 @nd_bv8(), !dbg !9 20 | %4 = icmp eq i8 %3, -1, !dbg !10 21 | %5 = xor i1 %2, true, !dbg !11 22 | br i1 %5, label %6, label %7, !dbg !12 23 | 24 | 6: ; preds = %1 25 | br label %1, !dbg !13 26 | 27 | 7: ; preds = %1 28 | call void @__VERIFIER_error(), !dbg !14 29 | unreachable, !dbg !15 30 | } 31 | 32 | !llvm.dbg.cu = !{!0} 33 | !llvm.module.flags = !{!2} 34 | 35 | !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "mlir", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug) 36 | !1 = !DIFile(filename: "LLVMDialectModule", directory: "/") 37 | !2 = !{i32 2, !"Debug Info Version", i32 3} 38 | !3 = distinct !DISubprogram(name: "main", linkageName: "main", scope: null, file: !4, line: 5, type: !5, scopeLine: 5, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !6) 39 | !4 = !DIFile(filename: "btor2mlir-1/test/Btor/redor.btor.mlir.opt", directory: "/home/jetafese") 40 | !5 = !DISubroutineType(types: !6) 41 | !6 = !{} 42 | !7 = !DILocation(line: 7, column: 5, scope: !8) 43 | !8 = !DILexicalBlockFile(scope: !3, file: !4, discriminator: 0) 44 | !9 = !DILocation(line: 9, column: 10, scope: !8) 45 | !10 = !DILocation(line: 12, column: 10, scope: !8) 46 | !11 = !DILocation(line: 14, column: 10, scope: !8) 47 | !12 = !DILocation(line: 15, column: 5, scope: !8) 48 | !13 = !DILocation(line: 17, column: 5, scope: !8) 49 | !14 = !DILocation(line: 19, column: 5, scope: !8) 50 | !15 = !DILocation(line: 20, column: 5, scope: !8) 51 | -------------------------------------------------------------------------------- /results/25-btormc/25-btormc_19_goel_0202231725.csv: -------------------------------------------------------------------------------- 1 | index,btor_time,status 2 | cal102.btor2,295.53499999999997, 3 | cal106.btor2,299.324, 4 | cal107.btor2,299.548, 5 | cal112.btor2,297.988, 6 | cal117.btor2,299.077, 7 | cal118.btor2,299.22, 8 | cal119.btor2,298.911, 9 | cal122.btor2,294.619, 10 | cal123.btor2,299.339, 11 | cal125.btor2,296.513, 12 | cal129.btor2,298.949, 13 | cal140.btor2,299.20799999999997, 14 | cal142.btor2,299.4, 15 | cal143.btor2,299.148, 16 | cal149.btor2,299.178, 17 | cal156.btor2,296.381, 18 | cal159.btor2,0.273,unsat 19 | cal161.btor2,0.285,unsat 20 | cal162.btor2,0.249,unsat 21 | cal176.btor2,298.286, 22 | cal192.btor2,297.298, 23 | cal2.btor2,298.869, 24 | cal201.btor2,298.102, 25 | cal206.btor2,299.16700000000003, 26 | cal209.btor2,298.496, 27 | cal21.btor2,36.02,unsat 28 | cal210.btor2,298.763, 29 | cal220.btor2,298.591, 30 | cal224.btor2,296.672, 31 | cal227.btor2,295.913, 32 | cal234.btor2,298.871, 33 | cal33.btor2,298.201, 34 | cal34.btor2,299.749, 35 | cal35.btor2,55.691,unsat 36 | cal37.btor2,68.853,unsat 37 | cal4.btor2,15.319,unsat 38 | cal41.btor2,10.749,unsat 39 | cal81.btor2,7.814,unsat 40 | cal84.btor2,297.168, 41 | cal86.btor2,298.804, 42 | cal87.btor2,296.05, 43 | cal90.btor2,299.298, 44 | cal97.btor2,295.275, 45 | cal99.btor2,298.988, 46 | gen10.btor2,3.878,unsat 47 | gen12.btor2,4.168,unsat 48 | gen14.btor2,4.393,unsat 49 | gen21.btor2,4.033,unsat 50 | gen31.btor2,299.17, 51 | gen35.btor2,114.574,unsat 52 | gen39.btor2,5.036,unsat 53 | gen43.btor2,297.984, 54 | gen44.btor2,299.468, 55 | h_RCU.btor2,1.849,unsat 56 | h_TreeArb.btor2,2.849,unsat 57 | miim.btor2,1.126,unsat 58 | mul1.btor2,298.492, 59 | mul2.btor2,297.037, 60 | mul3.btor2,297.388, 61 | mul7.btor2,0.022,sat 62 | mul9.btor2,298.783, 63 | paper_v3.btor2,0.004,unsat 64 | vcegar_QF_BV_ar.btor2,0.004,unsat 65 | vcegar_QF_BV_itc99_b13_p10.btor2,0.003,unsat 66 | vcegar_arrays_itc99_b12_p2.btor2,3.448,unsat 67 | vis_arrays_am2901.btor2,299.53499999999997, 68 | vis_arrays_am2910_p1.btor2,1.137,unsat 69 | vis_arrays_am2910_p2.btor2,0.32,unsat 70 | vis_arrays_am2910_p3.btor2,1.32,unsat 71 | vis_arrays_buf_bug.btor2,5.495,sat 72 | vis_arrays_bufferAlloc.btor2,298.765, 73 | -------------------------------------------------------------------------------- /test/lit.cfg.py: -------------------------------------------------------------------------------- 1 | # -*- Python -*- 2 | 3 | import os 4 | import platform 5 | import re 6 | import subprocess 7 | import tempfile 8 | 9 | import lit.formats 10 | import lit.util 11 | 12 | from lit.llvm import llvm_config 13 | from lit.llvm.subst import ToolSubst 14 | from lit.llvm.subst import FindTool 15 | 16 | # Configuration file for the 'lit' test runner. 17 | 18 | # name: The name of this test suite. 19 | config.name = 'BTOR2MLIR' 20 | 21 | config.test_format = lit.formats.ShTest(not llvm_config.use_lit_shell) 22 | 23 | # suffixes: A list of file extensions to treat as test files. 24 | config.suffixes = ['.mlir'] 25 | 26 | # test_source_root: The root path where tests are located. 27 | config.test_source_root = os.path.dirname(__file__) 28 | 29 | # test_exec_root: The root path where tests should be run. 30 | config.test_exec_root = os.path.join(config.btor2mlir_obj_root, 'test') 31 | 32 | config.substitutions.append(('%PATH%', config.environment['PATH'])) 33 | config.substitutions.append(('%shlibext', config.llvm_shlib_ext)) 34 | 35 | llvm_config.with_system_environment( 36 | ['HOME', 'INCLUDE', 'LIB', 'TMP', 'TEMP']) 37 | 38 | llvm_config.use_default_substitutions() 39 | 40 | # excludes: A list of directories to exclude from the testsuite. The 'Inputs' 41 | # subdirectories contain auxiliary inputs for various tests in their parent 42 | # directories. 43 | config.excludes = ['Inputs', 'Examples', 'CMakeLists.txt', 'README.txt', 'LICENSE.txt'] 44 | 45 | # test_source_root: The root path where tests are located. 46 | config.test_source_root = os.path.dirname(__file__) 47 | 48 | # test_exec_root: The root path where tests should be run. 49 | config.test_exec_root = os.path.join(config.btor2mlir_obj_root, 'test') 50 | config.btor2mlir_tools_dir = os.path.join(config.btor2mlir_obj_root, 'bin') 51 | 52 | # Tweak the PATH to include the tools dir. 53 | llvm_config.with_environment('PATH', config.llvm_tools_dir, append_path=True) 54 | 55 | tool_dirs = [config.btor2mlir_tools_dir, config.llvm_tools_dir] 56 | tools = [ 57 | 'btor2mlir-opt', 58 | 'btor2mlir-translate' 59 | ] 60 | 61 | llvm_config.add_tool_substitutions(tools, tool_dirs) 62 | -------------------------------------------------------------------------------- /test/lit.site.cfg.py.in: -------------------------------------------------------------------------------- 1 | @LIT_SITE_CFG_IN_HEADER@ 2 | 3 | import sys 4 | 5 | config.host_triple = "@LLVM_HOST_TRIPLE@" 6 | config.target_triple = "@TARGET_TRIPLE@" 7 | config.llvm_src_root = "@LLVM_SOURCE_DIR@" 8 | config.llvm_obj_root = "@LLVM_BINARY_DIR@" 9 | config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" 10 | config.llvm_lib_dir = "@LLVM_LIBS_DIR@" 11 | config.llvm_shlib_dir = "@SHLIBDIR@" 12 | config.llvm_shlib_ext = "@SHLIBEXT@" 13 | config.llvm_exe_ext = "@EXEEXT@" 14 | config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" 15 | config.python_executable = "@PYTHON_EXECUTABLE@" 16 | config.gold_executable = "@GOLD_EXECUTABLE@" 17 | config.ld64_executable = "@LD64_EXECUTABLE@" 18 | config.enable_shared = @ENABLE_SHARED@ 19 | config.enable_assertions = @ENABLE_ASSERTIONS@ 20 | config.targets_to_build = "@TARGETS_TO_BUILD@" 21 | config.native_target = "@LLVM_NATIVE_ARCH@" 22 | config.llvm_bindings = "@LLVM_BINDINGS@".split(' ') 23 | config.host_os = "@HOST_OS@" 24 | config.host_cc = "@HOST_CC@" 25 | config.host_cxx = "@HOST_CXX@" 26 | config.enable_libcxx = "@LLVM_ENABLE_LIBCXX@" 27 | # Note: ldflags can contain double-quoted paths, so must use single quotes here. 28 | config.host_ldflags = '@HOST_LDFLAGS@' 29 | config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@" 30 | config.llvm_host_triple = '@LLVM_HOST_TRIPLE@' 31 | config.host_arch = "@HOST_ARCH@" 32 | config.btor2mlir_src_root = "@CMAKE_SOURCE_DIR@" 33 | config.btor2mlir_obj_root = "@CMAKE_BINARY_DIR@" 34 | 35 | # Support substitution of the tools_dir with user parameters. This is 36 | # used when we can't determine the tool dir at configuration time. 37 | try: 38 | config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params 39 | config.llvm_lib_dir = config.llvm_lib_dir % lit_config.params 40 | config.llvm_shlib_dir = config.llvm_shlib_dir % lit_config.params 41 | except KeyError: 42 | e = sys.exc_info()[1] 43 | key, = e.args 44 | lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) 45 | 46 | 47 | import lit.llvm 48 | lit.llvm.initialize(lit_config, config) 49 | 50 | # Let the main config do the real work. 51 | lit_config.load_config(config, "@CMAKE_SOURCE_DIR@/test/lit.cfg.py") 52 | -------------------------------------------------------------------------------- /include/Conversion/BtorToLLVM/ConvertBtorToLLVMPass.h: -------------------------------------------------------------------------------- 1 | #ifndef BTOR_CONVERSION_BTORTOLLVM_CONVERTBTORTOLLVMPASS_H_ 2 | #define BTOR_CONVERSION_BTORTOLLVM_CONVERTBTORTOLLVMPASS_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include "Dialect/Btor/IR/Btor.h" 8 | #include "mlir/Conversion/LLVMCommon/TypeConverter.h" 9 | #include "mlir/Dialect/LLVMIR/LLVMDialect.h" 10 | 11 | namespace mlir { 12 | class BtorToLLVMTypeConverter; 13 | class RewritePatternSet; 14 | class Pass; 15 | 16 | namespace btor { 17 | 18 | /// Collect a set of patterns to lower from btor to LLVM dialect 19 | void populateBtorToLLVMConversionPatterns(BtorToLLVMTypeConverter &converter, 20 | RewritePatternSet &patterns); 21 | 22 | /// Creates a pass to convert the Btor dialect into the LLVM dialect. 23 | std::unique_ptr createLowerToLLVMPass(); 24 | 25 | } // namespace btor 26 | class BtorToLLVMTypeConverter : public LLVMTypeConverter { 27 | public: 28 | BtorToLLVMTypeConverter(MLIRContext *ctx, 29 | const DataLayoutAnalysis *analysis = nullptr) 30 | : LLVMTypeConverter(ctx, analysis) { 31 | addConversion([&](btor::BitVecType type) -> llvm::Optional { 32 | return convertBtorBitVecType(type); 33 | }); 34 | addConversion([&](btor::ArrayType type) -> llvm::Optional { 35 | return convertBtorArrayType(type); 36 | }); 37 | } 38 | 39 | Type convertBtorBitVecType(btor::BitVecType type) { 40 | return ::IntegerType::get(type.getContext(), type.getWidth()); 41 | } 42 | 43 | Type convertIntegerType(mlir::IntegerType type) { 44 | return btor::BitVecType::get(type.getContext(), type.getWidth()); 45 | } 46 | 47 | VectorType convertBtorArrayType(btor::ArrayType type) { 48 | unsigned indexWidth = pow(2, type.getShape().getWidth()); 49 | auto elementType = 50 | ::IntegerType::get(type.getContext(), type.getElement().getWidth()); 51 | // return MemRefType::get(ArrayRef{indexWidth}, elementType); 52 | return VectorType::get(ArrayRef{indexWidth}, elementType); 53 | } 54 | }; 55 | 56 | } // namespace mlir 57 | 58 | #endif // BTOR_CONVERSION_BTORTOLLVM_CONVERTBTORTOLLVMPASS_H_ -------------------------------------------------------------------------------- /test/Btor/array.btor2.mlir.opt.ll: -------------------------------------------------------------------------------- 1 | ; ModuleID = 'LLVMDialectModule' 2 | source_filename = "LLVMDialectModule" 3 | 4 | declare i8* @malloc(i64) 5 | 6 | declare void @free(i8*) 7 | 8 | declare void @__VERIFIER_error() 9 | 10 | define void @main() !dbg !3 { 11 | br label %1, !dbg !7 12 | 13 | 1: ; preds = %8, %0 14 | %2 = phi <16 x i4> [ %5, %8 ], [ , %0 ] 15 | %3 = extractelement <16 x i4> %2, i4 -8, !dbg !9 16 | %4 = add i4 %3, 1, !dbg !10 17 | %5 = insertelement <16 x i4> %2, i4 %4, i4 -8, !dbg !11 18 | %6 = icmp eq i4 %3, -1, !dbg !12 19 | %7 = xor i1 %6, true, !dbg !13 20 | br i1 %7, label %8, label %9, !dbg !14 21 | 22 | 8: ; preds = %1 23 | br label %1, !dbg !15 24 | 25 | 9: ; preds = %1 26 | call void @__VERIFIER_error(), !dbg !16 27 | unreachable, !dbg !17 28 | } 29 | 30 | !llvm.dbg.cu = !{!0} 31 | !llvm.module.flags = !{!2} 32 | 33 | !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "mlir", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug) 34 | !1 = !DIFile(filename: "LLVMDialectModule", directory: "/") 35 | !2 = !{i32 2, !"Debug Info Version", i32 3} 36 | !3 = distinct !DISubprogram(name: "main", linkageName: "main", scope: null, file: !4, line: 3, type: !5, scopeLine: 3, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !6) 37 | !4 = !DIFile(filename: "btor2mlir-1/test/Btor/array.btor2.mlir.opt", directory: "/home/jetafese") 38 | !5 = !DISubroutineType(types: !6) 39 | !6 = !{} 40 | !7 = !DILocation(line: 5, column: 5, scope: !8) 41 | !8 = !DILexicalBlockFile(scope: !3, file: !4, discriminator: 0) 42 | !9 = !DILocation(line: 9, column: 10, scope: !8) 43 | !10 = !DILocation(line: 10, column: 10, scope: !8) 44 | !11 = !DILocation(line: 11, column: 10, scope: !8) 45 | !12 = !DILocation(line: 13, column: 10, scope: !8) 46 | !13 = !DILocation(line: 15, column: 11, scope: !8) 47 | !14 = !DILocation(line: 16, column: 5, scope: !8) 48 | !15 = !DILocation(line: 18, column: 5, scope: !8) 49 | !16 = !DILocation(line: 20, column: 5, scope: !8) 50 | !17 = !DILocation(line: 21, column: 5, scope: !8) 51 | -------------------------------------------------------------------------------- /utils/cex/witness/configs/sea-cex.yaml: -------------------------------------------------------------------------------- 1 | # Please read before adding options 2 | # 3 | # horn-logic-bmc 4 | # -------------- 5 | # This option is not added here because of https://github.com/seahorn/verify-c-common/issues/136 6 | # It is explicitly added for yices in CI since yices needs to know logic. 7 | # 8 | verify_options: 9 | # Optimization lelel. Lower to O1 for clearer counterexamples 10 | '-O1': '' 11 | # 12 | # PREPROCESSING 13 | # 14 | inline: '' 15 | enable-loop-idiom: '' 16 | enable-indvar: '' 17 | no-lower-gv-init-struct: '' 18 | externalize-addr-taken-functions: '' 19 | no-kill-vaarg: '' 20 | with-arith-overflow: true 21 | horn-unify-assumes: false 22 | bound: 20 23 | # do not instrument library functions with memory assertions 24 | no-fat-fns: 'bcmp,memcpy,assert_bytes_match,ensure_linked_list_is_allocated,sea_aws_linked_list_is_valid' 25 | horn-gsa: false 26 | # context-sensitive type-aware alias analysis 27 | dsa: sea-cs-t 28 | # weak support for function pointers. sea-dsa is better but less stable 29 | devirt-functions: 'types' 30 | # bit-precise memory-precise operational semantics 31 | bmc: opsem 32 | horn-vcgen-use-ite: '' 33 | # ignore control flow 34 | horn-vcgen-only-dataflow: false 35 | # reduce by data dependence 36 | horn-bmc-coi: false 37 | # static allocator supports symbolic allocation size 38 | sea-opsem-allocator: static 39 | # stack allocation from a symbolic starting point 40 | horn-explicit-sp0: false 41 | # lambdas for memory 42 | horn-bv2-lambdas: false 43 | # use z3 simplifier during vcgen 44 | horn-bv2-simplify: true 45 | # wide memory manager to track pointer sizes 46 | horn-bv2-extra-widemem: '' 47 | # intermediate results in human readable form for debugging 48 | '-S': '' 49 | # keep intermediate results for debugging 50 | keep-temps: '' 51 | temp-dir: /tmp/cex 52 | # time and result stats 53 | horn-stats: true 54 | # produce counterexample harness 55 | cex: /tmp/h2.ll 56 | # printable counterexample log 57 | log: cex 58 | # number of words to unroll symbolic memcpy for array-based memory representation 59 | # should be at least MAX_BUFFER_SIZE 60 | horn-array-sym-memcpy-unroll-count: 10 61 | # print memory state as a table 62 | # XXX still flaky, sometimes only the last byte can be trusted 63 | horn-bmc-hexdump: true 64 | -------------------------------------------------------------------------------- /results/boolector/boolector_19_goel_0330231132.csv: -------------------------------------------------------------------------------- 1 | index,btor_time,status 2 | cal102.btor2,297.04200000000003,unknown 3 | cal106.btor2,297.504,unknown 4 | cal107.btor2,297.329,unknown 5 | cal112.btor2,297.132,unknown 6 | cal117.btor2,297.944,unknown 7 | cal118.btor2,296.225,unknown 8 | cal119.btor2,298.351,unknown 9 | cal122.btor2,297.671,unknown 10 | cal123.btor2,296.943,unknown 11 | cal125.btor2,297.162,unknown 12 | cal129.btor2,298.325,unknown 13 | cal140.btor2,297.323,unknown 14 | cal142.btor2,297.478,unknown 15 | cal143.btor2,299.06600000000003,unknown 16 | cal149.btor2,299.194,unknown 17 | cal156.btor2,297.121,unknown 18 | cal159.btor2,0.001,unsat 19 | cal161.btor2,0.002,unsat 20 | cal162.btor2,0.002,unsat 21 | cal176.btor2,298.663,unknown 22 | cal192.btor2,295.539,unknown 23 | cal2.btor2,298.509,unknown 24 | cal201.btor2,294.819,unknown 25 | cal206.btor2,295.072,unknown 26 | cal209.btor2,296.488,unknown 27 | cal21.btor2,6.415,unsat 28 | cal210.btor2,297.452,unknown 29 | cal220.btor2,0.001, 30 | cal224.btor2,0.003, 31 | cal227.btor2,297.076,unknown 32 | cal234.btor2,296.053,unknown 33 | cal33.btor2,73.549,unsat 34 | cal34.btor2,299.741,unknown 35 | cal35.btor2,11.7,unsat 36 | cal37.btor2,11.163,unsat 37 | cal4.btor2,3.367,unsat 38 | cal41.btor2,7.711,unsat 39 | cal81.btor2,0.002,unsat 40 | cal84.btor2,297.501,unknown 41 | cal86.btor2,297.849,unknown 42 | cal87.btor2,297.998,unknown 43 | cal90.btor2,298.501,unknown 44 | cal97.btor2,296.911,unknown 45 | cal99.btor2,298.071,unknown 46 | gen10.btor2,1.741,unsat 47 | gen12.btor2,1.828,unsat 48 | gen14.btor2,1.865,unsat 49 | gen21.btor2,1.655,unsat 50 | gen31.btor2,31.625,unsat 51 | gen35.btor2,11.918,unsat 52 | gen39.btor2,3.766,unsat 53 | gen43.btor2,299.71500000000003,unknown 54 | gen44.btor2,299.513,unknown 55 | h_RCU.btor2,2.31,unsat 56 | h_TreeArb.btor2,1.5,unsat 57 | miim.btor2,0.515,unsat 58 | mul1.btor2,297.655,unknown 59 | mul2.btor2,295.932,unknown 60 | mul3.btor2,293.324,unknown 61 | mul7.btor2,31.554,sat 62 | mul9.btor2,297.779,unknown 63 | paper_v3.btor2,0.001,unsat 64 | vcegar_QF_BV_ar.btor2,0.001,unsat 65 | vcegar_QF_BV_itc99_b13_p10.btor2,0.001, 66 | vcegar_arrays_itc99_b12_p2.btor2,2.146,unsat 67 | vis_arrays_am2901.btor2,0.998,sat 68 | vis_arrays_am2910_p1.btor2,0.653,unsat 69 | vis_arrays_am2910_p2.btor2,0.291,unsat 70 | vis_arrays_am2910_p3.btor2,1.081,unsat 71 | vis_arrays_buf_bug.btor2,4.608,sat 72 | vis_arrays_bufferAlloc.btor2,4.371,unsat 73 | -------------------------------------------------------------------------------- /include/Target/Btor/btor2parser/btor2mem.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Btor2Tools: A tool package for the BTOR format. 3 | * 4 | * Copyright (C) 2007-2009 Robert Daniel Brummayer. 5 | * Copyright (C) 2007-2012 Armin Biere. 6 | * Copyright (C) 2012-2015 Mathias Preiner. 7 | * Copyright (c) 2018 Aina Niemetz. 8 | * 9 | * All rights reserved. 10 | * 11 | * This file is part of the Btor2Tools package. 12 | * See LICENSE.txt for more information on using this software. 13 | */ 14 | 15 | #ifndef BTOR2MEM_H_INCLUDED 16 | #define BTOR2MEM_H_INCLUDED 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | /*------------------------------------------------------------------------*/ 23 | 24 | #define BTOR2_NEWN(ptr, nelems) \ 25 | ((ptr) = (typeof(ptr)) btorsim_malloc ((nelems) * sizeof *(ptr))) 26 | 27 | #define BTOR2_CNEWN(ptr, nelems) \ 28 | ((ptr) = (typeof(ptr)) btorsim_calloc ((nelems), sizeof *(ptr))) 29 | 30 | #define BTOR2_CLRN(ptr, nelems) (memset ((ptr), 0, (nelems) * sizeof *(ptr))) 31 | 32 | #define BTOR2_REALLOC(p, n) \ 33 | ((p) = (typeof(p)) btorsim_realloc ((p), ((n) * sizeof *(p)))) 34 | 35 | #define BTOR2_NEW(ptr) BTOR2_NEWN ((ptr), 1) 36 | 37 | #define BTOR2_CNEW(ptr) BTOR2_CNEWN ((ptr), 1) 38 | 39 | #define BTOR2_CLR(ptr) BTOR2_CLRN ((ptr), 1) 40 | 41 | #define BTOR2_DELETE(ptr) (free (ptr)) 42 | 43 | static inline void * 44 | btorsim_malloc (size_t size) 45 | { 46 | void *res; 47 | if (!size) return 0; 48 | res = malloc (size); 49 | if (!res) 50 | { 51 | fprintf (stderr, "[btorsim] memory allocation failed\n"); 52 | abort (); 53 | } 54 | return res; 55 | } 56 | 57 | static inline void * 58 | btorsim_calloc (size_t nobj, size_t size) 59 | { 60 | void *res; 61 | res = calloc (nobj, size); 62 | if (!res) 63 | { 64 | fprintf (stderr, "[btorsim] memory allocation failed\n"); 65 | abort (); 66 | } 67 | return res; 68 | } 69 | 70 | static inline void * 71 | btorsim_realloc (void *p, size_t new_size) 72 | { 73 | void *res; 74 | res = realloc (p, new_size); 75 | if (!res) 76 | { 77 | fprintf (stderr, "[btorsim] memory allocation failed\n"); 78 | abort (); 79 | } 80 | return res; 81 | } 82 | 83 | static inline char * 84 | btorsim_strdup (const char *str) 85 | { 86 | char *res = 0; 87 | if (str) 88 | { 89 | BTOR2_NEWN (res, strlen (str) + 1); 90 | strcpy (res, str); 91 | } 92 | return res; 93 | } 94 | 95 | #endif 96 | -------------------------------------------------------------------------------- /include/Dialect/Btor/IR/Btor.h: -------------------------------------------------------------------------------- 1 | //===- BtorOps.h - Btor dialect ops -----------------*- C++ -*-===// 2 | // 3 | // This file is licensed 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 BTOR_IR_BTOR_H 10 | #define BTOR_IR_BTOR_H 11 | 12 | #include "mlir/IR/BuiltinTypes.h" 13 | #include "mlir/IR/Dialect.h" 14 | #include "mlir/IR/OpDefinition.h" 15 | #include "mlir/IR/OpImplementation.h" 16 | #include "mlir/Interfaces/InferTypeOpInterface.h" 17 | #include "mlir/Interfaces/SideEffectInterfaces.h" 18 | 19 | //===----------------------------------------------------------------------===// 20 | // BtorDialect 21 | //===----------------------------------------------------------------------===// 22 | 23 | #include "Dialect/Btor/IR/BtorOpsDialect.h.inc" 24 | 25 | //===----------------------------------------------------------------------===// 26 | // Btor Dialect Enum Attributes 27 | //===----------------------------------------------------------------------===// 28 | 29 | #include "Dialect/Btor/IR/BtorOpsEnums.h.inc" 30 | 31 | //===----------------------------------------------------------------------===// 32 | // Btor Dialect Types 33 | //===----------------------------------------------------------------------===// 34 | 35 | #include "Dialect/Btor/IR/BtorTypes.h" 36 | 37 | //===----------------------------------------------------------------------===// 38 | // Btor Dialect Attributes 39 | //===----------------------------------------------------------------------===// 40 | 41 | #include "Dialect/Btor/IR/BtorAttributes.h" 42 | 43 | //===----------------------------------------------------------------------===// 44 | // Btor Dialect Operations 45 | //===----------------------------------------------------------------------===// 46 | 47 | #define GET_OP_CLASSES 48 | #include "Dialect/Btor/IR/BtorOps.h.inc" 49 | 50 | //===----------------------------------------------------------------------===// 51 | // Btor Dialect Types 52 | //===----------------------------------------------------------------------===// 53 | 54 | #include "Dialect/Btor/IR/BtorTypes.h" 55 | 56 | //===----------------------------------------------------------------------===// 57 | // Btor Dialect Attributes 58 | //===----------------------------------------------------------------------===// 59 | 60 | #include "Dialect/Btor/IR/BtorAttributes.h" 61 | 62 | #endif // BTOR_IR_BTOR_H 63 | -------------------------------------------------------------------------------- /lib/Dialect/Btor/IR/BtorAttributes.cpp: -------------------------------------------------------------------------------- 1 | //===- BtorTypes.cpp - Btor dialect ---------------*- C++ -*-===// 2 | // 3 | // This file is licensed 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 | #include "Dialect/Btor/IR/Btor.h" 10 | #include "mlir/IR/Builders.h" 11 | #include "mlir/IR/DialectImplementation.h" 12 | #include "Dialect/Btor/IR/BtorTypes.h" 13 | #include "llvm/ADT/TypeSwitch.h" 14 | #include "Dialect/Btor/IR/BtorAttributes.h" 15 | 16 | using namespace mlir; 17 | using namespace mlir::btor; 18 | 19 | void BitVecAttr::print(::mlir::AsmPrinter &printer) const { 20 | printer << "<"; 21 | printer << this->getType(); 22 | printer << ' ' << "="; 23 | printer << ' '; 24 | printer.printStrippedAttrOrType(this->getValue()); 25 | printer << ">"; 26 | } 27 | 28 | ::mlir::Attribute BitVecAttr::parse(::mlir::AsmParser &parser, 29 | ::mlir::Type type) { 30 | ::mlir::FailureOr _result_type; 31 | ::mlir::FailureOr _result_value; 32 | ::llvm::SMLoc loc = parser.getCurrentLocation(); 33 | (void)loc; 34 | // Parse literal '<' 35 | if (parser.parseLess()) 36 | return {}; 37 | 38 | // Parse variable 'type' 39 | _result_type = ::mlir::FieldParser::parse(parser); 40 | if (failed(_result_type)) { 41 | parser.emitError(parser.getCurrentLocation(), 42 | "failed to parse BitVecAttribute parameter 'type' which " 43 | "is to be a `BitVecType`"); 44 | return {}; 45 | } 46 | // Parse literal '=' 47 | if (parser.parseEqual()) 48 | return {}; 49 | 50 | // Parse variable 'value' 51 | _result_value = ::mlir::FieldParser::parse(parser); 52 | if (failed(_result_value)) { 53 | parser.emitError(parser.getCurrentLocation(), 54 | "failed to parse BitVecAttribute parameter 'value' which " 55 | "is to be a `APInt`"); 56 | return {}; 57 | } 58 | // Parse literal '>' 59 | if (parser.parseGreater()) 60 | return {}; 61 | return BitVecAttr::get( 62 | parser.getContext(), _result_type.getValue(), 63 | APInt(_result_type.getValue().getWidth(), _result_value.getValue())); 64 | } 65 | 66 | #define GET_ATTRDEF_CLASSES 67 | #include "Dialect/Btor/IR/BtorAttributes.cpp.inc" 68 | 69 | void BtorDialect::registerAttrs() { 70 | addAttributes< 71 | #define GET_ATTRDEF_LIST 72 | #include "Dialect/Btor/IR/BtorAttributes.cpp.inc" 73 | >(); 74 | } -------------------------------------------------------------------------------- /include/Conversion/Passes.td: -------------------------------------------------------------------------------- 1 | #ifndef BTOR_CONVERSION_PASSES 2 | #define BTOR_CONVERSION_PASSES 3 | 4 | include "mlir/Pass/PassBase.td" 5 | 6 | //===----------------------------------------------------------------------===// 7 | // BtorToArithmetic 8 | //===----------------------------------------------------------------------===// 9 | 10 | def ConvertBtorToArithmetic : Pass<"convert-btor-to-arith", "ModuleOp"> { 11 | let summary = "Convert Btor Dialect to Arithmetic dialect"; 12 | let description = [{ 13 | Convert btor operations into the Arithmetic dialect operations. 14 | 15 | If other operations are present and their results are required by the Arithmetic 16 | dialect operations, the pass will fail. Any Arithmetic operations or types 17 | already present in the IR will be kept as is. 18 | }]; 19 | let constructor = "btor::createConvertBtorToArithmeticPass()"; 20 | let dependentDialects = ["arith::ArithmeticDialect"]; 21 | } 22 | 23 | //===----------------------------------------------------------------------===// 24 | // BtorToLLVM 25 | //===----------------------------------------------------------------------===// 26 | 27 | def ConvertBtorToLLVM : Pass<"convert-btor-to-llvm", "ModuleOp"> { 28 | let summary = "Convert Btor Dialect to LLVM dialect"; 29 | let description = [{ 30 | Convert btor operations into LLVM instructions 31 | }]; 32 | let constructor = "mlir::btor::createLowerToLLVMPass()"; 33 | let dependentDialects = ["LLVM::LLVMDialect"]; 34 | } 35 | 36 | //===----------------------------------------------------------------------===// 37 | // BtorNDToLLVM 38 | //===----------------------------------------------------------------------===// 39 | 40 | def ConvertBtorNDToLLVM : Pass<"convert-btornd-to-llvm", "ModuleOp"> { 41 | let summary = "Convert Btor Dialect nd Operations to LLVM dialect"; 42 | let description = [{ 43 | Convert nd btor operations into LLVM instructions 44 | }]; 45 | let constructor = "mlir::btor::createLowerBtorNDToLLVMPass()"; 46 | let dependentDialects = ["LLVM::LLVMDialect"]; 47 | } 48 | 49 | //===----------------------------------------------------------------------===// 50 | // BtorToVector 51 | //===----------------------------------------------------------------------===// 52 | 53 | def ConvertBtorToVector : Pass<"convert-btor-to-vector", "ModuleOp"> { 54 | let summary = "Convert Btor Dialect to Vector dialect"; 55 | let description = [{ 56 | Convert btor array operations into vector instructions 57 | }]; 58 | let constructor = "mlir::btor::createLowerToVectorPass()"; 59 | let dependentDialects = ["vector::VectorDialect"]; 60 | } 61 | 62 | #endif // BTOR_CONVERSION_PASSES 63 | -------------------------------------------------------------------------------- /results/25-btormc/25-btormc_19_mann_0202231730.csv: -------------------------------------------------------------------------------- 1 | index,btor_time,status 2 | arbitrated_top_n2_w128_d32_e0.btor2,298.92, 3 | arbitrated_top_n2_w128_d64_e0.btor2,298.212, 4 | arbitrated_top_n2_w64_d64_e0.btor2,299.081, 5 | arbitrated_top_n2_w8_d128_e0.btor2,298.866, 6 | arbitrated_top_n2_w8_d16_e0.btor2,22.859,sat 7 | arbitrated_top_n2_w8_d32_e0.btor2,298.04200000000003, 8 | arbitrated_top_n2_w8_d64_e0.btor2,299.156, 9 | arbitrated_top_n3_w16_d128_e0.btor2,299.052, 10 | arbitrated_top_n3_w16_d32_e0.btor2,298.877, 11 | arbitrated_top_n3_w32_d16_e0.btor2,25.991,sat 12 | arbitrated_top_n3_w64_d128_e0.btor2,298.217, 13 | arbitrated_top_n3_w64_d64_e0.btor2,298.345, 14 | arbitrated_top_n3_w8_d128_e0.btor2,298.856, 15 | arbitrated_top_n3_w8_d16_e0.btor2,37.36,sat 16 | arbitrated_top_n4_w128_d16_e0.btor2,63.342,sat 17 | arbitrated_top_n4_w128_d64_e0.btor2,298.767, 18 | arbitrated_top_n4_w16_d16_e0.btor2,26.591,sat 19 | arbitrated_top_n4_w16_d32_e0.btor2,298.739, 20 | arbitrated_top_n4_w16_d64_e0.btor2,299.113, 21 | arbitrated_top_n4_w32_d32_e0.btor2,299.416, 22 | arbitrated_top_n4_w64_d32_e0.btor2,298.358, 23 | arbitrated_top_n4_w8_d64_e0.btor2,299.137, 24 | arbitrated_top_n5_w128_d64_e0.btor2,298.287, 25 | arbitrated_top_n5_w128_d8_e0.btor2,3.88,sat 26 | arbitrated_top_n5_w32_d32_e0.btor2,298.902, 27 | arbitrated_top_n5_w64_d16_e0.btor2,86.402,sat 28 | arbitrated_top_n5_w8_d32_e0.btor2,299.384, 29 | buggy_ridecore.btor,94.31,sat 30 | circular_pointer_top_w128_d128_e0.btor2,298.18399999999997, 31 | circular_pointer_top_w128_d64_e0.btor2,298.661, 32 | circular_pointer_top_w128_d8_e0.btor2,29.057,sat 33 | circular_pointer_top_w16_d128_e0.btor2,299.367, 34 | circular_pointer_top_w16_d32_e0.btor2,299.429, 35 | circular_pointer_top_w16_d64_e0.btor2,299.6, 36 | circular_pointer_top_w32_d16_e0.btor2,99.07,sat 37 | circular_pointer_top_w32_d32_e0.btor2,298.637, 38 | circular_pointer_top_w64_d128_e0.btor2,299.383, 39 | circular_pointer_top_w64_d8_e0.btor2,8.713,sat 40 | circular_pointer_top_w8_d16_e0.btor2,81.839,sat 41 | intersymbol_analog_estimation_convergence.btor,50.724,unsat 42 | ridecore.btor,298.399, 43 | shift_register_top_w128_d16_e0.btor2,299.16700000000003, 44 | shift_register_top_w128_d64_e0.btor2,299.177, 45 | shift_register_top_w16_d128_e0.btor2,299.356, 46 | shift_register_top_w16_d16_e0.btor2,299.112, 47 | shift_register_top_w16_d32_e0.btor2,298.134, 48 | shift_register_top_w16_d64_e0.btor2,299.157, 49 | shift_register_top_w16_d8_e0.btor2,8.577,sat 50 | shift_register_top_w32_d128_e0.btor2,298.967, 51 | shift_register_top_w32_d16_e0.btor2,299.411, 52 | shift_register_top_w32_d8_e0.btor2,19.714,sat 53 | shift_register_top_w64_d8_e0.btor2,68.786,sat 54 | shift_register_top_w8_d128_e0.btor2,298.987, 55 | -------------------------------------------------------------------------------- /results/seahorn/seahorn_19_goel_0321231939.csv: -------------------------------------------------------------------------------- 1 | base,Cpu,Mem,BMC,seahorn_total,Result 2 | paper_v3.btor2,0.86,351,0.02,0.05,TRUE 3 | miim.btor2,8.87,418,0.21,0.64,TRUE 4 | cal162.btor2,24.50,358,0.03,0.59,TRUE 5 | cal81.btor2,29.54,357,0.03,0.73,TRUE 6 | h_TreeArb.btor2,30.01,570,1.79,2.75,TRUE 7 | vcegar_QF_BV_ar.btor2,0.79,351,0.03,0.04,TRUE 8 | gen10.btor2,8.20,749,0.52,0.81,TRUE 9 | gen12.btor2,9.97,759,0.44,0.96,TRUE 10 | vcegar_QF_BV_itc99_b13_p10.btor2,0.66,297,,0.01, 11 | cal21.btor2,69.54,540,53.74,54.61,TRUE 12 | cal41.btor2,87.78,608,59.06,60.72,TRUE 13 | gen14.btor2,9.93,759,0.51,1.00,TRUE 14 | vcegar_arrays_itc99_b12_p2.btor2,53.66,861,1.92,3.85,TRUE 15 | mul1.btor2,1.29,314,,, 16 | mul2.btor2,1.32,315,,, 17 | cal2.btor2,9.81,325,,, 18 | mul3.btor2,1.31,314,,, 19 | mul7.btor2,1.62,316,,, 20 | mul9.btor2,2.36,315,,, 21 | cal84.btor2,138.76,576,,, 22 | cal87.btor2,150.10,586,,, 23 | cal102.btor2,148.74,597,,, 24 | cal107.btor2,149.27,592,,, 25 | cal106.btor2,149.27,593,,, 26 | cal86.btor2,154.86,589,,, 27 | cal112.btor2,153.07,595,,, 28 | cal90.btor2,148.45,589,,, 29 | cal119.btor2,146.46,596,,, 30 | cal118.btor2,145.82,591,,, 31 | cal122.btor2,146.40,599,,, 32 | cal117.btor2,143.22,594,,, 33 | cal99.btor2,144.84,590,,, 34 | cal97.btor2,151.53,590,,, 35 | cal192.btor2,240.82,790,,, 36 | cal201.btor2,232.02,784,,, 37 | cal176.btor2,232.63,598,,, 38 | cal209.btor2,231.48,781,,, 39 | cal206.btor2,234.00,778,,, 40 | cal123.btor2,142.39,584,,, 41 | vis_arrays_am2910_p2.btor2,3.78,404,0.09,0.22,TRUE 42 | gen21.btor2,6.63,748,0.38,0.63,TRUE 43 | cal210.btor2,236.42,783,,, 44 | gen39.btor2,10.39,759,1.29,1.80,TRUE 45 | vis_arrays_am2910_p3.btor2,19.53,496,0.72,1.67,TRUE 46 | vis_arrays_am2910_p1.btor2,19.65,496,0.78,1.73,TRUE 47 | cal159.btor2,21.61,358,0.04,0.60,TRUE 48 | cal161.btor2,23.33,358,0.03,0.59,TRUE 49 | cal125.btor2,146.63,589,,, 50 | gen35.btor2,30.41,820,24.28,24.52,TRUE 51 | cal220.btor2,83.44,509,,, 52 | vis_arrays_buf_bug.btor2,32.73,460,23.43,23.82,FALSE 53 | vis_arrays_bufferAlloc.btor2,33.81,457,25.01,25.34,TRUE 54 | cal129.btor2,149.64,589,,, 55 | h_RCU.btor2,48.00,972,1.76,4.17,TRUE 56 | cal224.btor2,106.73,561,,, 57 | cal4.btor2,136.37,634,112.74,114.25,TRUE 58 | cal140.btor2,151.65,589,,, 59 | cal35.btor2,261.40,876,220.98,222.55,TRUE 60 | vis_arrays_am2901.btor2,20.36,343,,, 61 | gen31.btor2,21.11,372,,, 62 | gen43.btor2,4.93,317,,, 63 | cal142.btor2,98.34,594,,, 64 | cal34.btor2,33.13,373,,, 65 | cal33.btor2,17.68,349,,, 66 | cal37.btor2,39.20,422,,, 67 | gen44.btor2,4.57,319,,, 68 | cal143.btor2,101.28,587,,, 69 | cal149.btor2,104.05,590,,, 70 | cal227.btor2,196.06,786,,, 71 | cal156.btor2,151.67,789,,, 72 | cal234.btor2,212.11,841,,, 73 | -------------------------------------------------------------------------------- /results/boolector/boolector_19_mann_0330231142.csv: -------------------------------------------------------------------------------- 1 | index,btor_time,status 2 | arbitrated_top_n2_w128_d32_e0.btor2,60.969,unsat 3 | arbitrated_top_n2_w128_d64_e0.btor2,74.879,unsat 4 | arbitrated_top_n2_w64_d64_e0.btor2,58.611,unsat 5 | arbitrated_top_n2_w8_d128_e0.btor2,50.596,unsat 6 | arbitrated_top_n2_w8_d16_e0.btor2,4.88,sat 7 | arbitrated_top_n2_w8_d32_e0.btor2,30.669,unsat 8 | arbitrated_top_n2_w8_d64_e0.btor2,40.964,unsat 9 | arbitrated_top_n3_w16_d128_e0.btor2,76.05199999999999,unsat 10 | arbitrated_top_n3_w16_d32_e0.btor2,47.012,unsat 11 | arbitrated_top_n3_w32_d16_e0.btor2,20.804,sat 12 | arbitrated_top_n3_w64_d128_e0.btor2,80.702,unsat 13 | arbitrated_top_n3_w64_d64_e0.btor2,59.132,unsat 14 | arbitrated_top_n3_w8_d128_e0.btor2,56.474,unsat 15 | arbitrated_top_n3_w8_d16_e0.btor2,7.13,sat 16 | arbitrated_top_n4_w128_d16_e0.btor2,23.559,sat 17 | arbitrated_top_n4_w128_d64_e0.btor2,124.379,unsat 18 | arbitrated_top_n4_w16_d16_e0.btor2,18.532,sat 19 | arbitrated_top_n4_w16_d32_e0.btor2,55.083,unsat 20 | arbitrated_top_n4_w16_d64_e0.btor2,80.67699999999999,unsat 21 | arbitrated_top_n4_w32_d32_e0.btor2,58.257,unsat 22 | arbitrated_top_n4_w64_d32_e0.btor2,63.79,unsat 23 | arbitrated_top_n4_w8_d64_e0.btor2,73.598,unsat 24 | arbitrated_top_n5_w128_d64_e0.btor2,124.818,unsat 25 | arbitrated_top_n5_w128_d8_e0.btor2,18.401,sat 26 | arbitrated_top_n5_w32_d32_e0.btor2,60.078,unsat 27 | arbitrated_top_n5_w64_d16_e0.btor2,30.691,sat 28 | arbitrated_top_n5_w8_d32_e0.btor2,62.997,unsat 29 | buggy_ridecore.btor,0.001, 30 | circular_pointer_top_w128_d128_e0.btor2,296.745,unknown 31 | circular_pointer_top_w128_d64_e0.btor2,298.484,unknown 32 | circular_pointer_top_w128_d8_e0.btor2,36.511,sat 33 | circular_pointer_top_w16_d128_e0.btor2,78.497,unsat 34 | circular_pointer_top_w16_d32_e0.btor2,54.345,unsat 35 | circular_pointer_top_w16_d64_e0.btor2,83.936,unsat 36 | circular_pointer_top_w32_d16_e0.btor2,113.07300000000001,sat 37 | circular_pointer_top_w32_d32_e0.btor2,128.153,unsat 38 | circular_pointer_top_w64_d128_e0.btor2,297.044,unsat 39 | circular_pointer_top_w64_d8_e0.btor2,13.912,sat 40 | circular_pointer_top_w8_d16_e0.btor2,25.096,sat 41 | intersymbol_analog_estimation_convergence.btor,20.494,unsat 42 | ridecore.btor,0.003, 43 | shift_register_top_w128_d16_e0.btor2,299.37,unknown 44 | shift_register_top_w128_d64_e0.btor2,299.265,unknown 45 | shift_register_top_w16_d128_e0.btor2,94.678,unsat 46 | shift_register_top_w16_d16_e0.btor2,85.602,unsat 47 | shift_register_top_w16_d32_e0.btor2,108.17099999999999,unsat 48 | shift_register_top_w16_d64_e0.btor2,94.286,unsat 49 | shift_register_top_w16_d8_e0.btor2,7.857,sat 50 | shift_register_top_w32_d128_e0.btor2,179.549,unsat 51 | shift_register_top_w32_d16_e0.btor2,193.158,unsat 52 | shift_register_top_w32_d8_e0.btor2,12.618,sat 53 | shift_register_top_w64_d8_e0.btor2,7.043,sat 54 | shift_register_top_w8_d128_e0.btor2,37.133,unsat 55 | -------------------------------------------------------------------------------- /results/vcGen/vcGen_19_goel_0321231820.csv: -------------------------------------------------------------------------------- 1 | base,Cpu,Mem,BMC,seahorn_total,Result 2 | paper_v3.btor2,0.85,355,0.01,0.02, 3 | mul1.btor2,1.51,360,0.06,0.12, 4 | mul2.btor2,1.53,360,0.06,0.12, 5 | mul3.btor2,1.59,359,0.06,0.13, 6 | mul7.btor2,1.78,359,0.05,0.12, 7 | vcegar_QF_BV_ar.btor2,0.80,354,0.01,0.02, 8 | mul9.btor2,2.72,364,0.08,0.17, 9 | miim.btor2,9.47,383,0.39,0.80, 10 | gen10.btor2,8.20,379,0.31,0.61, 11 | vcegar_QF_BV_itc99_b13_p10.btor2,0.68,297,,0.01, 12 | cal2.btor2,11.12,382,0.33,0.78, 13 | gen12.btor2,10.46,395,0.52,1.04, 14 | cal21.btor2,17.83,507,0.93,1.83, 15 | gen14.btor2,10.56,395,0.53,1.04, 16 | cal162.btor2,26.63,358,0.03,0.58, 17 | h_TreeArb.btor2,29.58,472,0.69,1.65, 18 | cal41.btor2,31.60,647,1.71,3.32, 19 | cal81.btor2,31.71,359,0.02,0.69, 20 | gen21.btor2,6.98,376,0.24,0.49, 21 | gen31.btor2,28.42,661,2.66,4.58, 22 | vcegar_arrays_itc99_b12_p2.btor2,55.85,654,1.70,3.64, 23 | vis_arrays_am2910_p1.btor2,22.24,508,1.12,2.04, 24 | cal33.btor2,22.81,511,1.06,2.17, 25 | gen35.btor2,6.52,375,0.24,0.46, 26 | vis_arrays_am2910_p2.btor2,3.87,365,0.11,0.24, 27 | cal84.btor2,162.61,1828,8.60,15.71, 28 | cal119.btor2,171.51,1851,9.26,16.78, 29 | cal122.btor2,171.67,1853,9.25,16.77, 30 | cal118.btor2,171.74,1838,9.14,16.81, 31 | cal87.btor2,173.27,1857,9.48,17.05, 32 | cal123.btor2,172.15,1842,9.33,17.00, 33 | cal117.btor2,173.62,1839,9.01,16.30, 34 | cal99.btor2,174.28,1839,9.34,17.04, 35 | cal125.btor2,173.43,1854,9.37,16.77, 36 | cal107.btor2,177.46,1858,9.67,17.47, 37 | cal106.btor2,177.77,1858,9.59,17.11, 38 | cal102.btor2,178.18,1860,9.65,17.22, 39 | cal90.btor2,177.87,1862,9.73,17.53, 40 | cal97.btor2,178.79,1849,9.71,17.58, 41 | cal112.btor2,179.41,1861,9.64,17.30, 42 | gen43.btor2,5.42,373,0.23,0.43, 43 | gen39.btor2,10.23,395,0.51,1.02, 44 | gen44.btor2,5.34,372,0.21,0.42, 45 | vis_arrays_buf_bug.btor2,10.10,387,0.41,0.77, 46 | cal129.btor2,174.09,1854,9.17,16.68, 47 | cal86.btor2,184.27,1865,9.59,17.55, 48 | vis_arrays_bufferAlloc.btor2,9.58,386,0.40,0.74, 49 | vis_arrays_am2910_p3.btor2,17.84,510,0.66,1.20, 50 | cal140.btor2,176.82,1835,9.01,14.89, 51 | cal159.btor2,23.25,358,0.02,0.55, 52 | cal34.btor2,39.56,648,1.06,2.08, 53 | cal4.btor2,24.65,646,1.56,3.06, 54 | cal161.btor2,26.91,359,0.03,0.57, 55 | cal142.btor2,177.37,1837,8.41,15.85, 56 | cal35.btor2,38.59,985,1.77,3.32, 57 | cal37.btor2,43.54,986,1.87,3.58, 58 | h_RCU.btor2,44.70,788,1.74,3.26, 59 | cal143.btor2,159.35,1840,5.46,9.78, 60 | cal176.btor2,233.01,1818,5.05,9.09, 61 | cal209.btor2,239.24,3154,8.58,14.94, 62 | cal206.btor2,239.26,3154,8.52,14.90, 63 | cal192.btor2,240.29,3162,8.73,15.25, 64 | cal201.btor2,244.71,3151,8.35,14.59, 65 | cal210.btor2,242.84,3155,8.42,14.66, 66 | cal149.btor2,133.48,1838,5.27,9.35, 67 | vis_arrays_am2901.btor2,265.23,6944,242.72,243.89, 68 | cal220.btor2,292.31,829,,, 69 | cal227.btor2,282.84,1972,12.07,17.89, 70 | cal224.btor2,133.63,562,,, 71 | cal234.btor2,299.59,3324,11.43,17.93, 72 | cal156.btor2,161.01,3161,7.51,13.24, 73 | -------------------------------------------------------------------------------- /test/Btor/wolf-19C.btor.mlir.opt.ll: -------------------------------------------------------------------------------- 1 | ; ModuleID = 'LLVMDialectModule' 2 | source_filename = "LLVMDialectModule" 3 | 4 | declare i8* @malloc(i64) 5 | 6 | declare void @free(i8*) 7 | 8 | declare void @__VERIFIER_error() 9 | 10 | declare i64 @nd_bv64_st3() 11 | 12 | declare void @btor2mlir_print_state_num(i64, i64, i64) 13 | 14 | declare i64 @nd_bv64_st2() 15 | 16 | define void @main() !dbg !3 { 17 | %1 = call i64 @nd_bv64_st2(), !dbg !7 18 | %2 = trunc i64 %1 to i33, !dbg !9 19 | %3 = call i64 @nd_bv64_st3(), !dbg !10 20 | %4 = trunc i64 %3 to i33, !dbg !11 21 | br label %5, !dbg !12 22 | 23 | 5: ; preds = %19, %0 24 | %6 = phi i1 [ %16, %19 ], [ false, %0 ] 25 | %7 = phi i1 [ true, %19 ], [ false, %0 ] 26 | %8 = phi i33 [ 50, %19 ], [ %2, %0 ] 27 | %9 = phi i33 [ 50, %19 ], [ %4, %0 ] 28 | %10 = xor i33 %8, %9, !dbg !13 29 | %11 = xor i33 %10, -1, !dbg !14 30 | %12 = lshr i33 %11, 2, !dbg !15 31 | %13 = trunc i33 %12 to i1, !dbg !16 32 | %14 = xor i1 %13, true, !dbg !17 33 | %15 = and i1 %7, %14, !dbg !18 34 | %16 = and i1 %15, true, !dbg !19 35 | %17 = and i1 %6, true, !dbg !20 36 | %18 = xor i1 %17, true, !dbg !21 37 | br i1 %18, label %19, label %20, !dbg !22 38 | 39 | 19: ; preds = %5 40 | br label %5, !dbg !23 41 | 42 | 20: ; preds = %5 43 | call void @__VERIFIER_error(), !dbg !24 44 | unreachable, !dbg !25 45 | } 46 | 47 | !llvm.dbg.cu = !{!0} 48 | !llvm.module.flags = !{!2} 49 | 50 | !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "mlir", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug) 51 | !1 = !DIFile(filename: "LLVMDialectModule", directory: "/") 52 | !2 = !{i32 2, !"Debug Info Version", i32 3} 53 | !3 = distinct !DISubprogram(name: "main", linkageName: "main", scope: null, file: !4, line: 6, type: !5, scopeLine: 6, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !6) 54 | !4 = !DIFile(filename: "btor2mlir-1/test/Btor/wolf-19C.btor.mlir.opt", directory: "/home/jetafese") 55 | !5 = !DISubroutineType(types: !6) 56 | !6 = !{} 57 | !7 = !DILocation(line: 8, column: 10, scope: !8) 58 | !8 = !DILexicalBlockFile(scope: !3, file: !4, discriminator: 0) 59 | !9 = !DILocation(line: 9, column: 10, scope: !8) 60 | !10 = !DILocation(line: 10, column: 10, scope: !8) 61 | !11 = !DILocation(line: 11, column: 10, scope: !8) 62 | !12 = !DILocation(line: 12, column: 5, scope: !8) 63 | !13 = !DILocation(line: 15, column: 11, scope: !8) 64 | !14 = !DILocation(line: 17, column: 11, scope: !8) 65 | !15 = !DILocation(line: 19, column: 11, scope: !8) 66 | !16 = !DILocation(line: 20, column: 11, scope: !8) 67 | !17 = !DILocation(line: 22, column: 11, scope: !8) 68 | !18 = !DILocation(line: 23, column: 11, scope: !8) 69 | !19 = !DILocation(line: 24, column: 11, scope: !8) 70 | !20 = !DILocation(line: 26, column: 11, scope: !8) 71 | !21 = !DILocation(line: 28, column: 11, scope: !8) 72 | !22 = !DILocation(line: 29, column: 5, scope: !8) 73 | !23 = !DILocation(line: 31, column: 5, scope: !8) 74 | !24 = !DILocation(line: 33, column: 5, scope: !8) 75 | !25 = !DILocation(line: 34, column: 5, scope: !8) 76 | -------------------------------------------------------------------------------- /results/vcGen/vcGen_19_mann_0321231826.csv: -------------------------------------------------------------------------------- 1 | base,Cpu,Mem,BMC,seahorn_total,Result 2 | circular_pointer_top_w128_d8_e0.btor2,5.90,375,0.28,0.54, 3 | shift_register_top_w16_d8_e0.btor2,6.16,375,0.27,0.52, 4 | circular_pointer_top_w32_d16_e0.btor2,7.69,382,0.39,0.73, 5 | shift_register_top_w32_d16_e0.btor2,9.06,380,0.37,0.67, 6 | shift_register_top_w16_d16_e0.btor2,9.08,379,0.36,0.67, 7 | circular_pointer_top_w16_d32_e0.btor2,11.30,395,0.63,1.17, 8 | shift_register_top_w16_d32_e0.btor2,11.44,381,0.39,0.71, 9 | shift_register_top_w128_d64_e0.btor2,14.61,382,0.37,0.70, 10 | shift_register_top_w16_d64_e0.btor2,14.69,380,0.38,0.72, 11 | arbitrated_top_n2_w8_d16_e0.btor2,15.45,469,0.80,1.52, 12 | shift_register_top_w32_d8_e0.btor2,6.20,375,0.28,0.54, 13 | circular_pointer_top_w16_d64_e0.btor2,18.19,503,1.10,1.99, 14 | circular_pointer_top_w128_d64_e0.btor2,18.40,504,1.11,2.00, 15 | circular_pointer_top_w32_d32_e0.btor2,11.24,395,0.63,1.14, 16 | shift_register_top_w64_d8_e0.btor2,6.19,376,0.27,0.51, 17 | shift_register_top_w16_d128_e0.btor2,21.24,380,0.37,0.72, 18 | shift_register_top_w32_d128_e0.btor2,21.17,380,0.39,0.73, 19 | circular_pointer_top_w64_d8_e0.btor2,5.86,375,0.28,0.54, 20 | arbitrated_top_n3_w8_d16_e0.btor2,22.02,509,1.28,2.30, 21 | arbitrated_top_n2_w8_d32_e0.btor2,22.50,512,1.26,2.32, 22 | intersymbol_analog_estimation_convergence.btor,5.43,379,0.27,0.54, 23 | circular_pointer_top_w8_d16_e0.btor2,7.69,381,0.39,0.72, 24 | shift_register_top_w128_d16_e0.btor2,9.08,379,0.36,0.67, 25 | arbitrated_top_n4_w16_d16_e0.btor2,31.15,644,2.22,3.75, 26 | circular_pointer_top_w16_d128_e0.btor2,31.97,645,1.89,3.33, 27 | circular_pointer_top_w128_d128_e0.btor2,32.86,644,2.46,4.10, 28 | arbitrated_top_n3_w32_d16_e0.btor2,26.72,640,1.92,3.36, 29 | shift_register_top_w8_d128_e0.btor2,18.65,380,0.36,0.70, 30 | arbitrated_top_n2_w8_d64_e0.btor2,37.91,650,2.70,4.55, 31 | arbitrated_top_n2_w128_d32_e0.btor2,39.73,742,2.56,4.96, 32 | arbitrated_top_n3_w16_d32_e0.btor2,35.14,647,2.53,4.24, 33 | arbitrated_top_n2_w64_d64_e0.btor2,41.77,740,2.01,3.37, 34 | arbitrated_top_n4_w16_d32_e0.btor2,41.83,666,1.99,3.24, 35 | circular_pointer_top_w64_d128_e0.btor2,30.48,645,1.78,3.34, 36 | arbitrated_top_n5_w8_d32_e0.btor2,46.12,747,2.21,3.66, 37 | arbitrated_top_n2_w128_d64_e0.btor2,46.10,996,2.55,4.39, 38 | arbitrated_top_n4_w32_d32_e0.btor2,47.17,979,2.48,3.95, 39 | arbitrated_top_n4_w64_d32_e0.btor2,49.89,994,3.01,5.70, 40 | arbitrated_top_n4_w128_d16_e0.btor2,53.00,1017,3.82,6.26, 41 | arbitrated_top_n2_w8_d128_e0.btor2,57.25,996,2.96,4.76, 42 | arbitrated_top_n4_w16_d64_e0.btor2,61.78,1008,3.33,5.37, 43 | arbitrated_top_n5_w64_d16_e0.btor2,40.78,991,2.86,4.59, 44 | arbitrated_top_n4_w8_d64_e0.btor2,56.48,1004,3.18,5.17, 45 | arbitrated_top_n5_w32_d32_e0.btor2,47.29,995,2.84,4.57, 46 | arbitrated_top_n5_w128_d8_e0.btor2,51.89,1492,4.35,6.89, 47 | arbitrated_top_n3_w64_d64_e0.btor2,50.12,1003,3.20,5.17, 48 | arbitrated_top_n3_w16_d128_e0.btor2,75.43,1098,4.43,7.09, 49 | arbitrated_top_n4_w128_d64_e0.btor2,81.58,1711,5.75,9.22, 50 | arbitrated_top_n3_w8_d128_e0.btor2,63.09,1085,4.23,6.83, 51 | arbitrated_top_n3_w64_d128_e0.btor2,74.47,1703,5.03,8.00, 52 | arbitrated_top_n5_w128_d64_e0.btor2,89.58,1757,6.78,10.81, 53 | ridecore.btor,66.40,402,,, 54 | buggy_ridecore.btor,62.08,399,,, 55 | -------------------------------------------------------------------------------- /results/seahorn/seahorn_19_mann_0321231949.csv: -------------------------------------------------------------------------------- 1 | base,Cpu,Mem,BMC,seahorn_total,Result 2 | shift_register_top_w16_d8_e0.btor2,26.35,497,20.79,21.03,FALSE 3 | arbitrated_top_n3_w8_d16_e0.btor2,36.77,722,17.47,18.42,FALSE 4 | circular_pointer_top_w128_d8_e0.btor2,42.22,954,36.86,37.13,FALSE 5 | arbitrated_top_n2_w8_d16_e0.btor2,51.31,525,37.36,38.06,FALSE 6 | arbitrated_top_n4_w16_d16_e0.btor2,76.94,1096,49.84,51.31,FALSE 7 | arbitrated_top_n2_w8_d32_e0.btor2,81.46,740,61.30,62.43,TRUE 8 | arbitrated_top_n3_w32_d16_e0.btor2,28.32,1410,4.31,5.70,FALSE 9 | arbitrated_top_n5_w8_d32_e0.btor2,128.64,1267,81.67,84.01,TRUE 10 | arbitrated_top_n2_w8_d64_e0.btor2,131.60,1123,98.40,100.28,TRUE 11 | arbitrated_top_n4_w16_d32_e0.btor2,132.49,1817,93.15,95.31,TRUE 12 | shift_register_top_w32_d8_e0.btor2,87.90,569,81.98,82.21,FALSE 13 | arbitrated_top_n2_w64_d64_e0.btor2,141.99,7018,102.41,104.93,TRUE 14 | circular_pointer_top_w16_d32_e0.btor2,155.96,672,145.92,146.47,TRUE 15 | arbitrated_top_n4_w32_d32_e0.btor2,156.09,3860,111.55,114.29,TRUE 16 | arbitrated_top_n2_w8_d128_e0.btor2,158.32,1937,99.02,102.31,TRUE 17 | arbitrated_top_n3_w16_d32_e0.btor2,132.75,1429,102.12,103.80,TRUE 18 | arbitrated_top_n4_w16_d64_e0.btor2,177.41,3946,113.00,116.63,TRUE 19 | circular_pointer_top_w32_d16_e0.btor2,188.10,680,181.16,181.52,FALSE 20 | circular_pointer_top_w64_d8_e0.btor2,54.47,697,48.87,49.13,FALSE 21 | arbitrated_top_n4_w8_d64_e0.btor2,156.67,1951,94.71,98.16,TRUE 22 | intersymbol_analog_estimation_convergence.btor,11.83,721,6.73,6.99,TRUE 23 | arbitrated_top_n5_w128_d8_e0.btor2,77.16,4106,16.40,20.89,FALSE 24 | arbitrated_top_n3_w16_d128_e0.btor2,211.22,4364,124.55,129.42,TRUE 25 | circular_pointer_top_w16_d64_e0.btor2,217.04,858,200.78,201.67,TRUE 26 | arbitrated_top_n2_w128_d32_e0.btor2,215.86,7014,179.71,182.29,TRUE 27 | circular_pointer_top_w8_d16_e0.btor2,60.93,499,53.89,54.23,FALSE 28 | circular_pointer_top_w16_d128_e0.btor2,223.17,1386,194.90,196.49,TRUE 29 | arbitrated_top_n5_w64_d16_e0.btor2,61.65,4013,15.69,18.70,FALSE 30 | shift_register_top_w16_d64_e0.btor2,247.71,597,234.83,235.16,TRUE 31 | arbitrated_top_n4_w64_d32_e0.btor2,249.05,7059,198.21,201.48,TRUE 32 | shift_register_top_w16_d32_e0.btor2,251.60,580,241.35,241.67,TRUE 33 | shift_register_top_w64_d8_e0.btor2,149.96,682,144.33,144.57,FALSE 34 | shift_register_top_w16_d16_e0.btor2,284.29,576,276.12,276.41,TRUE 35 | arbitrated_top_n4_w128_d16_e0.btor2,291.47,7119,235.96,240.04,FALSE 36 | shift_register_top_w128_d64_e0.btor2,12.70,335,,, 37 | circular_pointer_top_w128_d64_e0.btor2,15.19,339,,, 38 | circular_pointer_top_w128_d128_e0.btor2,26.82,369,,, 39 | arbitrated_top_n2_w128_d64_e0.btor2,45.27,422,,, 40 | shift_register_top_w16_d128_e0.btor2,18.01,347,,, 41 | shift_register_top_w32_d16_e0.btor2,7.94,318,,, 42 | shift_register_top_w32_d128_e0.btor2,17.85,346,,, 43 | arbitrated_top_n4_w128_d64_e0.btor2,88.00,543,,, 44 | shift_register_top_w8_d128_e0.btor2,163.08,558,144.88,145.23,TRUE 45 | arbitrated_top_n5_w32_d32_e0.btor2,152.12,4029,97.81,101.11,TRUE 46 | arbitrated_top_n3_w8_d128_e0.btor2,157.58,2672,76.71,81.41,TRUE 47 | circular_pointer_top_w32_d32_e0.btor2,9.08,324,,, 48 | arbitrated_top_n3_w64_d64_e0.btor2,197.56,12759,139.97,143.47,TRUE 49 | arbitrated_top_n5_w128_d64_e0.btor2,106.42,573,,, 50 | circular_pointer_top_w64_d128_e0.btor2,26.56,369,,, 51 | arbitrated_top_n3_w64_d128_e0.btor2,279.95,24872,187.00,192.62,TRUE 52 | shift_register_top_w128_d16_e0.btor2,8.04,317,,, 53 | ridecore.btor,105.53,402,,, 54 | buggy_ridecore.btor,80.68,402,,, 55 | -------------------------------------------------------------------------------- /include/Target/Btor/btor2parser/btor2stack.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Btor2Tools: A tool package for the BTOR format. 3 | * 4 | * Copyright (C) 2007-2009 Robert Daniel Brummayer. 5 | * Copyright (C) 2007-2013 Armin Biere. 6 | * Copyright (C) 2013-2018 Aina Niemetz. 7 | * Copyright (C) 2015-2016 Mathias Preiner. 8 | * 9 | * All rights reserved. 10 | * 11 | * This file is part of the Btor2Tools package. 12 | * See LICENSE.txt for more information on using this software. 13 | */ 14 | 15 | #ifndef BTOR2STACK_H_INCLUDED 16 | #define BTOR2STACK_H_INCLUDED 17 | 18 | #include "btor2mem.h" 19 | 20 | #define BTOR2_DECLARE_STACK(name, type) \ 21 | typedef struct name##Stack name##Stack; \ 22 | struct name##Stack \ 23 | { \ 24 | type *start; \ 25 | type *top; \ 26 | type *end; \ 27 | } 28 | 29 | BTOR2_DECLARE_STACK (BtorChar, char); 30 | BTOR2_DECLARE_STACK (BtorCharPtr, char *); 31 | BTOR2_DECLARE_STACK (BtorVoidPtr, void *); 32 | 33 | #define BTOR2_INIT_STACK(stack) \ 34 | do \ 35 | { \ 36 | (stack).start = 0; \ 37 | (stack).top = 0; \ 38 | (stack).end = 0; \ 39 | } while (0) 40 | 41 | #define BTOR2_COUNT_STACK(stack) ((stack).top - (stack).start) 42 | #define BTOR2_SIZE_STACK(stack) ((stack).end - (stack).start) 43 | #define BTOR2_EMPTY_STACK(stack) ((stack).top == (stack).start) 44 | #define BTOR2_FULL_STACK(stack) ((stack).top == (stack).end) 45 | #define BTOR2_RESET_STACK(stack) ((stack).top = (stack).start) 46 | 47 | #define BTOR2_RELEASE_STACK(stack) \ 48 | do \ 49 | { \ 50 | BTOR2_DELETE ((stack).start); \ 51 | BTOR2_INIT_STACK ((stack)); \ 52 | } while (0) 53 | 54 | #define BTOR2_ENLARGE(p, o, n) \ 55 | do \ 56 | { \ 57 | size_t internaln = (o) ? 2 * (o) : 1; \ 58 | BTOR2_REALLOC ((p), internaln); \ 59 | (n) = internaln; \ 60 | } while (0) 61 | 62 | #define BTOR2_ENLARGE_STACK(stack) \ 63 | do \ 64 | { \ 65 | size_t old_size = BTOR2_SIZE_STACK (stack), new_size; \ 66 | size_t old_count = BTOR2_COUNT_STACK (stack); \ 67 | BTOR2_ENLARGE ((stack).start, old_size, new_size); \ 68 | (stack).top = (stack).start + old_count; \ 69 | (stack).end = (stack).start + new_size; \ 70 | } while (0) 71 | 72 | #define BTOR2_PUSH_STACK(stack, elem) \ 73 | do \ 74 | { \ 75 | if (BTOR2_FULL_STACK ((stack))) BTOR2_ENLARGE_STACK ((stack)); \ 76 | *((stack).top++) = (elem); \ 77 | } while (0) 78 | 79 | #define BTOR2_POP_STACK(stack) \ 80 | (assert (!BTOR2_EMPTY_STACK (stack)), (*--(stack).top)) 81 | 82 | #define BTOR2_PEEK_STACK(stack, idx) \ 83 | (assert ((idx) < BTOR2_COUNT_STACK (stack)), (stack).start[idx]) 84 | 85 | #define BTOR2_POKE_STACK(stack, idx, elem) \ 86 | do \ 87 | { \ 88 | assert ((idx) < BTOR2_COUNT_STACK (stack)); \ 89 | (stack).start[idx] = (elem); \ 90 | } while (0) 91 | 92 | #endif 93 | -------------------------------------------------------------------------------- /utils/cex/witness/witness_generator.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | 4 | class CexWitnessGenerator(object): 5 | 6 | def __init__(self, name='CexWitnessGenerator', help='Generate btor witness from SeaHorn cex'): 7 | self.name = name 8 | self.help = help 9 | self.states = list() 10 | self.inputs = dict() 11 | 12 | def get_value(self, value, width): 13 | return format(value, '0{}b'.format(width)) 14 | 15 | def mk_arg_parser(self, ap): 16 | ap.add_argument('-o', 17 | dest='out_file', 18 | metavar='FILE', 19 | help='Output file name', 20 | default=None) 21 | ap.add_argument('in_file', 22 | metavar='FILE', 23 | help='Input file') 24 | 25 | return ap 26 | 27 | def run(self, args=None): 28 | # default output destination is file `cex.txt` 29 | if args.out_file is None: 30 | args.out_file = 'cex.txt' 31 | print('Creating', args.out_file, '...') 32 | # keeps track of seen states and inputs 33 | seenStates = dict() 34 | seenInputs = dict() 35 | # keeps track of states and inputs per frame 36 | states = list() 37 | inputs = list() 38 | # register violated assertion 39 | violatedProperty = 0 40 | # read each line 41 | with open(args.in_file, errors='replace') as input: 42 | for line in input: 43 | if line.__contains__('[sea]'): 44 | if not line.__contains__('__VERIFIER_assert'): 45 | continue 46 | splitSeaLine = line.split(':') 47 | violatedProperty = int(splitSeaLine[1].split(',')[0].split()[0]) 48 | continue 49 | splitLine = line.split(',') 50 | name = splitLine[0].split()[0] 51 | btorId = int(splitLine[1].split()[0]) 52 | btorValue = int(splitLine[2].split()[0]) 53 | bvWidth = int(splitLine[3].split()[0]) 54 | # print(f'{name}, {btorId}, {btorValue}, {bvWidth}, {self.get_value(btorValue, bvWidth)}') 55 | if name == 'state': 56 | if btorId in seenStates: 57 | # print('repeat state: ', btorId) 58 | states.append(seenStates) 59 | inputs.append(seenInputs) 60 | seenStates = dict(); seenInputs = dict() 61 | seenStates[btorId] = self.get_value(btorValue, bvWidth) 62 | # print(inputs) 63 | # print(states) 64 | else: 65 | # print('got state: ', btorId) 66 | seenStates[btorId] = self.get_value(btorValue, bvWidth) 67 | # print(inputs) 68 | # print(states) 69 | else: 70 | if btorId in seenInputs: 71 | # print('repeat input: ', btorId) 72 | states.append(seenStates) 73 | inputs.append(seenInputs) 74 | seenStates = dict(); seenInputs = dict() 75 | seenInputs[btorId] = self.get_value(btorValue, bvWidth) 76 | # print(inputs) 77 | # print(states) 78 | else: 79 | # print('got input: ', btorId) 80 | seenInputs[btorId] = self.get_value(btorValue, bvWidth) 81 | # print(inputs) 82 | # print(states) 83 | 84 | # write to output file 85 | f = open(args.out_file, 'w') 86 | frame = 0 87 | # print header 88 | f.write(f'sat\n') 89 | f.write(f'b{violatedProperty}\n') # which property is violated? (b0, b1, j0,...) 90 | 91 | if seenStates or seenInputs: 92 | states.append(seenStates) 93 | inputs.append(seenInputs) 94 | # print(inputs) 95 | # print(states) 96 | for (s, i) in zip(states, inputs): 97 | # print(s, i) 98 | f.write(f'#{frame}\n') 99 | if s: 100 | for k, v in s.items(): 101 | f.write(f'{k} {v}\n') 102 | f.write(f'@{frame}\n') 103 | if i: 104 | for k, v in i.items(): 105 | f.write(f'{k} {v}\n') 106 | frame += 1 107 | else: 108 | for i in range(21): 109 | f.write(f'#{i}\n') 110 | f.write(f'@{i}\n') 111 | 112 | f.write('.\n') 113 | f.close() 114 | return 0 115 | 116 | def main(self, argv): 117 | import argparse 118 | 119 | ap = argparse.ArgumentParser(prog=self.name, description=self.help) 120 | ap = self.mk_arg_parser(ap) 121 | 122 | args = ap.parse_args(argv) 123 | return self.run(args) 124 | 125 | def main(): 126 | cmd = CexWitnessGenerator() 127 | return cmd.main(sys.argv[1:]) 128 | 129 | 130 | if __name__ == '__main__': 131 | sys.exit(main()) -------------------------------------------------------------------------------- /results/25-btormc/25-btormc_19C_wolf_0202231740.csv: -------------------------------------------------------------------------------- 1 | index,btor_time,status 2 | dspfilters_fastfir_second-p04.btor,25.623,unsat 3 | dspfilters_fastfir_second-p05.btor,40.691,unsat 4 | dspfilters_fastfir_second-p06.btor,32.265,unsat 5 | dspfilters_fastfir_second-p07.btor,45.789,unsat 6 | dspfilters_fastfir_second-p09.btor,133.712,unsat 7 | dspfilters_fastfir_second-p10.btor,228.41,unsat 8 | dspfilters_fastfir_second-p11.btor,39.464,unsat 9 | dspfilters_fastfir_second-p14.btor,298.703, 10 | dspfilters_fastfir_second-p16.btor,29.489,unsat 11 | dspfilters_fastfir_second-p18.btor,31.517,unsat 12 | dspfilters_fastfir_second-p21.btor,21.551,unsat 13 | dspfilters_fastfir_second-p22.btor,298.678, 14 | dspfilters_fastfir_second-p25.btor,31.958,unsat 15 | dspfilters_fastfir_second-p26.btor,298.514, 16 | dspfilters_fastfir_second-p42.btor,35.176,unsat 17 | dspfilters_fastfir_second-p43.btor,298.976, 18 | dspfilters_fastfir_second-p45.btor,298.781, 19 | qspiflash_dualflexpress_divfive-p007.btor,8.018,unsat 20 | qspiflash_dualflexpress_divfive-p009.btor,6.613,unsat 21 | qspiflash_dualflexpress_divfive-p016.btor,2.895,unsat 22 | qspiflash_dualflexpress_divfive-p022.btor,3.271,unsat 23 | qspiflash_dualflexpress_divfive-p037.btor,4.724,unsat 24 | qspiflash_dualflexpress_divfive-p050.btor,3.238,unsat 25 | qspiflash_dualflexpress_divfive-p054.btor,3.288,unsat 26 | qspiflash_dualflexpress_divfive-p058.btor,5.072,unsat 27 | qspiflash_dualflexpress_divfive-p074.btor,7.883,unsat 28 | qspiflash_dualflexpress_divfive-p079.btor,2.977,unsat 29 | qspiflash_dualflexpress_divfive-p092.btor,3.249,unsat 30 | qspiflash_dualflexpress_divfive-p097.btor,5.898,unsat 31 | qspiflash_dualflexpress_divfive-p112.btor,4.029,unsat 32 | qspiflash_dualflexpress_divfive-p116.btor,2.074,unsat 33 | qspiflash_dualflexpress_divfive-p120.btor,3.723,unsat 34 | qspiflash_dualflexpress_divfive-p126.btor,2.747,unsat 35 | qspiflash_dualflexpress_divfive-p127.btor,1.367,unsat 36 | qspiflash_dualflexpress_divfive-p128.btor,2.643,unsat 37 | qspiflash_dualflexpress_divfive-p133.btor,1.924,unsat 38 | qspiflash_dualflexpress_divfive-p135.btor,1.861,unsat 39 | qspiflash_dualflexpress_divfive-p136.btor,2.93,unsat 40 | qspiflash_dualflexpress_divfive-p143.btor,4.563,unsat 41 | qspiflash_dualflexpress_divfive-p154.btor,3.122,unsat 42 | qspiflash_dualflexpress_divfive-p161.btor,2.179,unsat 43 | qspiflash_dualflexpress_divfive-p164.btor,3.281,unsat 44 | qspiflash_dualflexpress_divthree-p005.btor,12.607,unsat 45 | qspiflash_dualflexpress_divthree-p006.btor,4.627,unsat 46 | qspiflash_dualflexpress_divthree-p007.btor,12.712,unsat 47 | qspiflash_dualflexpress_divthree-p010.btor,12.388,unsat 48 | qspiflash_dualflexpress_divthree-p012.btor,9.991,unsat 49 | qspiflash_dualflexpress_divthree-p032.btor,4.112,unsat 50 | qspiflash_dualflexpress_divthree-p034.btor,3.136,unsat 51 | qspiflash_dualflexpress_divthree-p046.btor,8.277,unsat 52 | qspiflash_dualflexpress_divthree-p054.btor,3.248,unsat 53 | qspiflash_dualflexpress_divthree-p068.btor,2.572,unsat 54 | qspiflash_dualflexpress_divthree-p069.btor,3.193,unsat 55 | qspiflash_dualflexpress_divthree-p075.btor,3.888,unsat 56 | qspiflash_dualflexpress_divthree-p076.btor,7.934,unsat 57 | qspiflash_dualflexpress_divthree-p085.btor,4.768,unsat 58 | qspiflash_dualflexpress_divthree-p094.btor,4.084,unsat 59 | qspiflash_dualflexpress_divthree-p106.btor,5.701,unsat 60 | qspiflash_dualflexpress_divthree-p111.btor,4.727,unsat 61 | qspiflash_dualflexpress_divthree-p113.btor,2.422,unsat 62 | qspiflash_dualflexpress_divthree-p121.btor,2.896,unsat 63 | qspiflash_dualflexpress_divthree-p124.btor,3.093,unsat 64 | qspiflash_dualflexpress_divthree-p134.btor,2.999,unsat 65 | qspiflash_dualflexpress_divthree-p136.btor,3.058,unsat 66 | qspiflash_dualflexpress_divthree-p141.btor,5.892,unsat 67 | qspiflash_dualflexpress_divthree-p143.btor,4.76,unsat 68 | qspiflash_dualflexpress_divthree-p151.btor,1.839,unsat 69 | qspiflash_dualflexpress_divthree-p153.btor,1.961,unsat 70 | qspiflash_dualflexpress_divthree-p158.btor,4.029,unsat 71 | qspiflash_dualflexpress_divthree-p161.btor,1.445,unsat 72 | qspiflash_dualflexpress_divthree-p164.btor,2.333,unsat 73 | qspiflash_qflexpress_divfive-p017.btor,2.868,unsat 74 | qspiflash_qflexpress_divfive-p029.btor,2.903,unsat 75 | qspiflash_qflexpress_divfive-p036.btor,2.383,unsat 76 | qspiflash_qflexpress_divfive-p038.btor,2.935,unsat 77 | qspiflash_qflexpress_divfive-p048.btor,2.642,unsat 78 | qspiflash_qflexpress_divfive-p063.btor,2.536,unsat 79 | qspiflash_qflexpress_divfive-p064.btor,4.875,unsat 80 | qspiflash_qflexpress_divfive-p067.btor,6.042,unsat 81 | qspiflash_qflexpress_divfive-p075.btor,5.779,unsat 82 | qspiflash_qflexpress_divfive-p079.btor,6.212,unsat 83 | qspiflash_qflexpress_divfive-p094.btor,3.361,unsat 84 | qspiflash_qflexpress_divfive-p100.btor,4.086,unsat 85 | qspiflash_qflexpress_divfive-p104.btor,3.259,unsat 86 | qspiflash_qflexpress_divfive-p107.btor,2.481,unsat 87 | qspiflash_qflexpress_divfive-p113.btor,5.315,unsat 88 | qspiflash_qflexpress_divfive-p121.btor,4.715,unsat 89 | qspiflash_qflexpress_divfive-p122.btor,3.889,unsat 90 | qspiflash_qflexpress_divfive-p137.btor,2.773,unsat 91 | qspiflash_qflexpress_divfive-p139.btor,3.315,unsat 92 | vgasim_imgfifo-p036.btor,3.758,unsat 93 | vgasim_imgfifo-p047.btor,3.34,unsat 94 | vgasim_imgfifo-p064.btor,3.126,unsat 95 | vgasim_imgfifo-p066.btor,2.586,unsat 96 | vgasim_imgfifo-p070.btor,3.541,unsat 97 | vgasim_imgfifo-p075.btor,3.558,unsat 98 | vgasim_imgfifo-p082.btor,3.514,unsat 99 | vgasim_imgfifo-p088.btor,3.12,unsat 100 | vgasim_imgfifo-p089.btor,3.035,unsat 101 | vgasim_imgfifo-p093.btor,2.621,unsat 102 | vgasim_imgfifo-p099.btor,3.029,unsat 103 | vgasim_imgfifo-p105.btor,2.807,unsat 104 | vgasim_imgfifo-p109.btor,3.815,unsat 105 | vgasim_imgfifo-p110.btor,2.883,unsat 106 | vgasim_imgfifo-p111.btor,2.248,unsat 107 | zipversa_composecrc_prf-p00.btor,1.154,unsat 108 | zipversa_composecrc_prf-p03.btor,299.76800000000003, 109 | zipversa_composecrc_prf-p07.btor,1.262,unsat 110 | zipversa_composecrc_prf-p10.btor,38.847,unsat 111 | zipversa_composecrc_prf-p11.btor,2.152,unsat 112 | zipversa_composecrc_prf-p15.btor,1.395,unsat 113 | zipversa_composecrc_prf-p17.btor,1.32,unsat 114 | zipversa_composecrc_prf-p22.btor,1.721,unsat 115 | -------------------------------------------------------------------------------- /results/boolector/boolector_19C_wolf_0330231148.csv: -------------------------------------------------------------------------------- 1 | index,btor_time,status 2 | dspfilters_fastfir_second-p04.btor,52.071,unsat 3 | dspfilters_fastfir_second-p05.btor,17.566,unsat 4 | dspfilters_fastfir_second-p06.btor,18.445,unsat 5 | dspfilters_fastfir_second-p07.btor,73.825,unsat 6 | dspfilters_fastfir_second-p09.btor,0.002, 7 | dspfilters_fastfir_second-p10.btor,203.427,unsat 8 | dspfilters_fastfir_second-p11.btor,17.837,unsat 9 | dspfilters_fastfir_second-p14.btor,299.09000000000003,unknown 10 | dspfilters_fastfir_second-p16.btor,17.189,unsat 11 | dspfilters_fastfir_second-p18.btor,18.057,unsat 12 | dspfilters_fastfir_second-p21.btor,13.793,unsat 13 | dspfilters_fastfir_second-p22.btor,263.53,unsat 14 | dspfilters_fastfir_second-p25.btor,17.424,unsat 15 | dspfilters_fastfir_second-p26.btor,298.915,unknown 16 | dspfilters_fastfir_second-p42.btor,15.927,unsat 17 | dspfilters_fastfir_second-p43.btor,299.05899999999997,unknown 18 | dspfilters_fastfir_second-p45.btor,298.914,unknown 19 | qspiflash_dualflexpress_divfive-p007.btor,2.837,unsat 20 | qspiflash_dualflexpress_divfive-p009.btor,2.681,unsat 21 | qspiflash_dualflexpress_divfive-p016.btor,1.537,unsat 22 | qspiflash_dualflexpress_divfive-p022.btor,1.416,unsat 23 | qspiflash_dualflexpress_divfive-p037.btor,1.617,unsat 24 | qspiflash_dualflexpress_divfive-p050.btor,1.473,unsat 25 | qspiflash_dualflexpress_divfive-p054.btor,1.505,unsat 26 | qspiflash_dualflexpress_divfive-p058.btor,2.277,unsat 27 | qspiflash_dualflexpress_divfive-p074.btor,3.012,unsat 28 | qspiflash_dualflexpress_divfive-p079.btor,1.856,unsat 29 | qspiflash_dualflexpress_divfive-p092.btor,2.133,unsat 30 | qspiflash_dualflexpress_divfive-p097.btor,1.545,unsat 31 | qspiflash_dualflexpress_divfive-p112.btor,1.308,unsat 32 | qspiflash_dualflexpress_divfive-p116.btor,0.905,unsat 33 | qspiflash_dualflexpress_divfive-p120.btor,1.434,unsat 34 | qspiflash_dualflexpress_divfive-p126.btor,0.949,unsat 35 | qspiflash_dualflexpress_divfive-p127.btor,0.048,unsat 36 | qspiflash_dualflexpress_divfive-p128.btor,1.348,unsat 37 | qspiflash_dualflexpress_divfive-p133.btor,1.435,unsat 38 | qspiflash_dualflexpress_divfive-p135.btor,1.406,unsat 39 | qspiflash_dualflexpress_divfive-p136.btor,1.329,unsat 40 | qspiflash_dualflexpress_divfive-p143.btor,1.892,unsat 41 | qspiflash_dualflexpress_divfive-p154.btor,1.396,unsat 42 | qspiflash_dualflexpress_divfive-p161.btor,0.063,unsat 43 | qspiflash_dualflexpress_divfive-p164.btor,1.512,unsat 44 | qspiflash_dualflexpress_divthree-p005.btor,4.516,unsat 45 | qspiflash_dualflexpress_divthree-p006.btor,2.64,unsat 46 | qspiflash_dualflexpress_divthree-p007.btor,3.161,unsat 47 | qspiflash_dualflexpress_divthree-p010.btor,2.162,unsat 48 | qspiflash_dualflexpress_divthree-p012.btor,2.033,unsat 49 | qspiflash_dualflexpress_divthree-p032.btor,1.604,unsat 50 | qspiflash_dualflexpress_divthree-p034.btor,1.575,unsat 51 | qspiflash_dualflexpress_divthree-p046.btor,3.155,unsat 52 | qspiflash_dualflexpress_divthree-p054.btor,1.54,unsat 53 | qspiflash_dualflexpress_divthree-p068.btor,0.271,unsat 54 | qspiflash_dualflexpress_divthree-p069.btor,1.505,unsat 55 | qspiflash_dualflexpress_divthree-p075.btor,1.498,unsat 56 | qspiflash_dualflexpress_divthree-p076.btor,1.736,unsat 57 | qspiflash_dualflexpress_divthree-p085.btor,1.714,unsat 58 | qspiflash_dualflexpress_divthree-p094.btor,2.175,unsat 59 | qspiflash_dualflexpress_divthree-p106.btor,1.631,unsat 60 | qspiflash_dualflexpress_divthree-p111.btor,1.729,unsat 61 | qspiflash_dualflexpress_divthree-p113.btor,0.308,unsat 62 | qspiflash_dualflexpress_divthree-p121.btor,2.154,unsat 63 | qspiflash_dualflexpress_divthree-p124.btor,1.45,unsat 64 | qspiflash_dualflexpress_divthree-p134.btor,1.54,unsat 65 | qspiflash_dualflexpress_divthree-p136.btor,2.036,unsat 66 | qspiflash_dualflexpress_divthree-p141.btor,1.518,unsat 67 | qspiflash_dualflexpress_divthree-p143.btor,1.863,unsat 68 | qspiflash_dualflexpress_divthree-p151.btor,0.054,unsat 69 | qspiflash_dualflexpress_divthree-p153.btor,0.056,unsat 70 | qspiflash_dualflexpress_divthree-p158.btor,1.375,unsat 71 | qspiflash_dualflexpress_divthree-p161.btor,0.058,unsat 72 | qspiflash_dualflexpress_divthree-p164.btor,0.984,unsat 73 | qspiflash_qflexpress_divfive-p017.btor,1.131,unsat 74 | qspiflash_qflexpress_divfive-p029.btor,1.593,unsat 75 | qspiflash_qflexpress_divfive-p036.btor,0.912,unsat 76 | qspiflash_qflexpress_divfive-p038.btor,1.566,unsat 77 | qspiflash_qflexpress_divfive-p048.btor,1.605,unsat 78 | qspiflash_qflexpress_divfive-p063.btor,0.04,unsat 79 | qspiflash_qflexpress_divfive-p064.btor,1.57,unsat 80 | qspiflash_qflexpress_divfive-p067.btor,1.515,unsat 81 | qspiflash_qflexpress_divfive-p075.btor,2.506,unsat 82 | qspiflash_qflexpress_divfive-p079.btor,2.012,unsat 83 | qspiflash_qflexpress_divfive-p094.btor,1.379,unsat 84 | qspiflash_qflexpress_divfive-p100.btor,1.386,unsat 85 | qspiflash_qflexpress_divfive-p104.btor,1.548,unsat 86 | qspiflash_qflexpress_divfive-p107.btor,1.372,unsat 87 | qspiflash_qflexpress_divfive-p113.btor,1.699,unsat 88 | qspiflash_qflexpress_divfive-p121.btor,1.405,unsat 89 | qspiflash_qflexpress_divfive-p122.btor,2.037,unsat 90 | qspiflash_qflexpress_divfive-p137.btor,1.228,unsat 91 | qspiflash_qflexpress_divfive-p139.btor,1.444,unsat 92 | vgasim_imgfifo-p036.btor,2.563,unsat 93 | vgasim_imgfifo-p047.btor,2.319,unsat 94 | vgasim_imgfifo-p064.btor,2.503,unsat 95 | vgasim_imgfifo-p066.btor,2.557,unsat 96 | vgasim_imgfifo-p070.btor,2.819,unsat 97 | vgasim_imgfifo-p075.btor,2.674,unsat 98 | vgasim_imgfifo-p082.btor,3.255,unsat 99 | vgasim_imgfifo-p088.btor,0.063,unsat 100 | vgasim_imgfifo-p089.btor,2.608,unsat 101 | vgasim_imgfifo-p093.btor,2.407,unsat 102 | vgasim_imgfifo-p099.btor,2.448,unsat 103 | vgasim_imgfifo-p105.btor,2.556,unsat 104 | vgasim_imgfifo-p109.btor,0.065,unsat 105 | vgasim_imgfifo-p110.btor,2.509,unsat 106 | vgasim_imgfifo-p111.btor,0.061,unsat 107 | zipversa_composecrc_prf-p00.btor,0.084,unsat 108 | zipversa_composecrc_prf-p03.btor,299.734,unknown 109 | zipversa_composecrc_prf-p07.btor,1.533,unsat 110 | zipversa_composecrc_prf-p10.btor,13.623,unsat 111 | zipversa_composecrc_prf-p11.btor,1.034,unsat 112 | zipversa_composecrc_prf-p15.btor,1.852,unsat 113 | zipversa_composecrc_prf-p17.btor,1.437,unsat 114 | zipversa_composecrc_prf-p22.btor,2.016,unsat 115 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Bᴛᴏʀ2ᴍʟɪʀ: A Format and Toolchain for Hardware Verification 2 | ![os](https://img.shields.io/badge/os-linux-orange?logo=linux) 3 | ![os](https://img.shields.io/badge/os-macos-silver?logo=apple) 4 | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)][data] 5 | 6 | ## Results 7 | Detailed analysis of run-times is available in an accompanying [Jupyter 8 | Notebook][data] in Google Collab. We also contribute translations of the 2019/20 Hardware Model Checking Competion benchmarks to our Btor Dialect, LLVM-IR and SMT-LIB in [hwmcc20-mlir](https://github.com/jetafese/hwmcc20-mlir). The image below shows the different verification strategies employed. 9 | 10 | ![strategies-img](./assets/strategies.png "Verification Strategies") 11 | 12 | 13 | 14 | [data]: https://colab.research.google.com/drive/1wau9yTHvsWdBdMjF0TbvHTHEKW6rFHiQ?usp=sharing 15 | 16 | ## Demo 17 | 18 | Consider a simple counter that ensures we do not reach 15, represented in Bᴛᴏʀ2 below: 19 | 20 | ```btor 21 | 1 sort bitvec 4 22 | 2 zero 1 23 | 3 state 1 out 24 | 4 init 1 3 2 25 | 5 one 1 26 | 6 add 1 3 5 27 | 7 next 1 3 6 28 | 8 ones 1 29 | 9 sort bitvec 1 30 | 10 eq 9 3 8 31 | 11 bad 10 32 | ``` 33 | 34 | Using the command `build/bin/btor2mlir-translate --import-btor counter.btor2 > counter.mlir`, where `counter.btor2` is the file shown above, we get the equivalent representation of our circuit in the BTOR Dialect of MLIR below (counter.mlir): 35 | 36 | ```mlir 37 | module { 38 | func @main() { 39 | %0 = btor.constant 0 : i4 !btor.bv<4> 40 | br ^bb1(%0 : !btor.bv<4>) 41 | ^bb1(%1: !btor.bv<4>): // 2 preds: ^bb0, ^bb1 42 | %2 = btor.constant 1 : i4 !btor.bv<4> 43 | %3 = btor.add %1, %2 : !btor.bv<4> 44 | %4 = btor.constant -1 : i4 !btor.bv<4> 45 | %5 = btor.cmp eq, %1, %4 : !btor.bv<4> 46 | btor.assert_not(%5), 0 : i64 !btor.bv<1> 47 | br ^bb1(%3 : !btor.bv<4>) 48 | } 49 | } 50 | ``` 51 | 52 | Then, using the command `build/bin/btor2mlir-opt --convert-std-to-llvm --convert-btor-to-llvm counter.mlir > counter.mlir.opt` we get the file below which represents the original circuit in the LLVM Dialect of MLIR. 53 | 54 | ```mlir 55 | module attributes {llvm.data_layout = ""} { 56 | llvm.func @__VERIFIER_error() 57 | llvm.func @__VERIFIER_assert(i1, i64) 58 | llvm.func @main() { 59 | %0 = llvm.mlir.constant(0 : i4) : i4 60 | llvm.br ^bb1(%0 : i4) 61 | ^bb1(%1: i4): // 2 preds: ^bb0, ^bb2 62 | %2 = llvm.mlir.constant(1 : i4) : i4 63 | %3 = llvm.add %1, %2 : i4 64 | %4 = llvm.mlir.constant(-1 : i4) : i4 65 | %5 = llvm.icmp "eq" %1, %4 : i4 66 | %6 = llvm.mlir.constant(true) : i1 67 | %7 = llvm.xor %5, %6 : i1 68 | llvm.cond_br %7, ^bb2, ^bb3 69 | ^bb2: // pred: ^bb1 70 | llvm.br ^bb1(%3 : i4) 71 | ^bb3: // pred: ^bb1 72 | %8 = llvm.mlir.constant(0 : i64) : i64 73 | llvm.call @__VERIFIER_assert(%7, %8) : (i1, i64) -> () 74 | llvm.call @__VERIFIER_error() : () -> () 75 | llvm.unreachable 76 | } 77 | } 78 | ``` 79 | 80 | Finally, using the command `build/bin/btor2mlir-translate --mlir-to-llvmir counter.mlir.opt > counter.ll` we generate the circuit as an LLVM-IR program below (counter.ll): 81 | 82 | ```llvm 83 | declare void @__VERIFIER_error() 84 | declare void @__VERIFIER_assert(i1, i64) 85 | define void @main() !dbg !3 { 86 | br label %1, !dbg !7 87 | 1: ; preds = %6, %0 88 | %2 = phi i4 [ %3, %6 ], [ 0, %0 ] 89 | %3 = add i4 %2, 1, !dbg !9 90 | %4 = icmp eq i4 %2, -1, !dbg !10 91 | %5 = xor i1 %4, true, !dbg !11 92 | br i1 %5, label %6, label %7, !dbg !12 93 | 6: ; preds = %1 94 | br label %1, !dbg !13 95 | 7: ; preds = %1 96 | call void @__VERIFIER_assert(i1 %5, i64 0), !dbg !14 97 | call void @__VERIFIER_error(), !dbg !15 98 | unreachable, !dbg !16 99 | } 100 | ``` 101 | 102 | If you have SeaHorn installed locally (a distribution is included in the Docker), we can show that the bad state in the original circuit is reached using SeaHorn's Bounded Model Checking engine. This is indicated by the output **sat** when we run the command: `sea bpf counter.ll` 103 | 104 | ## Witness Generation 105 | 106 | Run the shell script [`./get_cex_seahorn.sh $btor2_file`](utils/cex/witness/get_cex_seahorn.sh) to: 107 | 108 | a) extract a counter example from SeaHorn \ 109 | b) generate a Btor2 Witness \ 110 | c) simulate the witness using `btorsim` 111 | 112 | ## Docker 113 | 114 | Dockerfile: [`docker/btor2mlir.Dockerfile`](docker/btor2mlir.Dockerfile). 115 | 116 | From the root folder use the following commands to: 117 | 118 | Build: `docker build -t btor2mlir . --file docker/btor2mlir.Dockerfile` 119 | 120 | Run: `docker run -it btor2mlir` 121 | 122 | ## Building Locally 123 | 124 | The instructions assume that `cmake`, `clang/clang++` and `ninja` are installed on your machine, `LLVM_PROJECT=/ag/llvm-gh-mlir`, and that `lit` 125 | command is installed and is globally available 126 | 127 | ### Building LLVM 128 | Commands to configure and compile LLVM 129 | 130 | ```sh 131 | $ mkdir debug && cd debug 132 | $ cmake -G Ninja ../llvm \ 133 | -DCMAKE_C_COMPILER=clang-14 -DCMAKE_CXX_COMPILER=clang++-14 \ 134 | -DLLVM_ENABLE_PROJECTS=mlir -DLLVM_BUILD_EXAMPLES=ON \ 135 | -DCMAKE_BUILD_TYPE=Debug \ # change to RelWithDebInfo for release build 136 | -DLLVM_TARGETS_TO_BUILD="X86" \ 137 | -DLLVM_ENABLE_LLD=ON \ # only on Linux 138 | -DLLVM_INSTALL_UTILS=ON \ # optional to install FileCheck and lit 139 | -DCMAKE_INSTALL_PREFIX=$(pwd)/run # install location in `run` under build 140 | $ ninja 141 | $ ninja install 142 | ``` 143 | 144 | The above installs a debug version of llvm under `LLVM_PROJECT/debug/run`, 145 | where `LLVM_PROJECT` is the root of llvm project on your machine. 146 | 147 | ### Building 148 | To compile this project 149 | 150 | ```sh 151 | $ mkdir debug && cd debug 152 | $ cmake -G Ninja .. \ 153 | -DMLIR_DIR=/ag/llvm-gh-mlir/debug/run/lib/cmake/mlir \ 154 | -DLLVM_DIR=/ag/llvm-gh-mlir/debug/run/lib/cmake/llvm \ 155 | -DLLVM_EXTERNAL_LIT=$(which lit) \ 156 | -DLLVM_ENABLE_LLD=ON \ 157 | -DCMAKE_INSTALL_PREFIX=$(pwd)/run \ 158 | ``` 159 | 160 | 161 | ## Contributors 162 | Arie Gurfinkel \ 163 | Joseph Tafese 164 | -------------------------------------------------------------------------------- /include/Target/Btor/btor2parser/btor2parser.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Btor2Tools: A tool package for the BTOR2 format. 3 | * 4 | * Copyright (c) 2012-2018 Armin Biere. 5 | * Copyright (c) 2017 Mathias Preiner 6 | * Copyright (c) 2017 Aina Niemetz 7 | * 8 | * All rights reserved. 9 | * 10 | * This file is part of the Btor2Tools package. 11 | * See LICENSE.txt for more information on using this software. 12 | */ 13 | 14 | #ifndef btor2parser_h_INCLUDED 15 | #define btor2parser_h_INCLUDED 16 | 17 | /*------------------------------------------------------------------------*/ 18 | /* The BTOR2 format is described in */ 19 | /* "BTOR2, BtorMC and Boolector 3.0" by A. Niemetz, M. Preiner, C. Wolf */ 20 | /* and A. Biere at CAV 2018. */ 21 | /*------------------------------------------------------------------------*/ 22 | 23 | #include 24 | #include 25 | 26 | #if __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /*------------------------------------------------------------------------*/ 31 | 32 | #define BTOR2_FORMAT_MAXID (((int64_t) 1) << 40) 33 | #define BTOR2_FORMAT_MAXBITWIDTH ((1l << 30) + ((1l << 30) - 1)) 34 | 35 | /*------------------------------------------------------------------------*/ 36 | 37 | typedef struct Btor2Parser Btor2Parser; 38 | typedef struct Btor2Line Btor2Line; 39 | typedef struct Btor2Sort Btor2Sort; 40 | typedef struct Btor2LineIterator Btor2LineIterator; 41 | 42 | /*------------------------------------------------------------------------*/ 43 | 44 | /** 45 | * BTOR2 tags can be used for fast(er) traversal and operations on BTOR2 46 | * format lines, e.g., in a switch statement in client code. 47 | * Alternatively, client code can use the name of the BTOR2 tag, which is a C 48 | * string (redundantly) contained in the format line. Note that this requires 49 | * string comparisons and is therefore slower even if client code uses an 50 | * additional hash table. 51 | */ 52 | enum Btor2Tag 53 | { 54 | BTOR2_TAG_add, 55 | BTOR2_TAG_and, 56 | BTOR2_TAG_bad, 57 | BTOR2_TAG_concat, 58 | BTOR2_TAG_const, 59 | BTOR2_TAG_constraint, 60 | BTOR2_TAG_constd, 61 | BTOR2_TAG_consth, 62 | BTOR2_TAG_dec, 63 | BTOR2_TAG_eq, 64 | BTOR2_TAG_fair, 65 | BTOR2_TAG_iff, 66 | BTOR2_TAG_implies, 67 | BTOR2_TAG_inc, 68 | BTOR2_TAG_init, 69 | BTOR2_TAG_input, 70 | BTOR2_TAG_ite, 71 | BTOR2_TAG_justice, 72 | BTOR2_TAG_mul, 73 | BTOR2_TAG_nand, 74 | BTOR2_TAG_neq, 75 | BTOR2_TAG_neg, 76 | BTOR2_TAG_next, 77 | BTOR2_TAG_nor, 78 | BTOR2_TAG_not, 79 | BTOR2_TAG_one, 80 | BTOR2_TAG_ones, 81 | BTOR2_TAG_or, 82 | BTOR2_TAG_output, 83 | BTOR2_TAG_read, 84 | BTOR2_TAG_redand, 85 | BTOR2_TAG_redor, 86 | BTOR2_TAG_redxor, 87 | BTOR2_TAG_rol, 88 | BTOR2_TAG_ror, 89 | BTOR2_TAG_saddo, 90 | BTOR2_TAG_sdiv, 91 | BTOR2_TAG_sdivo, 92 | BTOR2_TAG_sext, 93 | BTOR2_TAG_sgt, 94 | BTOR2_TAG_sgte, 95 | BTOR2_TAG_slice, 96 | BTOR2_TAG_sll, 97 | BTOR2_TAG_slt, 98 | BTOR2_TAG_slte, 99 | BTOR2_TAG_sort, 100 | BTOR2_TAG_smod, 101 | BTOR2_TAG_smulo, 102 | BTOR2_TAG_sra, 103 | BTOR2_TAG_srem, 104 | BTOR2_TAG_srl, 105 | BTOR2_TAG_ssubo, 106 | BTOR2_TAG_state, 107 | BTOR2_TAG_sub, 108 | BTOR2_TAG_uaddo, 109 | BTOR2_TAG_udiv, 110 | BTOR2_TAG_uext, 111 | BTOR2_TAG_ugt, 112 | BTOR2_TAG_ugte, 113 | BTOR2_TAG_ult, 114 | BTOR2_TAG_ulte, 115 | BTOR2_TAG_umulo, 116 | BTOR2_TAG_urem, 117 | BTOR2_TAG_usubo, 118 | BTOR2_TAG_write, 119 | BTOR2_TAG_xnor, 120 | BTOR2_TAG_xor, 121 | BTOR2_TAG_zero, 122 | }; 123 | typedef enum Btor2Tag Btor2Tag; 124 | 125 | enum Btor2SortTag 126 | { 127 | BTOR2_TAG_SORT_array, 128 | BTOR2_TAG_SORT_bitvec, 129 | }; 130 | typedef enum Btor2SortTag Btor2SortTag; 131 | 132 | /*------------------------------------------------------------------------*/ 133 | 134 | struct Btor2Sort 135 | { 136 | int64_t id; 137 | Btor2SortTag tag; 138 | const char *name; 139 | union 140 | { 141 | struct 142 | { 143 | int64_t index; 144 | int64_t element; 145 | } array; 146 | struct 147 | { 148 | uint32_t width; 149 | } bitvec; 150 | }; 151 | }; 152 | 153 | struct Btor2Line 154 | { 155 | int64_t id; /* positive id (non zero) */ 156 | int64_t lineno; /* line number in original file */ 157 | const char *name; /* name in ASCII: "and", "add", ... */ 158 | Btor2Tag tag; /* same as name but encoded as integer */ 159 | Btor2Sort sort; 160 | int64_t init, next; /* non zero if initialized or has next */ 161 | char *constant; /* non zero for const, constd, consth */ 162 | char *symbol; /* optional for: var array state input */ 163 | uint32_t nargs; /* number of arguments */ 164 | int64_t *args; /* non zero ids up to nargs */ 165 | }; 166 | 167 | struct Btor2LineIterator 168 | { 169 | Btor2Parser *reader; 170 | int64_t next; 171 | }; 172 | 173 | /*------------------------------------------------------------------------*/ 174 | /* Constructor, setting options and destructor: 175 | */ 176 | Btor2Parser *btor2parser_new (); 177 | void btor2parser_delete (Btor2Parser *); 178 | 179 | /*------------------------------------------------------------------------*/ 180 | /* The 'btor2parser_read_lines' function returns zero on failure. In this 181 | * case you can call 'btor2parser_error' to obtain a description of 182 | * the actual read or parse error, which includes the line number where 183 | * the error occurred. 184 | */ 185 | int32_t btor2parser_read_lines (Btor2Parser *, FILE *); 186 | const char *btor2parser_error (Btor2Parser *); 187 | 188 | /*------------------------------------------------------------------------*/ 189 | /* Iterate over all read format lines: 190 | * 191 | * Btor2LineIterator it = btor2parser_iter_init (bfr); 192 | * Btor2Line * l; 193 | * while ((l = btor2parser_iter_next (&it))) 194 | * do_something_with_btor_format_line (l); 195 | */ 196 | Btor2LineIterator btor2parser_iter_init (Btor2Parser *bfr); 197 | Btor2Line *btor2parser_iter_next (Btor2LineIterator *); 198 | 199 | /*------------------------------------------------------------------------*/ 200 | /* The reader maintains a mapping of ids to format lines. This mapping 201 | * can be retrieved with the following function. Note, however, that 202 | * ids might be negative and denote the negation of the actual node. 203 | */ 204 | int64_t btor2parser_max_id (Btor2Parser *); 205 | Btor2Line *btor2parser_get_line_by_id (Btor2Parser *, int64_t id); 206 | 207 | /*------------------------------------------------------------------------*/ 208 | 209 | #if __cplusplus 210 | } 211 | #endif 212 | #endif 213 | -------------------------------------------------------------------------------- /results/vcGen/vcGen_19C_wolf_0321231836.csv: -------------------------------------------------------------------------------- 1 | base,Cpu,Mem,BMC,seahorn_total,Result 2 | qspiflash_dualflexpress_divfive-p143.btor,20.87,505,0.90,1.77, 3 | qspiflash_qflexpress_divfive-p063.btor,22.17,502,0.79,1.57, 4 | qspiflash_dualflexpress_divfive-p161.btor,22.97,507,0.86,1.68, 5 | qspiflash_qflexpress_divfive-p107.btor,22.86,505,0.84,1.64, 6 | qspiflash_dualflexpress_divfive-p154.btor,23.55,507,0.93,1.75, 7 | qspiflash_dualflexpress_divthree-p005.btor,23.42,507,0.88,1.75, 8 | qspiflash_dualflexpress_divthree-p006.btor,23.43,506,0.89,1.72, 9 | qspiflash_qflexpress_divfive-p094.btor,23.58,505,0.91,1.79, 10 | qspiflash_qflexpress_divfive-p079.btor,23.64,507,0.91,1.73, 11 | qspiflash_qflexpress_divfive-p104.btor,24.01,505,0.92,1.80, 12 | qspiflash_dualflexpress_divthree-p034.btor,24.23,507,0.95,1.79, 13 | qspiflash_dualflexpress_divthree-p007.btor,24.34,507,0.92,1.83, 14 | qspiflash_qflexpress_divfive-p064.btor,24.37,506,0.93,1.76, 15 | qspiflash_dualflexpress_divfive-p164.btor,24.49,507,0.95,1.81, 16 | qspiflash_dualflexpress_divthree-p032.btor,24.47,508,0.96,1.87, 17 | qspiflash_dualflexpress_divthree-p010.btor,24.88,506,0.89,1.79, 18 | qspiflash_dualflexpress_divthree-p012.btor,24.97,507,0.93,1.78, 19 | qspiflash_qflexpress_divfive-p100.btor,25.10,506,0.96,1.86, 20 | qspiflash_qflexpress_divfive-p067.btor,27.02,509,0.99,1.94, 21 | qspiflash_qflexpress_divfive-p113.btor,27.47,509,1.02,1.97, 22 | qspiflash_qflexpress_divfive-p075.btor,40.01,647,1.56,2.99, 23 | qspiflash_qflexpress_divfive-p121.btor,24.99,506,0.86,1.69, 24 | qspiflash_dualflexpress_divthree-p068.btor,23.41,504,0.86,1.67, 25 | qspiflash_qflexpress_divfive-p122.btor,24.01,503,0.83,1.67, 26 | qspiflash_qflexpress_divfive-p137.btor,23.69,506,0.87,1.66, 27 | qspiflash_dualflexpress_divthree-p046.btor,24.51,507,0.94,1.87, 28 | qspiflash_qflexpress_divfive-p139.btor,24.05,505,0.90,1.77, 29 | qspiflash_dualflexpress_divthree-p054.btor,25.12,508,0.98,1.83, 30 | qspiflash_dualflexpress_divthree-p069.btor,24.19,506,0.88,1.73, 31 | vgasim_imgfifo-p036.btor,25.18,515,1.06,2.39, 32 | qspiflash_dualflexpress_divthree-p075.btor,25.13,508,0.97,1.91, 33 | vgasim_imgfifo-p047.btor,25.42,513,0.99,2.32, 34 | qspiflash_dualflexpress_divthree-p076.btor,26.24,510,0.96,1.96, 35 | qspiflash_dualflexpress_divfive-p007.btor,23.98,507,0.89,1.75, 36 | vgasim_imgfifo-p064.btor,25.34,515,1.04,2.40, 37 | qspiflash_dualflexpress_divthree-p085.btor,26.38,510,1.01,1.97, 38 | qspiflash_dualflexpress_divfive-p016.btor,23.23,504,0.86,1.71, 39 | qspiflash_dualflexpress_divfive-p009.btor,23.95,507,0.94,1.85, 40 | vgasim_imgfifo-p066.btor,25.72,515,1.06,2.45, 41 | qspiflash_dualflexpress_divthree-p094.btor,25.80,508,0.95,1.88, 42 | vgasim_imgfifo-p070.btor,25.65,515,1.05,2.44, 43 | qspiflash_dualflexpress_divfive-p022.btor,24.56,507,0.85,1.70, 44 | qspiflash_dualflexpress_divfive-p037.btor,23.79,507,0.91,1.77, 45 | vgasim_imgfifo-p075.btor,25.62,517,1.06,2.46, 46 | qspiflash_dualflexpress_divthree-p113.btor,23.11,504,0.84,1.63, 47 | qspiflash_dualflexpress_divthree-p111.btor,25.65,512,0.99,1.94, 48 | vgasim_imgfifo-p082.btor,25.65,515,1.08,2.41, 49 | qspiflash_dualflexpress_divfive-p050.btor,23.78,505,0.89,1.76, 50 | vgasim_imgfifo-p088.btor,24.76,513,1.01,2.34, 51 | qspiflash_dualflexpress_divthree-p106.btor,30.09,515,1.09,2.13, 52 | qspiflash_dualflexpress_divthree-p121.btor,24.44,507,0.89,1.77, 53 | qspiflash_dualflexpress_divfive-p054.btor,24.73,508,0.91,1.80, 54 | vgasim_imgfifo-p089.btor,25.41,516,1.06,2.43, 55 | qspiflash_dualflexpress_divthree-p124.btor,24.82,510,0.95,1.86, 56 | qspiflash_dualflexpress_divthree-p134.btor,24.13,507,0.93,1.78, 57 | qspiflash_dualflexpress_divfive-p058.btor,24.61,507,0.94,1.85, 58 | vgasim_imgfifo-p093.btor,24.86,512,1.04,2.40, 59 | qspiflash_dualflexpress_divfive-p074.btor,23.89,504,0.91,1.77, 60 | qspiflash_dualflexpress_divfive-p079.btor,24.21,507,0.94,1.83, 61 | qspiflash_dualflexpress_divthree-p136.btor,25.10,508,0.96,1.89, 62 | vgasim_imgfifo-p099.btor,25.78,515,1.07,2.42, 63 | qspiflash_dualflexpress_divthree-p141.btor,24.71,509,0.69,1.61, 64 | vgasim_imgfifo-p105.btor,25.63,515,1.04,2.42, 65 | vgasim_imgfifo-p109.btor,25.22,513,1.00,2.31, 66 | qspiflash_dualflexpress_divfive-p092.btor,24.84,508,0.93,1.84, 67 | qspiflash_dualflexpress_divthree-p143.btor,21.20,506,0.90,1.78, 68 | qspiflash_dualflexpress_divthree-p151.btor,22.89,505,0.83,1.66, 69 | vgasim_imgfifo-p110.btor,23.76,516,1.02,2.11, 70 | qspiflash_dualflexpress_divfive-p097.btor,24.42,507,0.92,1.82, 71 | qspiflash_dualflexpress_divthree-p153.btor,22.82,506,0.85,1.33, 72 | vgasim_imgfifo-p111.btor,24.07,513,0.58,1.67, 73 | qspiflash_dualflexpress_divfive-p112.btor,24.73,507,0.93,1.83, 74 | zipversa_composecrc_prf-p00.btor,31.94,653,1.79,3.42, 75 | dspfilters_fastfir_second-p16.btor,209.15,917,,, 76 | dspfilters_fastfir_second-p10.btor,209.60,917,,, 77 | dspfilters_fastfir_second-p09.btor,211.19,917,,, 78 | dspfilters_fastfir_second-p07.btor,213.13,918,,, 79 | dspfilters_fastfir_second-p06.btor,214.32,917,,, 80 | dspfilters_fastfir_second-p11.btor,216.99,918,,, 81 | dspfilters_fastfir_second-p14.btor,216.89,917,,, 82 | dspfilters_fastfir_second-p04.btor,217.75,917,,, 83 | dspfilters_fastfir_second-p21.btor,218.04,918,,, 84 | dspfilters_fastfir_second-p18.btor,219.92,918,,, 85 | dspfilters_fastfir_second-p42.btor,199.74,917,,, 86 | dspfilters_fastfir_second-p45.btor,200.45,917,,, 87 | dspfilters_fastfir_second-p05.btor,226.51,916,,, 88 | dspfilters_fastfir_second-p25.btor,207.37,917,,, 89 | dspfilters_fastfir_second-p22.btor,209.49,916,,, 90 | dspfilters_fastfir_second-p26.btor,220.39,917,,, 91 | dspfilters_fastfir_second-p43.btor,237.72,917,,, 92 | qspiflash_dualflexpress_divfive-p126.btor,14.75,506,0.55,1.04, 93 | qspiflash_qflexpress_divfive-p038.btor,14.85,505,0.86,1.69, 94 | qspiflash_qflexpress_divfive-p048.btor,14.90,503,0.50,0.96, 95 | qspiflash_qflexpress_divfive-p017.btor,14.91,505,0.77,1.54, 96 | qspiflash_dualflexpress_divfive-p127.btor,16.23,506,0.50,0.96, 97 | qspiflash_dualflexpress_divfive-p136.btor,16.37,507,0.55,1.05, 98 | qspiflash_dualflexpress_divfive-p128.btor,17.05,507,0.90,1.78, 99 | qspiflash_qflexpress_divfive-p036.btor,18.43,504,0.50,0.99, 100 | qspiflash_dualflexpress_divthree-p164.btor,18.37,507,0.58,1.11, 101 | qspiflash_dualflexpress_divthree-p161.btor,18.90,506,0.49,0.97, 102 | qspiflash_dualflexpress_divthree-p158.btor,19.16,505,0.52,1.02, 103 | qspiflash_dualflexpress_divfive-p120.btor,19.29,508,0.57,1.08, 104 | qspiflash_dualflexpress_divfive-p116.btor,19.44,507,0.54,1.03, 105 | qspiflash_dualflexpress_divfive-p133.btor,19.74,508,0.53,0.99, 106 | qspiflash_dualflexpress_divfive-p135.btor,19.76,506,0.54,1.04, 107 | qspiflash_qflexpress_divfive-p029.btor,19.77,505,0.52,1.00, 108 | zipversa_composecrc_prf-p11.btor,20.50,655,1.19,2.15, 109 | zipversa_composecrc_prf-p17.btor,20.75,654,1.09,2.03, 110 | zipversa_composecrc_prf-p15.btor,23.81,655,1.05,1.88, 111 | zipversa_composecrc_prf-p22.btor,23.81,655,1.06,1.91, 112 | zipversa_composecrc_prf-p10.btor,24.94,697,1.17,2.13, 113 | zipversa_composecrc_prf-p03.btor,25.55,657,1.11,2.02, 114 | zipversa_composecrc_prf-p07.btor,26.17,661,0.98,1.95, 115 | -------------------------------------------------------------------------------- /include/Target/Btor/BtorIRToBtorTranslation.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // This provides registration calls for Btor to Btor IR translation. 4 | // 5 | //===----------------------------------------------------------------------===// 6 | 7 | #ifndef TARGET_BTOR_BTORIRTOBTORTRANSLATION_H 8 | #define TARGET_BTOR_BTORIRTOBTORTRANSLATION_H 9 | 10 | #include "Dialect/Btor/IR/Btor.h" 11 | 12 | #include "mlir/Dialect/Arithmetic/IR/Arithmetic.h" 13 | #include "mlir/Dialect/StandardOps/IR/Ops.h" 14 | #include "mlir/IR/Builders.h" 15 | #include "mlir/IR/BuiltinOps.h" 16 | #include "mlir/IR/OwningOpRef.h" 17 | #include "mlir/Support/LLVM.h" 18 | 19 | #include 20 | #include 21 | 22 | #include "btor2parser/btor2parser.h" 23 | 24 | using llvm::hash_value; 25 | 26 | namespace mlir { 27 | class ModuleOp; 28 | 29 | namespace btor { 30 | 31 | /// Serializes the given Btor MLIR module and creates a Btor. 32 | 33 | class Serialize { 34 | 35 | public: 36 | ///===----------------------------------------------------------------------===// 37 | /// Constructors and Destructors 38 | ///===----------------------------------------------------------------------===// 39 | 40 | Serialize(ModuleOp module, raw_ostream &output) 41 | : m_module(module), m_output(output) {} 42 | 43 | ~Serialize() {} 44 | 45 | LogicalResult translateMainFunction(); 46 | 47 | uint64_t getSort(const Type type) { 48 | assert(sortIsInCache(type)); 49 | ::llvm::hash_code code = hash_value(type); 50 | return m_sorts.at(code); 51 | } 52 | 53 | void setSortWithType(const Type type, const uint64_t id) { 54 | assert(!sortIsInCache(type)); 55 | ::llvm::hash_code code = hash_value(type); 56 | m_sorts[code] = id; 57 | assert(sortIsInCache(type)); 58 | } 59 | 60 | bool sortIsInCache(const Type type) { 61 | ::llvm::hash_code code = hash_value(type); 62 | return m_sorts.count(code) != 0; 63 | } 64 | 65 | uint64_t getOpFromCache(const Value &value) { 66 | assert(opIsInCache(value)); 67 | ::llvm::hash_code code = hash_value(value); 68 | return m_cache.at(code); 69 | } 70 | 71 | void setCacheWithOp(const Value &value, const uint64_t id) { 72 | assert(!opIsInCache(value)); 73 | ::llvm::hash_code code = hash_value(value); 74 | m_cache[code] = id; 75 | assert(opIsInCache(value)); 76 | } 77 | 78 | bool opIsInCache(const Value &value) { 79 | ::llvm::hash_code code = hash_value(value); 80 | return m_cache.count(code) != 0; 81 | } 82 | 83 | private: 84 | ModuleOp m_module; 85 | raw_ostream &m_output; 86 | uint64_t nextLine = 1; 87 | 88 | std::vector m_states; 89 | 90 | std::map<::llvm::hash_code, uint64_t> m_cache; 91 | std::map<::llvm::hash_code, uint64_t> m_sorts; 92 | 93 | void createSort(Type type); 94 | uint64_t getOrCreateSort(Type type); 95 | 96 | LogicalResult translateInitFunction(mlir::Block &initBlock); 97 | LogicalResult translateNextFunction(mlir::Block &nextBlock); 98 | LogicalResult createBtor(mlir::Operation &op, bool isInit); 99 | 100 | LogicalResult createBtorLine(btor::ConstantOp &op, bool isInit); 101 | LogicalResult createBtorLine(btor::InputOp &op, bool isInit); 102 | LogicalResult createBtorLine(btor::RedAndOp &op, bool isInit); 103 | LogicalResult createBtorLine(btor::AssertNotOp &op, bool isInit); 104 | LogicalResult createBtorLine(btor::NDStateOp &op, bool isInit); 105 | LogicalResult createBtorLine(btor::UExtOp &op, bool isInit); 106 | LogicalResult createBtorLine(btor::SExtOp &op, bool isInit); 107 | LogicalResult createBtorLine(btor::SliceOp &op, bool isInit); 108 | LogicalResult createBtorLine(btor::NotOp &op, bool isInit); 109 | LogicalResult createBtorLine(btor::IncOp &op, bool isInit); 110 | LogicalResult createBtorLine(btor::DecOp &op, bool isInit); 111 | LogicalResult createBtorLine(btor::NegOp &op, bool isInit); 112 | LogicalResult createBtorLine(btor::RedOrOp &op, bool isInit); 113 | LogicalResult createBtorLine(btor::RedXorOp &op, bool isInit); 114 | LogicalResult createBtorLine(btor::IffOp &op, bool isInit); 115 | LogicalResult createBtorLine(btor::ImpliesOp &op, bool isInit); 116 | LogicalResult createBtorLine(btor::CmpOp &op, bool isInit); 117 | LogicalResult createBtorLine(btor::AndOp &op, bool isInit); 118 | LogicalResult createBtorLine(btor::NandOp &op, bool isInit); 119 | LogicalResult createBtorLine(btor::NorOp &op, bool isInit); 120 | LogicalResult createBtorLine(btor::OrOp &op, bool isInit); 121 | LogicalResult createBtorLine(btor::XnorOp &op, bool isInit); 122 | LogicalResult createBtorLine(btor::XOrOp &op, bool isInit); 123 | LogicalResult createBtorLine(btor::RotateROp &op, bool isInit); 124 | LogicalResult createBtorLine(btor::RotateLOp &op, bool isInit); 125 | LogicalResult createBtorLine(btor::ShiftLLOp &op, bool isInit); 126 | LogicalResult createBtorLine(btor::ShiftRAOp &op, bool isInit); 127 | LogicalResult createBtorLine(btor::ShiftRLOp &op, bool isInit); 128 | LogicalResult createBtorLine(btor::ConcatOp &op, bool isInit); 129 | LogicalResult createBtorLine(btor::AddOp &op, bool isInit); 130 | LogicalResult createBtorLine(btor::MulOp &op, bool isInit); 131 | LogicalResult createBtorLine(btor::SDivOp &op, bool isInit); 132 | LogicalResult createBtorLine(btor::UDivOp &op, bool isInit); 133 | LogicalResult createBtorLine(btor::SModOp &op, bool isInit); 134 | LogicalResult createBtorLine(btor::SRemOp &op, bool isInit); 135 | LogicalResult createBtorLine(btor::URemOp &op, bool isInit); 136 | LogicalResult createBtorLine(btor::SubOp &op, bool isInit); 137 | LogicalResult createBtorLine(btor::SAddOverflowOp &op, bool isInit); 138 | LogicalResult createBtorLine(btor::UAddOverflowOp &op, bool isInit); 139 | LogicalResult createBtorLine(btor::SDivOverflowOp &op, bool isInit); 140 | LogicalResult createBtorLine(btor::SMulOverflowOp &op, bool isInit); 141 | LogicalResult createBtorLine(btor::UMulOverflowOp &op, bool isInit); 142 | LogicalResult createBtorLine(btor::SSubOverflowOp &op, bool isInit); 143 | LogicalResult createBtorLine(btor::USubOverflowOp &op, bool isInit); 144 | LogicalResult createBtorLine(btor::IteOp &op, bool isInit); 145 | LogicalResult createBtorLine(btor::ArrayOp &op, bool isInit); 146 | LogicalResult createBtorLine(btor::ConstraintOp &op, bool isInit); 147 | LogicalResult createBtorLine(btor::InitArrayOp &op, bool isInit); 148 | LogicalResult createBtorLine(btor::ReadOp &op, bool isInit); 149 | LogicalResult createBtorLine(btor::WriteOp &op, bool isInit); 150 | 151 | LogicalResult createBtorLine(mlir::BranchOp &op, bool isInit); 152 | 153 | LogicalResult buildTernaryOperation(const Value &first, const Value &second, 154 | const Value &third, const Value &res, 155 | Type type, std::string op); 156 | LogicalResult buildBinaryOperation(const Value &lhs, const Value &rhs, 157 | const Value &res, Type type, 158 | std::string op); 159 | LogicalResult buildUnaryOperation(const Value &lhs, const Value &res, 160 | Type type, std::string op); 161 | LogicalResult buildCastOperation(const Value &in, const Value &res, Type type, 162 | std::string op); 163 | }; 164 | 165 | /// Register the Btor translation 166 | void registerToBtorTranslation(); 167 | 168 | } // namespace btor 169 | } // namespace mlir 170 | 171 | #endif // TARGET_BTOR_BTORIRTOBTORTRANSLATION_H 172 | -------------------------------------------------------------------------------- /lib/Conversion/BtorToVector/BtorToVector.cpp: -------------------------------------------------------------------------------- 1 | #include "Conversion/BtorToVector/ConvertBtorToVectorPass.h" 2 | #include "Dialect/Btor/IR/Btor.h" 3 | 4 | #include "../PassDetail.h" 5 | #include "mlir/Conversion/LLVMCommon/ConversionTarget.h" 6 | #include "mlir/Conversion/LLVMCommon/VectorPattern.h" 7 | #include "mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h" 8 | #include "mlir/Pass/Pass.h" 9 | #include "mlir/Transforms/DialectConversion.h" 10 | // #include "mlir/Dialect/LLVMIR/LLVMDialect.h" 11 | 12 | using namespace mlir; 13 | using namespace mlir::btor; 14 | 15 | //===----------------------------------------------------------------------===// 16 | // Lowering Declarations 17 | //===----------------------------------------------------------------------===// 18 | 19 | struct InitArrayLowering 20 | : public ConvertOpToLLVMPattern { 21 | using ConvertOpToLLVMPattern::ConvertOpToLLVMPattern; 22 | LogicalResult 23 | matchAndRewrite(mlir::btor::InitArrayOp initArrayOp, OpAdaptor adaptor, 24 | ConversionPatternRewriter &rewriter) const override; 25 | }; 26 | 27 | struct ReadOpLowering : public ConvertOpToLLVMPattern { 28 | using ConvertOpToLLVMPattern::ConvertOpToLLVMPattern; 29 | LogicalResult 30 | matchAndRewrite(mlir::btor::ReadOp readOp, OpAdaptor adaptor, 31 | ConversionPatternRewriter &rewriter) const override; 32 | }; 33 | 34 | struct WriteOpLowering : public ConvertOpToLLVMPattern { 35 | using ConvertOpToLLVMPattern::ConvertOpToLLVMPattern; 36 | LogicalResult 37 | matchAndRewrite(mlir::btor::WriteOp writeOp, OpAdaptor adaptor, 38 | ConversionPatternRewriter &rewriter) const override; 39 | }; 40 | 41 | struct VectorInitArrayOpLowering 42 | : public ConvertOpToLLVMPattern { 43 | using ConvertOpToLLVMPattern< 44 | mlir::btor::VectorInitArrayOp>::ConvertOpToLLVMPattern; 45 | LogicalResult 46 | matchAndRewrite(mlir::btor::VectorInitArrayOp vecInitArrayOp, 47 | OpAdaptor adaptor, 48 | ConversionPatternRewriter &rewriter) const override; 49 | }; 50 | 51 | struct VectorReadOpLowering 52 | : public ConvertOpToLLVMPattern { 53 | using ConvertOpToLLVMPattern< 54 | mlir::btor::VectorReadOp>::ConvertOpToLLVMPattern; 55 | LogicalResult 56 | matchAndRewrite(mlir::btor::VectorReadOp vecReadOp, OpAdaptor adaptor, 57 | ConversionPatternRewriter &rewriter) const override; 58 | }; 59 | 60 | struct VectorWriteOpLowering 61 | : public ConvertOpToLLVMPattern { 62 | using ConvertOpToLLVMPattern< 63 | mlir::btor::VectorWriteOp>::ConvertOpToLLVMPattern; 64 | LogicalResult 65 | matchAndRewrite(mlir::btor::VectorWriteOp vecWriteOp, OpAdaptor adaptor, 66 | ConversionPatternRewriter &rewriter) const override; 67 | }; 68 | 69 | //===----------------------------------------------------------------------===// 70 | // Lowering Definitions 71 | //===----------------------------------------------------------------------===// 72 | 73 | LogicalResult 74 | InitArrayLowering::matchAndRewrite(mlir::btor::InitArrayOp initArrayOp, 75 | OpAdaptor adaptor, 76 | ConversionPatternRewriter &rewriter) const { 77 | auto arrayType = typeConverter->convertType(initArrayOp.getType()); 78 | rewriter.replaceOpWithNewOp( 79 | initArrayOp, arrayType, adaptor.init()); 80 | return success(); 81 | } 82 | 83 | LogicalResult 84 | ReadOpLowering::matchAndRewrite(mlir::btor::ReadOp readOp, OpAdaptor adaptor, 85 | ConversionPatternRewriter &rewriter) const { 86 | auto resType = typeConverter->convertType(readOp.result().getType()); 87 | rewriter.replaceOpWithNewOp( 88 | readOp, resType, adaptor.base(), adaptor.index()); 89 | return success(); 90 | } 91 | 92 | LogicalResult 93 | WriteOpLowering::matchAndRewrite(mlir::btor::WriteOp writeOp, OpAdaptor adaptor, 94 | ConversionPatternRewriter &rewriter) const { 95 | auto resType = typeConverter->convertType(writeOp.base().getType()); 96 | rewriter.replaceOpWithNewOp( 97 | writeOp, resType, adaptor.value(), adaptor.base(), adaptor.index()); 98 | return success(); 99 | } 100 | 101 | LogicalResult VectorInitArrayOpLowering::matchAndRewrite( 102 | mlir::btor::VectorInitArrayOp vecInitArrayOp, OpAdaptor adaptor, 103 | ConversionPatternRewriter &rewriter) const { 104 | rewriter.replaceOpWithNewOp( 105 | vecInitArrayOp, vecInitArrayOp.getType(), vecInitArrayOp.init()); 106 | return success(); 107 | } 108 | 109 | LogicalResult VectorReadOpLowering::matchAndRewrite( 110 | mlir::btor::VectorReadOp vecReadOp, OpAdaptor adaptor, 111 | ConversionPatternRewriter &rewriter) const { 112 | rewriter.replaceOpWithNewOp( 113 | vecReadOp, vecReadOp.result().getType(), adaptor.base(), adaptor.index()); 114 | return success(); 115 | } 116 | 117 | LogicalResult VectorWriteOpLowering::matchAndRewrite( 118 | mlir::btor::VectorWriteOp vecWriteOp, OpAdaptor adaptor, 119 | ConversionPatternRewriter &rewriter) const { 120 | rewriter.replaceOpWithNewOp( 121 | vecWriteOp, vecWriteOp.base().getType(), adaptor.value(), adaptor.base(), 122 | adaptor.index()); 123 | return success(); 124 | } 125 | 126 | //===----------------------------------------------------------------------===// 127 | // Populate Lowering Patterns 128 | //===----------------------------------------------------------------------===// 129 | 130 | void mlir::btor::populateBtorToVectorConversionPatterns( 131 | BtorToLLVMTypeConverter &converter, RewritePatternSet &patterns) { 132 | patterns.add(converter); 135 | } 136 | 137 | namespace { 138 | struct ConvertBtorToVectorPass 139 | : public ConvertBtorToVectorBase { 140 | void runOnOperation() override { 141 | RewritePatternSet patterns(&getContext()); 142 | LLVMConversionTarget target(getContext()); 143 | BtorToLLVMTypeConverter converter(&getContext()); 144 | 145 | mlir::btor::populateBtorToVectorConversionPatterns(converter, patterns); 146 | mlir::populateStdToLLVMConversionPatterns(converter, patterns); 147 | /// Configure conversion to lower out btor; Anything else is fine. 148 | // init operators 149 | target.addIllegalOp(); 150 | 151 | /// indexed operators 152 | target.addIllegalOp(); 153 | target.addIllegalOp(); 154 | 155 | target.markUnknownOpDynamicallyLegal([](Operation *) { return true; }); 156 | if (failed(applyPartialConversion(getOperation(), target, 157 | std::move(patterns)))) { 158 | signalPassFailure(); 159 | } 160 | } 161 | }; 162 | } // end anonymous namespace 163 | 164 | /// Create a pass for lowering operations the remaining `Btor` operations 165 | // to the Vector dialect for codegen. 166 | std::unique_ptr mlir::btor::createLowerToVectorPass() { 167 | return std::make_unique(); 168 | } 169 | -------------------------------------------------------------------------------- /results/seahorn/seahorn_19C_wolf_0321232002.csv: -------------------------------------------------------------------------------- 1 | base,Cpu,Mem,BMC,seahorn_total,Result 2 | qspiflash_dualflexpress_divfive-p143.btor,19.76,491,0.82,1.69,TRUE 3 | qspiflash_qflexpress_divfive-p063.btor,20.48,385,0.17,0.96,TRUE 4 | qspiflash_dualflexpress_divfive-p161.btor,21.08,419,0.20,1.02,TRUE 5 | qspiflash_qflexpress_divfive-p107.btor,21.45,486,0.40,1.21,TRUE 6 | qspiflash_qflexpress_divfive-p094.btor,21.99,489,0.45,1.28,TRUE 7 | qspiflash_dualflexpress_divfive-p154.btor,22.17,489,0.51,1.37,TRUE 8 | qspiflash_dualflexpress_divthree-p006.btor,22.44,490,0.93,1.79,TRUE 9 | qspiflash_qflexpress_divfive-p104.btor,22.55,489,0.77,1.63,TRUE 10 | qspiflash_qflexpress_divfive-p079.btor,22.78,492,0.84,1.70,TRUE 11 | qspiflash_dualflexpress_divthree-p032.btor,23.20,493,0.78,1.64,TRUE 12 | qspiflash_dualflexpress_divthree-p034.btor,23.13,492,0.76,1.60,TRUE 13 | qspiflash_qflexpress_divfive-p064.btor,23.23,488,0.87,1.71,TRUE 14 | qspiflash_dualflexpress_divfive-p164.btor,23.32,493,0.70,1.56,TRUE 15 | qspiflash_dualflexpress_divthree-p005.btor,23.24,491,1.78,2.64,TRUE 16 | qspiflash_qflexpress_divfive-p100.btor,23.75,490,0.74,1.63,TRUE 17 | qspiflash_dualflexpress_divthree-p007.btor,23.90,491,1.59,2.47,TRUE 18 | qspiflash_dualflexpress_divthree-p010.btor,24.34,493,1.36,2.27,TRUE 19 | qspiflash_dualflexpress_divthree-p012.btor,24.43,491,1.49,2.34,TRUE 20 | qspiflash_qflexpress_divfive-p067.btor,25.60,495,0.96,1.92,TRUE 21 | qspiflash_qflexpress_divfive-p113.btor,26.49,493,0.98,1.95,TRUE 22 | qspiflash_qflexpress_divfive-p075.btor,38.10,621,1.59,2.99,TRUE 23 | qspiflash_qflexpress_divfive-p121.btor,23.79,489,0.77,1.59,TRUE 24 | qspiflash_dualflexpress_divthree-p068.btor,21.79,422,0.20,0.97,TRUE 25 | qspiflash_qflexpress_divfive-p137.btor,22.28,487,0.44,1.23,TRUE 26 | qspiflash_qflexpress_divfive-p122.btor,23.15,486,0.77,1.55,TRUE 27 | qspiflash_dualflexpress_divthree-p046.btor,23.77,493,0.94,1.85,TRUE 28 | qspiflash_dualflexpress_divthree-p054.btor,23.46,492,0.52,1.40,TRUE 29 | qspiflash_qflexpress_divfive-p139.btor,22.45,488,0.42,1.21,TRUE 30 | vgasim_imgfifo-p036.btor,22.99,548,0.64,1.96,TRUE 31 | qspiflash_dualflexpress_divthree-p069.btor,23.09,492,0.54,1.43,TRUE 32 | vgasim_imgfifo-p047.btor,23.37,546,0.64,1.90,TRUE 33 | qspiflash_dualflexpress_divthree-p075.btor,23.71,495,0.77,1.66,TRUE 34 | vgasim_imgfifo-p064.btor,23.29,549,0.64,1.99,TRUE 35 | qspiflash_dualflexpress_divthree-p076.btor,24.89,497,0.98,1.96,TRUE 36 | qspiflash_dualflexpress_divfive-p007.btor,23.52,489,1.36,2.23,TRUE 37 | qspiflash_dualflexpress_divthree-p085.btor,25.21,495,1.05,2.02,TRUE 38 | qspiflash_dualflexpress_divfive-p016.btor,22.21,491,0.75,1.58,TRUE 39 | vgasim_imgfifo-p066.btor,23.60,550,0.58,1.99,TRUE 40 | vgasim_imgfifo-p070.btor,24.02,550,1.08,2.47,TRUE 41 | qspiflash_dualflexpress_divfive-p009.btor,24.39,494,2.25,3.15,TRUE 42 | qspiflash_dualflexpress_divthree-p094.btor,24.52,494,0.83,1.75,TRUE 43 | vgasim_imgfifo-p075.btor,23.76,549,0.68,2.07,TRUE 44 | qspiflash_dualflexpress_divfive-p022.btor,23.58,491,0.86,1.72,TRUE 45 | qspiflash_dualflexpress_divthree-p113.btor,21.31,420,0.21,1.01,TRUE 46 | qspiflash_dualflexpress_divfive-p037.btor,22.86,490,0.79,1.62,TRUE 47 | qspiflash_dualflexpress_divthree-p111.btor,24.45,533,0.97,1.93,TRUE 48 | vgasim_imgfifo-p082.btor,23.99,549,1.07,2.44,TRUE 49 | vgasim_imgfifo-p088.btor,22.17,428,0.22,1.56,TRUE 50 | qspiflash_dualflexpress_divfive-p050.btor,22.28,489,0.47,1.33,TRUE 51 | qspiflash_dualflexpress_divthree-p106.btor,28.20,536,1.16,2.20,TRUE 52 | qspiflash_dualflexpress_divthree-p121.btor,23.36,494,0.74,1.63,TRUE 53 | qspiflash_dualflexpress_divfive-p054.btor,23.06,492,0.49,1.36,TRUE 54 | vgasim_imgfifo-p089.btor,24.00,550,1.15,2.53,TRUE 55 | vgasim_imgfifo-p093.btor,22.94,548,0.59,1.99,TRUE 56 | qspiflash_dualflexpress_divthree-p124.btor,23.35,493,0.54,1.45,TRUE 57 | qspiflash_dualflexpress_divthree-p134.btor,22.70,491,0.52,1.35,TRUE 58 | qspiflash_dualflexpress_divfive-p058.btor,23.44,491,0.85,1.70,TRUE 59 | qspiflash_dualflexpress_divfive-p074.btor,22.79,490,0.76,1.61,TRUE 60 | vgasim_imgfifo-p099.btor,23.70,551,0.72,2.12,TRUE 61 | qspiflash_dualflexpress_divthree-p136.btor,23.57,493,0.72,1.60,TRUE 62 | qspiflash_dualflexpress_divfive-p079.btor,22.94,490,0.74,1.62,TRUE 63 | vgasim_imgfifo-p105.btor,23.71,550,0.63,2.02,TRUE 64 | vgasim_imgfifo-p109.btor,22.81,429,0.22,1.55,TRUE 65 | qspiflash_dualflexpress_divthree-p141.btor,23.70,493,0.67,1.55,TRUE 66 | qspiflash_dualflexpress_divfive-p092.btor,23.24,491,0.72,1.47,TRUE 67 | qspiflash_dualflexpress_divthree-p143.btor,16.09,491,0.86,1.74,TRUE 68 | qspiflash_dualflexpress_divfive-p112.btor,15.21,492,0.50,1.00,TRUE 69 | vgasim_imgfifo-p110.btor,17.57,548,0.46,1.80,TRUE 70 | qspiflash_dualflexpress_divthree-p153.btor,15.49,420,0.20,1.02,TRUE 71 | qspiflash_dualflexpress_divthree-p151.btor,16.76,421,0.12,0.94,TRUE 72 | vgasim_imgfifo-p111.btor,18.14,428,0.11,0.86,TRUE 73 | qspiflash_dualflexpress_divfive-p097.btor,20.88,491,0.81,1.71,TRUE 74 | zipversa_composecrc_prf-p00.btor,24.77,537,0.75,2.36,TRUE 75 | dspfilters_fastfir_second-p05.btor,216.16,2364,10.14,16.04,TRUE 76 | dspfilters_fastfir_second-p06.btor,216.61,2363,10.48,16.39,TRUE 77 | dspfilters_fastfir_second-p11.btor,216.75,2360,9.89,15.82,TRUE 78 | dspfilters_fastfir_second-p21.btor,221.33,2360,12.50,20.96,TRUE 79 | dspfilters_fastfir_second-p18.btor,223.53,2364,11.55,21.01,TRUE 80 | dspfilters_fastfir_second-p25.btor,206.71,2360,10.97,17.02,TRUE 81 | dspfilters_fastfir_second-p42.btor,208.35,2359,9.99,16.01,TRUE 82 | dspfilters_fastfir_second-p16.btor,243.07,2361,10.65,16.58,TRUE 83 | dspfilters_fastfir_second-p04.btor,251.88,2750,51.00,56.92,TRUE 84 | dspfilters_fastfir_second-p07.btor,265.23,2752,52.82,58.85,TRUE 85 | dspfilters_fastfir_second-p09.btor,197.49,573,,, 86 | dspfilters_fastfir_second-p10.btor,227.00,575,,, 87 | dspfilters_fastfir_second-p14.btor,196.36,573,,, 88 | dspfilters_fastfir_second-p22.btor,188.17,576,,, 89 | dspfilters_fastfir_second-p26.btor,189.84,572,,, 90 | dspfilters_fastfir_second-p43.btor,201.72,574,,, 91 | dspfilters_fastfir_second-p45.btor,189.56,574,,, 92 | qspiflash_dualflexpress_divfive-p136.btor,13.80,492,0.42,0.92,TRUE 93 | qspiflash_dualflexpress_divfive-p116.btor,13.98,490,0.29,0.90,TRUE 94 | qspiflash_dualflexpress_divfive-p128.btor,14.07,491,0.75,1.59,TRUE 95 | qspiflash_dualflexpress_divthree-p158.btor,14.22,492,0.55,1.04,TRUE 96 | qspiflash_qflexpress_divfive-p017.btor,14.51,455,0.43,1.15,TRUE 97 | qspiflash_dualflexpress_divfive-p133.btor,14.63,490,0.42,0.95,TRUE 98 | qspiflash_dualflexpress_divthree-p164.btor,14.64,493,0.61,1.41,TRUE 99 | qspiflash_dualflexpress_divthree-p161.btor,15.87,421,0.11,0.60,TRUE 100 | qspiflash_qflexpress_divfive-p036.btor,17.42,487,0.43,0.89,TRUE 101 | qspiflash_qflexpress_divfive-p029.btor,18.07,489,0.45,0.93,TRUE 102 | qspiflash_qflexpress_divfive-p038.btor,18.19,487,0.45,0.94,TRUE 103 | qspiflash_qflexpress_divfive-p048.btor,18.24,455,0.42,0.91,TRUE 104 | qspiflash_dualflexpress_divfive-p126.btor,18.61,491,0.29,0.79,TRUE 105 | zipversa_composecrc_prf-p22.btor,18.59,646,1.06,1.99,TRUE 106 | qspiflash_dualflexpress_divfive-p127.btor,18.70,420,0.10,0.55,TRUE 107 | qspiflash_dualflexpress_divfive-p135.btor,18.68,491,0.28,0.77,TRUE 108 | zipversa_composecrc_prf-p11.btor,18.90,649,0.76,1.71,TRUE 109 | qspiflash_dualflexpress_divfive-p120.btor,19.37,495,0.42,0.92,TRUE 110 | zipversa_composecrc_prf-p17.btor,22.28,651,0.87,1.73,TRUE 111 | zipversa_composecrc_prf-p15.btor,22.59,648,0.83,1.69,TRUE 112 | zipversa_composecrc_prf-p07.btor,23.61,646,0.87,1.81,TRUE 113 | zipversa_composecrc_prf-p03.btor,22.22,375,,, 114 | zipversa_composecrc_prf-p10.btor,22.40,377,,, 115 | -------------------------------------------------------------------------------- /lib/Conversion/BtorNDToLLVM/BtorNDToLLVM.cpp: -------------------------------------------------------------------------------- 1 | #include "Conversion/BtorNDToLLVM/ConvertBtorNDToLLVMPass.h" 2 | #include "Dialect/Btor/IR/Btor.h" 3 | 4 | #include "../PassDetail.h" 5 | #include "mlir/Conversion/LLVMCommon/ConversionTarget.h" 6 | #include "mlir/Conversion/LLVMCommon/VectorPattern.h" 7 | #include "mlir/Dialect/LLVMIR/LLVMDialect.h" 8 | 9 | #include 10 | 11 | using namespace mlir; 12 | 13 | #define PASS_NAME "convert-btornd-to-llvm" 14 | 15 | namespace { 16 | 17 | //===----------------------------------------------------------------------===// 18 | // Lowering Declarations 19 | //===----------------------------------------------------------------------===// 20 | 21 | struct NDStateOpLowering : public ConvertOpToLLVMPattern { 22 | using ConvertOpToLLVMPattern::ConvertOpToLLVMPattern; 23 | LogicalResult 24 | matchAndRewrite(btor::NDStateOp op, OpAdaptor adaptor, 25 | ConversionPatternRewriter &rewriter) const override; 26 | }; 27 | 28 | struct InputOpLowering : public ConvertOpToLLVMPattern { 29 | using ConvertOpToLLVMPattern::ConvertOpToLLVMPattern; 30 | LogicalResult 31 | matchAndRewrite(btor::InputOp op, OpAdaptor adaptor, 32 | ConversionPatternRewriter &rewriter) const override; 33 | }; 34 | 35 | btor::BitVecType getBVType(Type opType) { 36 | return opType.dyn_cast(); 37 | } 38 | 39 | template 40 | std::string createNDFunctionHelper(Op op, std::string suffix, mlir::ConversionPatternRewriter &rewriter) { 41 | auto opType = getBVType(op.result().getType()); 42 | auto functionType = rewriter.getIntegerType(8); 43 | // Insert the `havoc` declaration if necessary. 44 | std::string havoc; 45 | havoc.append("nd_bv"); 46 | auto bvWidth = opType.getWidth(); 47 | if (bvWidth <= 8) { 48 | havoc.append(std::to_string(8)); 49 | } else if (bvWidth <= 16) { 50 | havoc.append(std::to_string(16)); 51 | functionType = rewriter.getIntegerType(16); 52 | } else if (bvWidth <= 32) { 53 | havoc.append(std::to_string(32)); 54 | functionType = rewriter.getIntegerType(32); 55 | } else if (bvWidth <= 64) { 56 | havoc.append(std::to_string(64)); 57 | functionType = rewriter.getIntegerType(64); 58 | } else if (bvWidth <= 128) { 59 | havoc.append(std::to_string(128)); 60 | functionType = rewriter.getIntegerType(128); 61 | } else { 62 | havoc.append(std::to_string(bvWidth)); 63 | functionType = rewriter.getIntegerType(bvWidth); 64 | } 65 | havoc.append(suffix); 66 | havoc.append(std::to_string(op.idAttr().getInt())); 67 | return havoc; 68 | } 69 | 70 | template 71 | IntegerType createFunctionTypeHelper(Op op, mlir::ConversionPatternRewriter &rewriter) { 72 | mlir::IntegerType functionType; 73 | 74 | auto opType = getBVType(op.result().getType()); 75 | auto bvWidth = opType.getWidth(); 76 | 77 | if (bvWidth <= 8) { 78 | functionType = rewriter.getIntegerType(8); 79 | } else if (bvWidth <= 16) { 80 | functionType = rewriter.getIntegerType(16); 81 | } else if (bvWidth <= 32) { 82 | functionType = rewriter.getIntegerType(32); 83 | } else if (bvWidth <= 64) { 84 | functionType = rewriter.getIntegerType(64); 85 | } else if (bvWidth <= 128) { 86 | functionType = rewriter.getIntegerType(128); 87 | } else { 88 | functionType = rewriter.getIntegerType(bvWidth); 89 | } 90 | return functionType; 91 | } 92 | 93 | template 94 | void createPrintFunctionHelper( 95 | Op op, const Value ndValue, 96 | const std::string printHelper, 97 | mlir::ConversionPatternRewriter &rewriter, 98 | ModuleOp module, 99 | Type resultType) { 100 | auto printFunc = module.lookupSymbol(printHelper); 101 | auto i64Type = rewriter.getI64Type(); 102 | if (!printFunc) { 103 | OpBuilder::InsertionGuard printerGuard(rewriter); 104 | rewriter.setInsertionPointToStart(module.getBody()); 105 | auto printFuncTy = LLVM::LLVMFunctionType::get( 106 | LLVM::LLVMVoidType::get(rewriter.getContext()), 107 | {i64Type, i64Type, i64Type}); 108 | printFunc = rewriter.create( 109 | rewriter.getUnknownLoc(), printHelper, printFuncTy); 110 | } 111 | Value ndValueWidth = rewriter.create( 112 | op.getLoc(), resultType, 113 | rewriter.getIntegerAttr(resultType, resultType.getIntOrFloatBitWidth())); 114 | Value zextNDWidth = rewriter.create(op.getLoc(), i64Type, ndValueWidth); 115 | Value ndValueId = rewriter.create( 116 | op.getLoc(), rewriter.getI64Type(), op.idAttr()); 117 | // TODO: We need to handle values with bitwidth > 64 118 | auto needsExt = ndValue.getType().getIntOrFloatBitWidth() <= 64; 119 | if (needsExt) { 120 | Value zextNDValue = rewriter.create(op.getLoc(), i64Type, ndValue); 121 | rewriter.create( 122 | op.getLoc(), 123 | TypeRange({}), 124 | printHelper, 125 | ValueRange({ndValueId, zextNDValue, zextNDWidth})); 126 | return; 127 | } 128 | // Value truncNDValue = rewriter.create(op.getLoc(), 129 | // TypeRange({i64Type}), ndValue); 130 | // rewriter.create( 131 | // op.getLoc(), 132 | // TypeRange({}), 133 | // printHelper, 134 | // ValueRange({ndValueId, truncNDValue, zextNDWidth})); 135 | // return; 136 | } 137 | } // end anonymous namespace 138 | 139 | //===----------------------------------------------------------------------===// 140 | // NDStateOpLowering 141 | //===----------------------------------------------------------------------===// 142 | LogicalResult 143 | NDStateOpLowering::matchAndRewrite(btor::NDStateOp op, OpAdaptor adaptor, 144 | ConversionPatternRewriter &rewriter) const { 145 | auto opType = typeConverter->convertType(op.result().getType()); 146 | auto module = op->getParentOfType(); 147 | // op.result().getType().getIntOrFloatBitWidth 148 | // create the nd function of name: nd_bvX_stateY 149 | std::string havoc = createNDFunctionHelper(op, std::string("_st"), rewriter); 150 | auto havocFunc = module.lookupSymbol(havoc); 151 | if (!havocFunc) { 152 | OpBuilder::InsertionGuard guard(rewriter); 153 | rewriter.setInsertionPointToStart(module.getBody()); 154 | auto havocFuncTy = 155 | LLVM::LLVMFunctionType::get(createFunctionTypeHelper(op, rewriter), {}); 156 | havocFunc = rewriter.create( 157 | rewriter.getUnknownLoc(), havoc, havocFuncTy); 158 | } 159 | Value callND = rewriter.create(op.getLoc(), havocFunc, llvm::None).getResult(0); 160 | // add helper function for printing 161 | std::string printHelper = "btor2mlir_print_state_num"; 162 | createPrintFunctionHelper(op, callND, printHelper, rewriter, module, opType); 163 | rewriter.replaceOpWithNewOp(op, TypeRange({opType}), callND); 164 | return success(); 165 | } 166 | 167 | //===----------------------------------------------------------------------===// 168 | // InputOpLowering 169 | //===----------------------------------------------------------------------===// 170 | LogicalResult 171 | InputOpLowering::matchAndRewrite(btor::InputOp op, OpAdaptor adaptor, 172 | ConversionPatternRewriter &rewriter) const { 173 | auto opType = typeConverter->convertType(op.result().getType()); 174 | auto module = op->getParentOfType(); 175 | // create the nd function of name: nd_bvX_inputY 176 | std::string havoc = createNDFunctionHelper(op, std::string("_in"), rewriter); 177 | auto havocFunc = module.lookupSymbol(havoc); 178 | if (!havocFunc) { 179 | OpBuilder::InsertionGuard guard(rewriter); 180 | rewriter.setInsertionPointToStart(module.getBody()); 181 | auto havocFuncTy = 182 | LLVM::LLVMFunctionType::get(createFunctionTypeHelper(op, rewriter), {}); 183 | havocFunc = rewriter.create( 184 | rewriter.getUnknownLoc(), havoc, havocFuncTy); 185 | } 186 | Value callND = rewriter.create(op.getLoc(), havocFunc, llvm::None).getResult(0); 187 | // add helper function for printing 188 | std::string printHelper = "btor2mlir_print_input_num"; 189 | createPrintFunctionHelper(op, callND, printHelper, rewriter, module, opType); 190 | rewriter.replaceOpWithNewOp(op, TypeRange({opType}), callND); 191 | return success(); 192 | } 193 | 194 | //===----------------------------------------------------------------------===// 195 | // Pass Definition 196 | //===----------------------------------------------------------------------===// 197 | 198 | namespace { 199 | 200 | struct BtorNDToLLVMLoweringPass 201 | : public ConvertBtorNDToLLVMBase { 202 | 203 | BtorNDToLLVMLoweringPass() = default; 204 | 205 | void getDependentDialects(DialectRegistry ®istry) const override { 206 | registry.insert(); 207 | } 208 | StringRef getArgument() const final { return PASS_NAME; } 209 | void runOnOperation() override; 210 | }; 211 | } // end anonymous namespace 212 | 213 | void BtorNDToLLVMLoweringPass::runOnOperation() { 214 | LLVMConversionTarget target(getContext()); 215 | RewritePatternSet patterns(&getContext()); 216 | BtorToLLVMTypeConverter converter(&getContext()); 217 | 218 | mlir::btor::populateBTORNDTOLLVMConversionPatterns(converter, patterns); 219 | 220 | target.addIllegalOp(); 221 | 222 | if (failed(applyPartialConversion(getOperation(), target, 223 | std::move(patterns)))) { 224 | signalPassFailure(); 225 | } 226 | } 227 | 228 | //===----------------------------------------------------------------------===// 229 | // Populate Lowering Patterns 230 | //===----------------------------------------------------------------------===// 231 | 232 | void mlir::btor::populateBTORNDTOLLVMConversionPatterns( 233 | BtorToLLVMTypeConverter &converter, RewritePatternSet &patterns) { 234 | patterns.add(converter); 235 | } 236 | 237 | /// Create a pass for lowering operations the remaining `Btor` operations 238 | // to the LLVM dialect for codegen. 239 | std::unique_ptr mlir::btor::createLowerBtorNDToLLVMPass() { 240 | return std::make_unique(); 241 | } 242 | --------------------------------------------------------------------------------