简体   繁体   English

smtlib 是否支持一流的功能?

[英]does smtlib support first class functions?

Say for modeling the haskell map function, which takes in a "mapper" function that is applied to all elements of a list.假设对 haskell map函数进行建模,该函数接受一个应用于列表所有元素的“映射器”函数。 How can I declare map in smtlib?如何在 smtlib 中声明map

No;不; SMTLib is essentially a first-order theory; SMTLib 本质上是一阶理论; higher order functions are simply not supported.根本不支持高阶函数。

Z3, however, allows mapping functions over arrays, with the (_ map f) extension.然而,Z3 允许在数组上映射函数,扩展名为(_ map f) See https://rise4fun.com/Z3/tutorial/guide , search for "Mapping Functions on Arrays."请参阅https://rise4fun.com/Z3/tutorial/guide ,搜索“数组上的映射函数”。 This doesn't give you arbitrary higher-order functions, but can be used to simulate those that operate on SMTLib arrays.这不会为您提供任意的高阶函数,但可用于模拟对 SMTLib 数组进行操作的函数。

If you do intend to reason about higher-order functions, then SMTLib is arguably the wrong logic for you.如果您确实打算对高阶函数进行推理,那么 SMTLib 可以说是错误的逻辑。 Use of a more traditional theorem prover like HOL/Isabelle, or modern incarnations in Agda/Coq would be more suitable.使用更传统的定理证明器(如 HOL/Isabelle)或 Agda/Coq 中的现代化身会更合适。 You can also take a look at Lean, which has a good compromise of features and automation.您还可以看看精益,它在功能和自动化之间取得了很好的折衷。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM