Skip to content

Commit

Permalink
update to bedrock2 where Module WP is gone
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelgruetter committed Aug 6, 2023
1 parent 87d29e3 commit 0c5ee4d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
10 changes: 4 additions & 6 deletions src/Rupicola/Examples/CapitalizeThird/Properties.v
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,6 @@ Section Proofs.
try congruence)]
end.

Import WP.

(* TODO: try to use ProgramLogic *)
Lemma capitalize_String_correct
(addr : word) (s : Gallina.String) :
Expand All @@ -320,8 +318,8 @@ Section Proofs.
(success = 1 /\ sep (String addr caps) R mem'))).
Proof.
cbv zeta. intros.
eapply mk_wp_call. 1: eassumption. 1: reflexivity.
eapply cmd_sound.
do 4 eexists. 1: eassumption. do 2 eexists. 1: reflexivity.
eapply sound_cmd.

(* beginning of function body *)
cbn [WeakestPrecondition.cmd WeakestPrecondition.cmd_body].
Expand Down Expand Up @@ -721,8 +719,8 @@ Section Proofs.
R mem'))).
Proof.
cbv zeta. intros.
eapply mk_wp_call. 1: eassumption. 1: reflexivity.
eapply cmd_sound.
do 4 eexists. 1: eassumption. do 2 eexists. 1: reflexivity.
eapply sound_cmd.

(* beginning of function body *)
cbn [WeakestPrecondition.cmd WeakestPrecondition.cmd_body].
Expand Down
9 changes: 4 additions & 5 deletions src/Rupicola/Lib/Compiler.v
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,7 @@ Section with_parameters.
rewrite map.put_idemp in H0; assumption.
- eapply WeakestPrecondition_weaken, IHcmd1; eauto;
intros; eapply WeakestPrecondition_weaken, IHcmd2; eauto.
- eapply WP.WP_Impl.mk_wp_cmd. eapply WP.WP_Impl.invert_wp_cmd in H.
eapply refinement_while. 2: eassumption.
- eapply refinement_while. 2: eassumption.
unfold refinement. intros.
eapply sound_cmd. eapply IHcmd. eapply complete_cmd. assumption.
Qed.
Expand Down Expand Up @@ -427,7 +426,7 @@ Section with_parameters.
clear; firstorder eauto using getmany_list_map.
Qed.

Import bedrock2.Semantics bedrock2.WP.
Import bedrock2.Semantics.

Lemma compile_setup_WeakestPrecondition_call_first {tr mem locals}
name argnames retvars body args functions post:
Expand All @@ -444,8 +443,8 @@ Section with_parameters.
WeakestPrecondition.call functions name tr mem args post.
Proof.
intros.
eapply mk_wp_call. 1,2: eassumption.
eapply cmd_sound.
do 4 eexists. 1: eassumption. do 2 eexists. 1: eassumption.
eapply sound_cmd.
eapply WeakestPrecondition_weaken; try eassumption.
clear; firstorder eauto using getmany_list_map.
Qed.
Expand Down

0 comments on commit 0c5ee4d

Please sign in to comment.