Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Z3 / SMTLIB2 support for `distinct`

Tags:

z3

smt

I've been using the (ML) z3 bindings for a while, and the API function

val mk_distinct : context -> ast array -> ast

has served faithfully for many years. Am now trying to switch to the SMTLIB2 interface, but I find that the distinct command is unsupported. For example, the query:

(declare-fun x () Int)
(declare-fun y () Int)
(distinct x y)
(assert (= x y))
(check-sat)

yields the response:

unsupported
; distinct  
sat

on the web-demo. Is there some workaround?

Thanks!

Ranjit.

like image 515
Ranjit Jhala Avatar asked Oct 28 '25 05:10

Ranjit Jhala


1 Answers

You should use (assert (distinct x y)) instead of (distinct x y). Here is a link to the updated example: http://rise4fun.com/Z3/uVrX

like image 195
Leonardo de Moura Avatar answered Oct 30 '25 14:10

Leonardo de Moura



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!