I need to find a solution to a problem by generating by using z3py
. The formulas are generated depending on input of the user. During the generation of the formulas temporary SMT variables are created that can take on only a limited amount of values, eg is its an integer only even values are allowed. For this case let the temporary variables be a
and b
and their relation with global variables x
and y
are defined by the predicate P(a,b,x,y)
.
An example generated using SMT-LIB like syntax:
(set-info :status unknown)
(declare-fun y () Int)
(declare-fun x () Int)
(assert
(forall (
(a Int) (b Int) (z Int) )
(let
(($x22 (exists ((z Int))(and (< x z) (> z y)))))
(=>
P(a, b, x, y)
$x22))))
(check-sat)
where
z
is a variable of which all possible values must be considereda
andb
represent variables who's allowed values are restricted by the predicateP
- the variable 'x' and 'y' need to be computed for which the formula is satisfied.
Questions:
- Does the predicate
P
reduce the time needed byz3
to find a solution? - Alternatively: viewing that
z3
perform search over all possible values forz
anda
will the predicateP
reduce the size of the search space?
Note: The question was updated after remarks from Levent Erkok.