【问题标题】:Setting tactic option in z3在 z3 中设置策略选项
【发布时间】:2012-11-05 17:20:20
【问题描述】:

在使用 z3 解决 SMT2 文件并应用策略(例如,“(apply qfbv)”)时,如何为该策略设置选项?例如,QFBV 有一个选项“cache-all”,默认设置为 false。如何使用 SMT2 文件将其设置为 true?或者这不能使用 SMT2 语言实现?

【问题讨论】:

    标签: z3


    【解决方案1】:

    您可以使用组合符using-params。组合子! 是using-params 的简写。 这是一个使用策略simplify 的小例子(在线试用:http://rise4fun.com/Z3/JaZ)。

    (declare-const x Int)
    (declare-const y Int)
    
    (assert (= (+ x 1) (+ y 3)))
    
    
    (apply simplify)
    (echo ">>>> Using arith-lhs := True, and eq2ineq := True")
    (apply (using-params simplify :arith-lhs true :eq2ineq true))
    ;; ! is a shorthand for using-params
    (apply (! simplify :arith-lhs true :eq2ineq true))
    

    【讨论】:

      【解决方案2】:

      您可以使用using-params 组合符。在Z3 SMT online 中输入(help-tactic) 会给我这个片段:

      - (using-params <tactic> <attribute>*) 使用给定的属性执行给定的策略,其中<attribute> ::= <keyword> <value>. !是一个 using-params 的语法糖。

      这是一个经过类型检查的示例(不确定是否有意义):

      (declare-const x (_ BitVec 16))
      (declare-const y (_ BitVec 16))
      
      (assert (= (bvor x y) (_ bv13 16)))
      (assert (bvslt x y))
      
      (apply (using-params qfbv :cache-all true))
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-07-17
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多