首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >尝试rise4fun / z3 / tutorial / strategies中的示例

尝试rise4fun / z3 / tutorial / strategies中的示例
EN

Stack Overflow用户
提问于 2018-08-08 00:47:30
回答 1查看 148关注 0票数 1

来自rise4ful-site的一些示例:

代码语言:javascript
复制
(declare-const x Int)
(declare-const y Int)
(declare-const z Int)
(declare-const a Int)        ;  this is added

(assert (= a 3 ))            ; this is added:  a := 3
(assert (< 0 x  10))         ; rewritten, but same constraint
(assert (< 0 y  10))
(assert (< 0 z  10))

(assert (= (+ (* 3 y) (* 2 x)) z))        ; plain function from rise4fun
;(assert (= (+ (* a y) (* 2 x)) z))       ; here literal 3 is replaced by a

(check-sat-using (then (using-params simplify :arith-lhs true :som true)
                       normalize-bounds
                       lia2pb
                       pb2bv
                       bit-blast
                       sat))
(get-model)
(get-info :version)

当我注释rise4fun中的普通函数并取消注释我的函数时,求解器将无法生成结果并返回'unknown‘(已尝试使用4.8.0)。求解器或某个预处理器是否足够聪明,可以看到'a‘只是一个固定值为3的常量?

EN

回答 1

Stack Overflow用户

发布于 2018-08-08 03:05:09

没错,simplify策略不够智能,无法传播值,因为它通常代价太高。但是,ctx-simplifypropagate-values可以完成这项工作。例如:

代码语言:javascript
复制
(check-sat-using (then (using-params simplify :arith-lhs true :som true)
                       propagate-values
                       normalize-bounds
                       lia2pb
                       pb2bv
                       bit-blast
                       sat))
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51731759

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档