I'm learning Z3 and want to input some verification condition as stated by the Hoare logic and obtain a model of the given Hoare triples.
So far I have only been able to verify assignments, here is an example (just to check if I'm doing it right):
Given: { x< 40 } x :=x+10 { x < 50}
(declare-const x Int)
(assert (< x 50))
(assert (< (+ x 10) 50 ))
(check-sat)
But I don't know how to verify If-Else like:
{0 ≤ x ≤ 15 } if x < 15 then x := x + 1 else x := 0 endif {0 ≤ x ≤ 15 }
Or While loops (partial correctness)
{x ≤ 10} while x < 10 do x := x + 1 done {¬x < 10 ∧ x ≤ 10}
I tried with the ite command for the if-else but it seems to be unsupported.
Hope you can help me with this.