。不幸的是,我目前的 定義掛起z3一個微不足道的查詢,所以我想我錯過了 一些簡單的選項/標誌。用Z3/SMT-LIB2定義集合的理論我試圖用ZTL3接口爲Z3定義集合的理論(聯合,交點等)
這裏的永久鏈接:http://rise4fun.com/Z3/JomY
(declare-sort Set) (declare-fun emp() Set) (declare-fun add (Set Int) Set) (declare-fun cup (Set Set) Set) (declare-fun cap (Set Set) Set) (declare-fun dif (Set Set) Set) (declare-fun sub (Set Set) Bool) (declare-fun mem (Int Set) Bool) (assert (forall ((x Int)) (not (mem x emp)))) (assert (forall ((x Int) (s1 Set) (s2 Set)) (= (mem x (cup s1 s2)) (or (mem x s1) (mem x s2))))) (assert (forall ((x Int) (s1 Set) (s2 Set)) (= (mem x (cap s1 s2)) (and (mem x s1) (mem x s2))))) (assert (forall ((x Int) (s1 Set) (s2 Set)) (= (mem x (dif s1 s2)) (and (mem x s1) (not (mem x s2)))))) (assert (forall ((x Int) (s Set) (y Int)) (= (mem x (add s y)) (or (mem x s) (= x y))))) (declare-fun z3v8() Bool) (assert (not z3v8)) (check-sat)
任何暗示,以我缺少的是什麼?另外,根據我所知,沒有標準SMT-LIB2 編碼的設置操作,例如, Z3.mk_set_{add,del,empty,...}
(這就是我試圖通過量詞獲得該功能的原因。) 這是正確的嗎?還是有另一條路線?
謝謝!
Ranjit。
感謝Leo!選項1看起來不錯。 SMTLIB支持選項2嗎? (即在SMTLIB2中是map和const)? –
不,選項2不是SMT-LIB標準的一部分:( –
hi leo,添加了一個鏈接,顯示了選項2的示例。你的const和map操作符真的很整潔!謝謝! –