Closed LeventErkok closed 2 years ago
Other functions also take 1 argument and have to define the unit case. In some cases this led to bugs in z3 (xnor) where it is easy to mix up the unit case. I don't see why forbidding distinct to have non-unit cases is an improvement: the converse argument could be made that since you can write (and true), (xor true) without an error message why can't you write (distinct true).
I believe CVC5 complains and requires at least 2 arguments for distinct. But I agree that uniformity with xor/and etc is nice too. It's just that discrepancies between different solvers is always a source of headache. But admittedly this is a minor point.
Looks like z3 will accept calls to distinct with just one argument, ending up with essentially no constraint on the value. Something like:
But more than likely the user made a mistake by forgetting to put the second argument there.
It'd be nice if z3 actually complained about the number of arguments to
distinct
, requiring it to be>= 2
. A straight reading of the SMTLib standard suggests that was the intention.