test: add some regression tests

This commit is contained in:
Simon Cruanes 2020-01-14 20:23:14 -06:00
parent dbf88279a1
commit 17a09f2cbc
6 changed files with 87 additions and 0 deletions

View file

@ -0,0 +1,22 @@
; see diamond2_cong, but using "if"
; diamond based on congruence, not just transitivity
(declare-sort a 0)
(declare-fun x0 () a)
(declare-fun y0 () a)
(declare-fun z0 () a)
(declare-fun p0 () Bool)
(declare-fun x1 () a)
(declare-fun y1 () a)
(declare-fun z1 () a)
(declare-fun p1 () Bool)
(declare-fun x2 () a)
(declare-fun f (a) a)
(assert (not (= x2 (f (f x0)))))
(assert (= x1 (f y0)))
(assert (= x1 (f z0)))
(assert (= x0 (ite p0 y0 z0)))
(assert (= x2 (f y1)))
(assert (= x2 (f z1)))
(assert (= x1 (ite p1 y1 z1)))
(check-sat)

14
tests/unsat/if_ff_fg.smt2 Normal file
View file

@ -0,0 +1,14 @@
; if + congruence
(declare-sort u 0)
(declare-fun p0 () Bool)
(declare-fun a () u)
(declare-fun b1 () u)
(declare-fun b2 () u)
(declare-fun c () u)
(declare-fun f (u) u)
(assert (= a (ite p0 b1 b2)))
(assert (= (f b1) c))
(assert (= (f b2) c))
(assert (not (= (f a) c)))
(check-sat)

View file

@ -0,0 +1,17 @@
; nested ifs
(declare-sort u 0)
(declare-fun a () u)
(declare-fun b () u)
(declare-fun c () u)
(declare-fun d () u)
(declare-fun q0 () Bool)
(declare-fun q1 () Bool)
(declare-fun q2 () Bool)
(declare-fun p (u) Bool)
(assert (p a))
(assert (p b))
(assert (p c))
(assert (p d))
(assert (not (p (ite q0 (ite q1 a b) (ite q2 c d)))))
(check-sat)

View file

@ -0,0 +1,14 @@
(set-info :smt-lib-version 2.6)
(set-logic QF_UFLRA)
(set-info :source |Benchmarks from the paper: "Extending Sledgehammer with SMT Solvers" by Jasmin Blanchette, Sascha Bohme, and Lawrence C. Paulson, CADE 2011. Translated to SMT2 by Andrew Reynolds and Morgan Deters.|)
(set-info :category "industrial")
(set-info :status unsat)
(declare-sort S1 0)
(declare-fun f1 () S1)
(declare-fun f2 () S1)
(declare-fun f3 () Real)
(declare-fun f4 () Real)
(assert (not (= f1 f2)))
(assert (not (=> (< f3 f4) (=> (< f4 (* 2.0 f3)) (< 0.0 (- f4 f3))))))
(check-sat)
(exit)

View file

@ -0,0 +1,12 @@
(set-info :status "unsat")
(declare-fun p () Bool)
(declare-sort u 0)
(declare-fun f (Bool) u)
(declare-const a u)
(declare-const b u)
(assert (distinct a b))
(assert (= (f p) a))
(assert (= (f (and p (or p p))) b))
(check-sat)

View file

@ -0,0 +1,8 @@
(declare-sort U 0)
(declare-fun a () U)
(declare-fun b () U)
(declare-fun cond () Bool)
(declare-fun p (U) Bool)
(assert (and (= a b) (p a) (not (p (ite cond a b)))))
(check-sat)