2
是否可以表達樓層,使其可以用作表達式而不是語句?在Yices,我們可以做這樣的事情,這將產生sat
和(= fooInt 5)
:實現作爲表達式的樓層,而不是陳述
(define floor::(-> x::real (subtype (y::int) (and (<= y x) (< x (+ y 1))))))
(define fooReal::real 11/2)
(define fooInt::int)
(assert (= fooInt (floor fooReal))
我可以在Z3得到最接近的是如下(我想既然Z3不支持依賴類型):
作爲一個表達式的底面是理想的,因爲它會更接近地匹配我從中生成Z3輸入的AST。如果我錯過了一個明顯的解決方案,我很抱歉。
正是我一直在尋找,但是,我又缺乏讚揚upvote的聲望......謝謝! :) – corbin
當然,你也可能會發現這個有用:http://stackoverflow.com/questions/12896440/does-z3-support-real-to-int-conversions/12897438#12897438 – Taylor