【问题标题】:Z3 / SMTLIB2 support for `distinct`Z3 / SMTLIB2 支持 `distinct`
【发布时间】:2013-07-17 01:08:22
【问题描述】:

我一直在使用 (ML) z3 绑定和 API 函数

val mk_distinct : context -> ast array -> ast

多年来一直忠实地服务。我现在正在尝试切换 到 SMTLIB2 接口,但我发现 distinct 命令 是unsupported。例如查询:

(declare-fun x () Int)
(declare-fun y () Int)
(distinct x y)
(assert (= x y))
(check-sat)

产生响应:

unsupported
; distinct  
sat

在网络演示中。有一些解决方法吗?

谢谢!

兰吉特。

【问题讨论】:

  • 如果您回到这里,您应该将答案标记为已接受。

标签: z3 smt


【解决方案1】:

您应该使用(assert (distinct x y)) 而不是(distinct x y)。 这是更新示例的链接:http://rise4fun.com/Z3/uVrX

【讨论】:

  • 太棒了!我假设这是符合 SMTLIB2 的顺便说一句?谢谢!
  • 是的,它是标准的一部分。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-10-23
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多