AI Decision System
Replayable, offline-verifiable records for AI-assisted go/no-go decisions: experiment promotions, typed model answers and human-approved actions.
翻译准备中
Solve satisfiability modulo theories (SMT) problems using the bundled OpenSMT solver, described in Hyvärinen, Marescotti, Alt and Sharygina (2016) <doi:10.1007/978-3-319-40970-2_35>. Problems are writ
翻译准备中
开发工具C++ · RGitHub @pedrobtz在线运营者未确认
试用过了吗? 点一下就好,无需登录。
尚未检测到更新。GitHub 发布版本后会显示在这里。
个人 GitHub 账号下公开仓库的所有者可以登录并验证所有权,自行管理介绍,无需管理员批准。
登录并生成验证文件,在 30 分钟内将其提交到此仓库的默认分支。其他分支或分叉仓库中的文件无效。然后在下方检查文件,即可无需管理员批准直接管理项目。请保留文件以维持管理权限。
如需登录,将前往登录页面。登录后请回到此处,再次点击所选的验证按钮。
在项目文件夹中运行 /nomorevibe verify,即可验证所有权并自行管理介绍。
一分钟完成验证Solve satisfiability modulo theories (SMT) problems using the bundled OpenSMT solver, described in Hyvärinen, Marescotti, Alt and Sharygina (2016) <doi:10.1007/978-3-319-40970-2_35>. Problems are written in the SMT-LIB standard language and answers come back as R values, with model values carrying the solver's exact rational alongside the double. Supported theories include uninterpreted functions, linear integer and real arithmetic and their combinations, difference logic, and arrays. The solver
翻译准备中
取自仓库 README
正在加载完整 README。 以下为已保存的摘录。
An SMT solver in R. zusmt bundles OpenSMT
and exposes it through a small R interface: you write problems in SMT-LIB2 and get answers back as R
values. There is no separate solver to install and nothing to configure — the solver is compiled into
the package.
Building from source needs a C++20 compiler and GMP with its C++ bindings
(libgmp-dev on Debian and Ubuntu, gmp-devel on Fedora, brew install gmp on macOS; Rtools
supplies it on Windows).
Three people need distinct meeting slots between 9 and 17, Alice before Bob, and Carol two hours
after Bob:查看完整 README ↗An SMT solver in R. zusmt bundles OpenSMT and exposes it through a small R interface: you write problems in SMT-LIB2 and get answers back as R values. There is no separate solver to install and nothing to configure — the solver is compiled into the package.
install.packages("zusmt")
Or the development version:
# install.packages("pak")
pak::pak("pedrobtz/zusmt")
Building from source needs a C++20 compiler and GMP with its C++ bindings
(libgmp-dev on Debian and Ubuntu, gmp-devel on Fedora, brew install gmp on macOS; Rtools
supplies it on Windows).
Three people need distinct meeting slots between 9 and 17, Alice before Bob, and Carol two hours after Bob:
library(zusmt)
s <- smt_solver("QF_LIA")
smt_assert(s, "
(declare-const alice Int)
(declare-const bob Int)
(declare-const carol Int)
(assert (and (>= alice 9) (<= alice 17)))
(assert (and (>= bob 9) (<= bob 17)))
(assert (and (>= carol 9) (<= carol 17)))
(assert (distinct alice bob carol))
(assert (< alice bob))
(assert (= carol (+ bob 2)))
")
smt_check(s)
#> [1] "sat"
smt_model(s)
#> $alice
#> [1] 9
#> $bob
#> [1] 10
#> $carol
#> [1] 12
When a problem has no solution, you are told so rather than given a wrong answer. 2x = 3 has no
integer solution:
u <- smt_solver("QF_LIA")
smt_assert(u, "(declare-const x Int) (assert (= (* 2 x) 3))")
smt_check(u)
#> [1] "unsat"
Solvers work in rationals, and not every rational is a double. Model values carry the solver's exact
answer alongside the numeric one, so you can compute with the double and still see what was meant:
r <- smt_solver("QF_LRA")
smt_assert(r, "(declare-const third Real) (assert (= (* 3.0 third) 1.0))")
smt_check(r)
#> [1] "sat"
value <- smt_model(r)$third
value
#> [1] 0.3333333
attr(value, "exact")
#> [1] "1/3"
smt_logics()
#> [1] "QF_UF" "QF_LIA" "QF_LRA" "QF_UFLIA" "QF_UFLRA" "QF_IDL" "QF_RDL"
#> [8] "QF_AX"
Uninterpreted functions, linear integer and real arithmetic and their combinations, difference logic,
and arrays. smt_assert() accepts any SMT-LIB2 command, not only assert — push, pop,
declarations and options all work, so a script written for another solver usually runs unchanged.
A long search can be interrupted: Ctrl-C stops it and raises an R condition, rather than leaving
the session wedged in the solver.
OpenSMT v2.9.2, under src/opensmt/, imported by tools/vendor.sh and recorded in
tools/vendor/manifest.tsv. Both zusmt and OpenSMT are MIT licensed; see LICENSE.note for the
bundled copyright notices. The vendored sources carry a small set of patches, applied mechanically by
tools/patches.sh, so that the solver writes to R's console rather than to stdout, raises exceptions
instead of calling exit(), and stops when you interrupt it.