Commit 90225068 authored by Dan Frumin's avatar Dan Frumin

Bump Iris version

- Fix a file broken due to wp_binop changes
parent 6a6b8cad
......@@ -9,6 +9,6 @@ build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-rf" "%{lib}%/coq/user-contrib/iris_examples"]
depends: [
"coq-iris" { (= "dev.2018-03-05.0") | (= "dev") }
"coq-iris" { (= "dev.2018-04-27.2.1ab890fc") | (= "dev") }
"coq-autosubst" { = "dev.coq86" }
]
......@@ -140,18 +140,16 @@ Section factorial_client.
Proof.
iLöb as "IH".
iIntros (n Φ) "ret".
destruct (decide (n = 0)) as [-> | ?].
- wp_lam. wp_lam.
wp_binop. wp_if. iApply "ret"; done.
- wp_lam; wp_lam.
wp_lam. wp_lam.
wp_binop.
rewrite bool_decide_false;last auto.
wp_if.
case_bool_decide; simplify_eq/=.
- wp_if. iApply "ret".
- wp_if.
wp_bind (_ - _)%E.
wp_binop.
wp_bind ((times _) _).
iApply "IH"; iNext.
wp_binop.
wp_binop; first
by replace (m + ((n - 1) * m)) with (n * m) by lia.
Qed.
......@@ -188,14 +186,15 @@ Section factorial_client.
iIntros (H%of_to_val Hleq Φ) "_ ret"; simplify_eq.
iApply (myrec_spec (fun v => m' : Z, 0 m' to_val v = Some #m'%I)
(fun u => fun v => m' : Z, to_val v = Some #m' u = #(fac_int m')%I)).
- iSplit. iIntros (e_f f v) "%". iAlways. iIntros (Φ') "spec_f ret".
- iSplit; last eauto. iIntros (e_f f v) "%". iAlways. iIntros (Φ') "spec_f ret".
apply of_to_val in a as <-.
wp_lam. wp_lam. iDestruct "spec_f" as "[spec_f %]".
destruct H as [m' [Hleqm' Heq%of_to_val]]; simplify_eq.
destruct (decide (m'= 0)) as [-> | ?].
+ wp_binop. wp_if. iApply "ret". iPureIntro. exists 0; done.
+ wp_binop. rewrite bool_decide_false; last auto. wp_if. wp_binop.
wp_bind (f _ )%E.
wp_binop.
case_bool_decide; simplify_eq/=; wp_if.
+ iApply "ret". iPureIntro. exists 0; done.
+ assert (m' 0) by naive_solver.
wp_binop. wp_bind (f _ )%E.
iApply ("spec_f" $! (#(m'-1))).
* iIntros "!%".
exists (m'-1); split; first lia; last auto.
......@@ -207,7 +206,6 @@ Section factorial_client.
simpl in Heq; simplify_eq.
split; first auto.
rewrite -fac_int_eq; first auto; lia.
+ iIntros "!%". by exists n'.
- iNext. iIntros "**". destruct a as (?&[=]&->); simplify_eq. by iApply "ret".
Qed.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment