-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
Hi,
While trying to validate the interpretations generated by Spacer for a number of CHC-comp instances, I believe I found some examples in which invalid interpretations are generated. Below is an explanation of the validation procedure and one example for reproducibility.
For a given satisfiable system of CHCs of form P1(X1) /\ ... /\ Pn(Xn) /\ cons => H(X), implicitly quantified, an SMT instance is generated for each clause in the system. Each SMT instance consists of the interpretations of the predicates generated by Spacer together with the constraints P1(X1) /\ ... /\ Pn(Xn) /\ cons /\ (not H(X)), i.e., body /\ (not head). For the interpretations to be valid all the SMT instances need to be unsatisfiable.
For the chc-LIA-Lin_325 instance, the interpretation generated by Spacer is invalid w.r.t the last CHC of the system. Both Z3 and CVC5 can find a satisfiable assignment for the SMT instance in question, shown below.
(set-logic LIA)
(define-fun main_1 ((x!0 Int) (x!1 Int) (x!2 Int) (x!3 Int)) Bool
(let ((a!1 (not (>= (+ x!2 (* (- 2) x!3)) (- 1))))
(a!2 (not (<= (+ x!2 (* (- 2) x!3)) (- 3))))
(a!3 (not (<= (+ (* 2 x!1) (* (- 1) x!2)) 1)))
(a!4 (exists ((x!4 Int) (x!5 Int) (x!6 Int))
(! (let ((a!1 (not (>= (+ x!2 (* (- 2) x!3)) (- 1))))
(a!2 (not (<= (+ x!2 (* (- 2) x!3)) (- 3))))
(a!3 (not (<= (+ (* 2 x!1) (* (- 1) x!2)) 1))))
(and a!1
a!2
a!3
(= x!6 (+ 1 x!3))
(not (= x!5 0))
(= x!5 (+ 2 x!2))
(not (= x!5 x!4))
(<= x!1 x!3)
(= x!4 (* 2 x!1))
(= x!0 2)))
:weight 0))))
(or (= x!0 0) (and a!1 a!2 a!3) a!4)))
(declare-fun A () Int)
(declare-fun B () Int)
(declare-fun C () Int)
(declare-fun v_3 () Int)
(assert
(and
(and
(main_1 v_3 A B C)
(= 2 v_3)
)
(not false)
)
)
(check-sat)
(exit)
The example shown is for a system of linear CHCs, but this problem also occurs with nonlinear CHCs, e.g., the 8th clause of chc-LIA_361.
Z3 version: 4.12.1
OS: Linux Mint 20.2 and Ubuntu 20.04.1