Skip to content

Instantly share code, notes, and snippets.

@ashiato45
Created March 31, 2019 10:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ashiato45/7fcfe70d43b0168988119756da0c0384 to your computer and use it in GitHub Desktop.
Save ashiato45/7fcfe70d43b0168988119756da0c0384 to your computer and use it in GitHub Desktop.
;; activate interpolation
(set-option :produce-interpolants true)
(set-logic QF_LIA)
(declare-sort U 0)
(declare-fun x () Int)
(declare-fun y () Int)
(declare-fun z () Int)
(define-fun A1 () Bool (= y (* 2 x)))
(define-fun A2 () Bool (= y (+ (* 2 z) 1)))
;; use annotation :interpolation-group to partition the input problem into
;; several groups
(assert (! A1 :interpolation-group g1))
(assert (! A2 :interpolation-group g2))
(check-sat)
;; compute an interpolant for the given partition: the argument to
;; get-interpolant is a list of groups forming the A-part of the interpolation
;; problem
(get-interpolant (g1))
(exit)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment