Skip to content
Snippets Groups Projects
Commit 689a005a authored by Loïc Correnson's avatar Loïc Correnson
Browse files

[wp] naming pre-conditions

with associated variable renaming
parent 1b3752e2
No related branches found
No related tags found
No related merge requests found
...@@ -10,7 +10,11 @@ Goal Post-condition 'qed_ok' in 'f': ...@@ -10,7 +10,11 @@ Goal Post-condition 'qed_ok' in 'f':
Assume { Assume {
Type: is_sint32(x) /\ is_sint32(y). Type: is_sint32(x) /\ is_sint32(y).
(* Pre-condition *) (* Pre-condition *)
Have: (0 <= x) /\ (0 <= y) /\ (x <= 10) /\ (y <= 10) /\ P_Q(y, x). Have: P_Q(y, x).
(* Pre-condition *)
Have: (0 <= x) /\ (x <= 10).
(* Pre-condition *)
Have: (0 <= y) /\ (y <= 10).
} }
Prove: P_Q(1 + y, 1 + x). Prove: P_Q(1 + y, 1 + x).
...@@ -20,17 +24,20 @@ Prove: P_Q(1 + y, 1 + x). ...@@ -20,17 +24,20 @@ Prove: P_Q(1 + y, 1 + x).
------------------------------------------------------------ ------------------------------------------------------------
Goal Post-condition 'qed_ok' in 'g': Goal Post-condition 'qed_ok' in 'g':
Let x = Mint_0[u]. Let x = Mint_0[v].
Let x_1 = Mint_0[v]. Let x_1 = Mint_0[u].
Let m = Mint_0[u <- 1 + x]. Let m = Mint_0[u <- 1 + x_1].
Let x_2 = m[v]. Let x_2 = m[v].
Assume { Assume {
Type: is_sint32(x) /\ is_sint32(x_1) /\ is_sint32(x_2). Type: is_sint32(x_1) /\ is_sint32(x) /\ is_sint32(x_2).
(* Heap *) (* Heap *)
Type: (region(u.base) <= 0) /\ (region(v.base) <= 0). Type: (region(u.base) <= 0) /\ (region(v.base) <= 0).
(* Pre-condition *) (* Pre-condition *)
Have: (0 <= x) /\ (0 <= x_1) /\ (x <= 10) /\ (x_1 <= 10) /\ Have: P_P(Mint_0, u, v).
P_P(Mint_0, u, v). (* Pre-condition *)
Have: (0 <= x_1) /\ (x_1 <= 10).
(* Pre-condition *)
Have: (0 <= x) /\ (x <= 10).
} }
Prove: P_P(m[v <- 1 + x_2], u, v). Prove: P_P(m[v <- 1 + x_2], u, v).
...@@ -49,7 +56,7 @@ Assume { ...@@ -49,7 +56,7 @@ Assume {
Type: is_sint32(x). Type: is_sint32(x).
(* Heap *) (* Heap *)
Type: is_sint32(y). Type: is_sint32(y).
(* Pre-condition *) (* Pre-condition 'H' *)
Have: P_f /\ P_g(x) /\ P_h(y, x) /\ P_w(y, x). Have: P_f /\ P_g(x) /\ P_h(y, x) /\ P_w(y, x).
} }
Prove: P_g(1 + x). Prove: P_g(1 + x).
...@@ -61,7 +68,7 @@ Assume { ...@@ -61,7 +68,7 @@ Assume {
Type: is_sint32(x). Type: is_sint32(x).
(* Heap *) (* Heap *)
Type: is_sint32(y). Type: is_sint32(y).
(* Pre-condition *) (* Pre-condition 'H' *)
Have: P_f /\ P_g(x) /\ P_h(y, x) /\ P_w(y, x). Have: P_f /\ P_g(x) /\ P_h(y, x) /\ P_w(y, x).
} }
Prove: P_h(y, 1 + x). Prove: P_h(y, 1 + x).
...@@ -73,7 +80,7 @@ Assume { ...@@ -73,7 +80,7 @@ Assume {
Type: is_sint32(x). Type: is_sint32(x).
(* Heap *) (* Heap *)
Type: is_sint32(y). Type: is_sint32(y).
(* Pre-condition *) (* Pre-condition 'H' *)
Have: P_f /\ P_g(x) /\ P_h(y, x) /\ P_w(y, x). Have: P_f /\ P_g(x) /\ P_h(y, x) /\ P_w(y, x).
} }
Prove: P_w(y, 1 + x). Prove: P_w(y, 1 + x).
...@@ -98,7 +105,7 @@ Assume { ...@@ -98,7 +105,7 @@ Assume {
Type: is_sint32(y). Type: is_sint32(y).
(* Heap *) (* Heap *)
Type: is_sint32(x). Type: is_sint32(x).
(* Pre-condition *) (* Pre-condition 'H' *)
Have: P_f /\ P_g(x) /\ P_h(y, x) /\ P_w(y, x). Have: P_f /\ P_g(x) /\ P_h(y, x) /\ P_w(y, x).
} }
Prove: P_h(1 + y, x). Prove: P_h(1 + y, x).
...@@ -110,7 +117,7 @@ Assume { ...@@ -110,7 +117,7 @@ Assume {
Type: is_sint32(y). Type: is_sint32(y).
(* Heap *) (* Heap *)
Type: is_sint32(x). Type: is_sint32(x).
(* Pre-condition *) (* Pre-condition 'H' *)
Have: P_f /\ P_g(x) /\ P_h(y, x) /\ P_w(y, x). Have: P_f /\ P_g(x) /\ P_h(y, x) /\ P_w(y, x).
} }
Prove: P_w(1 + y, x). Prove: P_w(1 + y, x).
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment