0

I am trying to do this in SMT-LIB, running z3 -smt2 script.smt2 on the script containing these expressions:

(set-logic AUFLIA)

(declare-fun a () Int)
(declare-fun b () Int)
(declare-fun c () Int)
(declare-fun d () Int)
(declare-fun e () Int)
(declare-fun f () Int)
(declare-fun x () Int)
(declare-fun c () Int)

(declare-fun addition (Int Int) Int)

(assert (= x c))
(assert (= c (addition a b)))
(assert (= f (addition d e)))

(check-sat)

I want to get a unification for these variables. For example, I expect to be able to unify the variables by assigning x=f, a=d and b=e.

Is it even possible to do this in z3 or SMT-LIB?

Or should I be using some other language to do this (maybe give a recommendation is this is what you think?)

ndb
  • 127
  • 1
  • 10
  • I'd be somewhat surprised if Z3 had explicit support for the feature you describe. Did you search for variable elimination, or for minimal models, in the context of Z3? Also, a (cumbersome) approach could be to repeatedly query Z3 while adding explicit equalities such as `x=f`, and to record the query that used the most equalities and was still satisfiable. – Malte Schwerhoff Mar 09 '15 at 15:01
  • Yeah I don't think there is an explicit way to do this. You can do `(get-model)` and get the variables with different integer assignments cannot be equivalent, while those with the same integer assignment could be substituted for each other. – ndb Mar 10 '15 at 16:17

0 Answers0