声明在其范围之外仍然有效的符号

发布于 2024-12-03 04:49:03 字数 298 浏览 2 评论 0原文

Z3 2.x 具有符号声明不会弹出的功能(好吧,可能更确切地说是错误),例如 Z3 2.x 接受以下代码:

(push)
(declare-fun x () Int)
; Assumptions made in this scope will be popped correctly
(pop)
(assert (= x x))

Z3 3.x 不再接受此代码(“未知常量”) 。

有没有办法恢复旧的行为?或者另一种方式如何在范围内声明符号,使得声明(并且只有声明,而不是假设)是全局的,即不弹出?

Z3 2.x had the feature (well, probably rather the bug) that symbol declarations were not popped away, e.g. the following code is accepted by Z3 2.x:

(push)
(declare-fun x () Int)
; Assumptions made in this scope will be popped correctly
(pop)
(assert (= x x))

Z3 3.x no longer accepts this code ("unknown constant").

Is there a way to restore the old behaviour? Or another way how one could declare symbols inside scopes such that the declaration (and only the declaration, not the assumptions) is global, i.e. not popped?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

剩余の解释 2024-12-10 04:49:03

是的,在 Z3 2.x 中所有声明都是全局的。我们在 Z3 3.x 中更改了此行为,因为 SMT-LIB 2.0 标准规定所有声明都应限定范围。
您可以使用选项 :global-decls 恢复旧的行为。

(set-option :global-decls true)
(push)
(declare-fun x () Int)
(pop)
(assert (= x x))

Yes, in Z3 2.x all declarations were global. We changed this behavior in Z3 3.x because the SMT-LIB 2.0 standard states that all declarations should be scoped.
You can restore the old behavior using the option :global-decls.

(set-option :global-decls true)
(push)
(declare-fun x () Int)
(pop)
(assert (= x x))
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文