如果使用不适用的策略,Z3行为?

如果使用不适用的策略,Z3行为?,z3,Z3,如果采用了不适合具体问题的策略,那么Z3的总体行为是什么?例如: (declare-fun x () Real) (declare-fun y () Real) (assert (= x (* y y))) (check-sat-using qflia) 此特定示例返回sat。我对此感到惊讶,因为问题不在QFLIA中。我本以为会出现错误,或者未知 即使您不知道正在应用的策略是否确实适用于特定问题实例,应用策略是否安全?通过SMT-LIB 2 API发布(帮助策略)提供了大量关于不同内置策略及其

如果采用了不适合具体问题的策略,那么Z3的总体行为是什么?例如:

(declare-fun x () Real)
(declare-fun y () Real)
(assert (= x (* y y)))
(check-sat-using qflia)
此特定示例返回
sat
。我对此感到惊讶,因为问题不在
QFLIA
中。我本以为会出现错误,或者
未知

即使您不知道正在应用的策略是否确实适用于特定问题实例,应用策略是否安全?

通过SMT-LIB 2 API发布
(帮助策略)
提供了大量关于不同内置策略及其支持选项的信息。在那里的某个地方,你会发现:

- qflia builtin strategy for solving QF_LIA problems.
    add_bound_lower (rational) (default: -2) lower bound to be added to unbounded variables.
    add_bound_upper (rational) (default: 2) upper bound to be added to unbounded variables.
    ...
    fail_if_inconclusive (bool) (default: true) fail if found unsat (sat) for under (over) approximated goal.
这里有一个有趣的参数是
fail\u if\u inconclusive
。据我所知,此参数意味着,当使用欠近似值(如
添加绑定的
)时,
unsat
结果将转换为
未知
。事实上,当使用
add_bounds
时,似乎不可能得到
unsat
结果

我不确定这一点,但似乎将
qflia
策略应用于不在
qflia
中的目标也可能被视为欠近似。这比使用
add bounds
时更不明确,因为真正微不足道的unsat目标确实会使用qflia返回
unsat
,即使它们在
qflia
之外。例如,这将返回
unsat

(declare-fun x () Real)
(assert (distinct x x))
(assert (= (* x x) 2.0))
(check-sat-using (using-params qflia :fail_if_inconclusive true))
我猜测,这个令人惊讶的结果背后的原因可能是
(distinct x x)
足以使整个目标在预处理步骤中无法满足

总的来说,策略API的工作原理如下:如果策略包含对目标的过度或过低近似,则可能通过使用看似不合适的策略获得有用的结果。如果目标由于策略和目标之间的不匹配而变得不成功或未通过sat,那么Z3将失败(返回未知)。

通过SMT-LIB 2 API发布
(帮助策略)
提供了大量关于不同内置策略及其支持选项的信息。在那里的某个地方,你会发现:

- qflia builtin strategy for solving QF_LIA problems.
    add_bound_lower (rational) (default: -2) lower bound to be added to unbounded variables.
    add_bound_upper (rational) (default: 2) upper bound to be added to unbounded variables.
    ...
    fail_if_inconclusive (bool) (default: true) fail if found unsat (sat) for under (over) approximated goal.
这里有一个有趣的参数是
fail\u if\u inconclusive
。据我所知,此参数意味着,当使用欠近似值(如
添加绑定的
)时,
unsat
结果将转换为
未知
。事实上,当使用
add_bounds
时,似乎不可能得到
unsat
结果

我不确定这一点,但似乎将
qflia
策略应用于不在
qflia
中的目标也可能被视为欠近似。这比使用
add bounds
时更不明确,因为真正微不足道的unsat目标确实会使用qflia返回
unsat
,即使它们在
qflia
之外。例如,这将返回
unsat

(declare-fun x () Real)
(assert (distinct x x))
(assert (= (* x x) 2.0))
(check-sat-using (using-params qflia :fail_if_inconclusive true))
我猜测,这个令人惊讶的结果背后的原因可能是
(distinct x x)
足以使整个目标在预处理步骤中无法满足

总的来说,策略API的工作原理如下:如果策略包含对目标的过度或过低近似,则可能通过使用看似不合适的策略获得有用的结果。如果由于战术和目标之间的不匹配而导致目标未被设定或被设定,那么Z3将失败(返回未知)