eldarica icon indicating copy to clipboard operation
eldarica copied to clipboard

How is division by 0 handled?

Open leonardoalt opened this issue 4 years ago • 1 comments

Eldarica says unsat for the following example, whereas both z3 and cvc4 say sat, so I'm just wondering how Eldarica handles it.

(declare-const c Int)

(assert
(and
(= c (div 5 0))
(not (= c 0))
))

(check-sat)
(get-model)

leonardoalt avatar Oct 08 '21 14:10 leonardoalt

Good point, this is probably something we should discuss at the next CHC-COMPs. Eldarica deviates from the SMT-LIB semantics concerning division by 0, in fact it will treat "div" as a partial function that cannot be applied to 0. The problem is that the exact SMT-LIB semantics, which considers division by zero as essentially an uninterpreted function, is hard to implement correctly in the CHC context; adding uninterpreted functions would be equivalent to adding certain existential quantifiers. Not sure how Spacer treats this case.

pruemmer avatar Oct 14 '21 15:10 pruemmer