Debian Codegraph @

test/regress/cli/regress1/quantifiers/parametric-lists.smt2

raw
1 ; EXPECT: unsat
2 (set-logic ALL)
3 (set-info :status unsat)
4 (declare-datatypes ((List 1)) ((par (T) ((cons (head T) (tail (List T))) (nil)))))
5 (declare-datatypes ((KV 0)) (((kv (key Int) (value Int)) (nilKV))))
6 (declare-fun mapper ((List Int)) (List KV))
7 (assert
8 (forall
9 ((input (List Int)))
10 (ite
11 (= input (as nil (List Int)))
12 (= (as nil (List KV)) (mapper input))
13 (= (cons (kv 0 (head input)) (mapper (tail input))) (mapper input))
14 )
15 )
16 )
17 (declare-fun reduce ((List KV)) Int)
18 (assert
19 (forall
20 ((inputk (List KV)))
21 (ite
22 (= inputk (as nil (List KV)))
23 (= 0 (reduce inputk))
24 (= (+ (value (head inputk)) (reduce (tail inputk))) (reduce inputk))
25 )
26 )
27 )
28 (declare-fun sum ((List Int)) Int)
29 (assert
30 (forall
31 ((input (List Int)))
32 (ite
33 (= input (as nil (List Int)))
34 (= 0 (sum input))
35 (= (+ (head input) (sum (tail input))) (sum input))
36 )
37 )
38 )
39 (assert
40 (not (= (sum (cons 0 (as nil (List Int)))) (reduce (mapper (cons 0 (as nil (List Int)))))))
41 )
42 (check-sat)