English 中文(简体)
MAX-SAT使用Z3的问题
原标题:Issues with utilizing Z3 for MAX-SAT
  • 时间:2012-05-21 23:48:40
  •  标签:
  • z3

我对MAX-SAT感兴趣,希望Z3能有这样的内在特征。 近期是否有计划这样做?

在没有上述情况的情况下, 我尝试了使用命令行的“ 最大值” 应用程序。 不幸的是, 我每次做“ 文件名 ” ( filename.z3) exec.sh, 我总是会得到以下回应 : “ 检查硬性限制是否可作比较... 结果: 0 ” 。 我做错什么了? 我向你保证, 这个回应似乎与文件的实际内容完全无关 。

最后,最大值示例中的评论没有明确说明如何将限制标记为硬性或软性。 硬性约束应该是一种公式, 之前是: 公式, 之前是软性约束, 之前是: 假设。 因此, 将“ (Asstrat( & gt; x 0)) ” 标记为软性, 我们究竟把“ 假设” 写在哪里? (我读过关于硬性和软性限制的询问, 但问题/ 答复似乎更多地放在找到不可满足的核心上, 而不是“ 最大可满足的核心 ” 。 )

问题回答

Z3 分布区的 MaxSAT 示例展示了如何使用 Z3 API 执行两个 MaxSAT 算法 。 示例中仍然使用旧的( dispreced) API 来表示限制, 但它可以很容易地修改来使用新的求解器 API。 示例应用程序读SMT 1.0 文件。 但是, MaxSAT 函数可以在使用 CPI 创建的公式上使用。 脚本假设 < code > : assomption 字段是软性限制, 并且 < code> : forula 字段是一个硬性限制 。 这里举个小例子, 这里 < code> (> x) < / codead >, < codead > (y) < y) < y) < code; < code; < code; < y > (y) < y) < code > max. remax.

(benchmark ex
  :extrafuns ((x Int))
  :extrafuns ((y Int))
  ;; Soft Constraints
  :assumption (> x 0)
  :assumption (> y 0)
  :assumption (< x y)
  :assumption (> x (- y 1))
  :formula 
  (and 
  ;; Hard Constraints
  (> (+ x y) 0)
  (< (- x y) 100)
))

尽管如此,我们并没有计划在Z3 API中直接支持MaxSAT。 在未来版本中,我们可以将MaxSAT的例子移植到其他API(.NET, Python 和 C++ ) 。





相关问题
Are Int and Real somehow compatible in SMT-LIB?

The equality operator in SMT-LIB generally requires, unsurprisingly, that its operands be of the same type. For example, this is an error: (set-logic QF_LIRA) (declare-fun a () Bool) (declare-fun b () ...

Z3: Extracting existential model-values

I m playing around with Z3 s QBVF solver, and wondering if it s possible to extract values from an existential assertion. To wit, let s say I have the following: (assert (exists ((x (_ BitVec 16))) (...

Can Z3 be used to reason about substrings?

I am trying to use Z3 to reason about substrings, and have come across some non-intuitive behavior. Z3 returns sat when asked to determine if xy appears within xy , but it returns unknown when ...

Labeling Z3 scopes and popping back to a specific one

Is it possible to label Z3 scopes (SMTLib2 syntax) and to then pop back to a specific one? For example: (push foo) ; ... (push) ; ... (pop foo) ; pops two scopes I know that I can pop two scopes ...

Has anyone tried proving Z3 with Z3 itself?

Has anyone tried proving Z3 with Z3 itself? Is it even possible, to prove that Z3 is correct, using Z3? More theoretical, is it possible to prove that tool X is correct, using X itself?

Which statistics indicate an efficient run of Z3?

The SMTLib2 directive (get-info all-statistics) displays several numbers, e.g. num. conflicts: 4 num. propagations: 0 (binary: 0) num. qa. inst: 23 In order to test different ...

Mismatched DLL versions?

I am trying to use the Z3 SMT solver for my projects. However it seems there is a mismatch of the Visual Studio versions, which caused my troubles. My Visual Studio 2008 reports that The ...

热门标签