You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I could model their safety verification using CHCs in SMT-LIB2 format. For the first one, I will get a linear CHCs problem with one unknown loop invariant to synthesize; and for the second program with the procedure call (assuming there is no inlining), a non-linear CHCs problem for which we have to find the precondition and the summary of the procedure init_0 as well as the invariant for the loop inside init_0. By example:
CHCs for program 1:
(set-logic HORN)
(declare-funinv0 ((ArrayIntInt) IntInt) Bool)
(assert (forall
((arr (ArrayIntInt)) (i Int) (N Int))
(=> (and (= i 0) (> N 0))
(inv0 arr i N))))
(assert (forall
((arr (ArrayIntInt)) (i Int) (N Int)
(|arr'| (ArrayIntInt)) (|i'|Int))
(=> (and (inv0 arr i N)
(< i N)
(=|arr'| (store arr i 0))
(=|i'| (+ i 1)))
(inv0 |arr'||i'| N))))
(assert (forall
((arr (ArrayIntInt)) (i Int) (N Int))
(=> (and (inv0 arr i N)
(= i N)
(not (forall ((k Int)) (=> (and (<=0 k) (< k N)) (= (select arr k) 0)))))
false)))
(check-sat)
(get-model)
CHCs for program 2:
(set-logic HORN)
(declare-funinv0 ((ArrayIntInt) IntInt (ArrayIntInt)) Bool)
(declare-fun|array_init_0@pre| ((ArrayIntInt) Int) Bool)
(declare-fun|array_init_0@summary| ((ArrayIntInt) Int (ArrayIntInt)) Bool)
(assert (forall
((arr (ArrayIntInt)) (N Int))
(=> (> N 0)
(|array_init_0@pre| arr N))))
(assert (forall
((arr (ArrayIntInt)) (N Int) (i Int))
(=> (and (|array_init_0@pre| arr N) (= i 0))
(inv0 arr i N arr))))
(assert (forall
((arr_0 (ArrayIntInt)) (i Int) (N Int) (arr (ArrayIntInt))
(|arr'| (ArrayIntInt)) (|i'|Int))
(=> (and (inv0 arr_0 i N arr)
(< i N)
(=|arr'| (store arr i 0))
(=|i'| (+ i 1)))
(inv0 arr_0 |i'| N |arr'|))))
(assert (forall
((arr_0 (ArrayIntInt)) (i Int) (N Int) (arr (ArrayIntInt)))
(=> (and (inv0 arr_0 i N arr)
(= i N))
(|array_init_0@summary| arr_0 N arr))))
(assert (forall
((arr (ArrayIntInt)) (i Int) (N Int) (|arr'| (ArrayIntInt)) (k Int))
(=> (and (> N 0)
(|array_init_0@pre| arr N)
(|array_init_0@summary| arr N |arr'|)
(<=0 k) (< k N)
(not (= (select|arr'| k) 0)))
false)))
(check-sat)
(get-model)
If I, now, call Z3's Spacer to solve this two problems using the any of the commands below:
Spacer will successfully solves the first problem of program 1 and timeouts for the second program.
My questions are the following
Is it possible to make Spacer solve the second program's CHCs? if yes, what options must I use?
Is there any limitation in the algorithm that Spacer implements to handle quantifiers that forbids/limits solving non-linear CHCs that require quantified interpretations?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
If we consider the following two programs:
Program 1:
Program 2:
I could model their safety verification using CHCs in SMT-LIB2 format. For the first one, I will get a linear CHCs problem with one unknown loop invariant to synthesize; and for the second program with the procedure call (assuming there is no inlining), a non-linear CHCs problem for which we have to find the precondition and the summary of the procedure
init_0
as well as the invariant for the loop insideinit_0
. By example:CHCs for program 1:
CHCs for program 2:
If I, now, call Z3's Spacer to solve this two problems using the any of the commands below:
Spacer will successfully solves the first problem of program 1 and timeouts for the second program.
My questions are the following
Thank you so much!
Beta Was this translation helpful? Give feedback.
All reactions