mirror of
https://github.com/achlipala/frap.git
synced 2024-11-10 00:07:51 +00:00
Make the ht1 tactic a bit more robust in HoareLogic.v
(Without this change, the HtIf rule can fail to generalize and unify spuriously with goals of the right shape)
This commit is contained in:
parent
2ed1d52171
commit
1e81721268
2 changed files with 18 additions and 6 deletions
12
HoareLogic.v
12
HoareLogic.v
|
@ -215,9 +215,15 @@ Qed.
|
||||||
* rules. Some other obligations are generated, generally of implications
|
* rules. Some other obligations are generated, generally of implications
|
||||||
* between assertions, and [ht] also makes a best effort to solve those. *)
|
* between assertions, and [ht] also makes a best effort to solve those. *)
|
||||||
|
|
||||||
Ltac ht1 := apply HtSkip || apply HtAssign || apply HtWrite || eapply HtSeq
|
Ltac ht1 :=
|
||||||
|| eapply HtIf || eapply HtWhile || eapply HtAssert
|
match goal with
|
||||||
|| eapply HtStrengthenPost.
|
| [ |- {{ _ }} _ {{ ?P }} ] =>
|
||||||
|
tryif is_evar P then
|
||||||
|
apply HtSkip || apply HtAssign || apply HtWrite || eapply HtSeq
|
||||||
|
|| eapply HtIf || eapply HtWhile || eapply HtAssert
|
||||||
|
else
|
||||||
|
eapply HtStrengthenPost
|
||||||
|
end.
|
||||||
|
|
||||||
Ltac t := cbv beta; propositional; subst;
|
Ltac t := cbv beta; propositional; subst;
|
||||||
repeat match goal with
|
repeat match goal with
|
||||||
|
|
|
@ -186,9 +186,15 @@ Qed.
|
||||||
* rules. Some other obligations are generated, generally of implications
|
* rules. Some other obligations are generated, generally of implications
|
||||||
* between assertions, and [ht] also makes a best effort to solve those. *)
|
* between assertions, and [ht] also makes a best effort to solve those. *)
|
||||||
|
|
||||||
Ltac ht1 := apply HtSkip || apply HtAssign || apply HtWrite || eapply HtSeq
|
Ltac ht1 :=
|
||||||
|| eapply HtIf || eapply HtWhile || eapply HtAssert
|
match goal with
|
||||||
|| eapply HtStrengthenPost.
|
| [ |- {{ _ }} _ {{ ?P }} ] =>
|
||||||
|
tryif is_evar P then
|
||||||
|
apply HtSkip || apply HtAssign || apply HtWrite || eapply HtSeq
|
||||||
|
|| eapply HtIf || eapply HtWhile || eapply HtAssert
|
||||||
|
else
|
||||||
|
eapply HtStrengthenPost
|
||||||
|
end.
|
||||||
|
|
||||||
Ltac t := cbv beta; propositional; subst;
|
Ltac t := cbv beta; propositional; subst;
|
||||||
repeat match goal with
|
repeat match goal with
|
||||||
|
|
Loading…
Reference in a new issue