(* rule for if in weakest precondition form *)
Lemma wp_if : forall t x v s1 s2 P1 P2 G R Q,
let wp :=
EX val:value,
store_op (fun r => r#v = Some val) &&
(
((!!(val = value_label (L 0)) && P1))
||
((EX x1:value, (EX x2:value,
!!(val = (value_cons x1 x2)))) && P2)
)
in
hoare t x G R P1 s1 Q ->
hoare t x G R P2 s2 Q ->
hoare t x G R wp (instr_if_nil v s1 s2) Q.