max element in Z3 Seq Int
问题 I'm trying to write a max function that operates on Seq Int . It should return the index with maximal value . Here is what I have: (declare-fun max ((Seq Int)) Int) (assert (forall ((A (Seq Int))) (=> (> (seq.len A) 0) (and (<= 0 (max A)) (< (max A) (seq.len A)) (forall ((i Int)) (=> (and (<= 0 i) (< i (seq.len A))) (<= (seq.nth A i) (seq.nth A (max A)))))))) ) (assert (= (max (seq.++ (seq.unit 8) (seq.unit 3))) 0)) ;(assert (= (max (seq.++ (seq.unit 8) (seq.unit 3))) 1)) (check-sat) When I