xapantu / counting-smt

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unexpected answer

dddejan opened this issue · comments

The problem below asks: Find x, y in [0, 10] such that y is the number of u's in [0,10] that are equal to both x and y. The answer I get is card!1 = 5, y = 5, x = 6. For y != x, I would expect the #u is 0. Am I wrong?

(set-logic QF_LIA)

(declare-fun x () Int)
(declare-fun y () Int)

(assert (and (>= x 0) (>= 10 x)))
(assert (and (>= y 0) (>= 10 y)))

(assert (= y (# u Int 
  (and 
    (>= u 0) (>= 10 u)
    (= u x)
    (= u y)
  )
)))

(check-sat)
(get-model)