mirror of
https://github.com/achlipala/frap.git
synced 2024-11-27 23:06:20 +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
10
HoareLogic.v
10
HoareLogic.v
|
@ -215,9 +215,15 @@ Qed.
|
|||
* rules. Some other obligations are generated, generally of implications
|
||||
* between assertions, and [ht] also makes a best effort to solve those. *)
|
||||
|
||||
Ltac ht1 := apply HtSkip || apply HtAssign || apply HtWrite || eapply HtSeq
|
||||
Ltac ht1 :=
|
||||
match goal with
|
||||
| [ |- {{ _ }} _ {{ ?P }} ] =>
|
||||
tryif is_evar P then
|
||||
apply HtSkip || apply HtAssign || apply HtWrite || eapply HtSeq
|
||||
|| eapply HtIf || eapply HtWhile || eapply HtAssert
|
||||
|| eapply HtStrengthenPost.
|
||||
else
|
||||
eapply HtStrengthenPost
|
||||
end.
|
||||
|
||||
Ltac t := cbv beta; propositional; subst;
|
||||
repeat match goal with
|
||||
|
|
|
@ -186,9 +186,15 @@ Qed.
|
|||
* rules. Some other obligations are generated, generally of implications
|
||||
* between assertions, and [ht] also makes a best effort to solve those. *)
|
||||
|
||||
Ltac ht1 := apply HtSkip || apply HtAssign || apply HtWrite || eapply HtSeq
|
||||
Ltac ht1 :=
|
||||
match goal with
|
||||
| [ |- {{ _ }} _ {{ ?P }} ] =>
|
||||
tryif is_evar P then
|
||||
apply HtSkip || apply HtAssign || apply HtWrite || eapply HtSeq
|
||||
|| eapply HtIf || eapply HtWhile || eapply HtAssert
|
||||
|| eapply HtStrengthenPost.
|
||||
else
|
||||
eapply HtStrengthenPost
|
||||
end.
|
||||
|
||||
Ltac t := cbv beta; propositional; subst;
|
||||
repeat match goal with
|
||||
|
|
Loading…
Reference in a new issue