diff options
| author | Brian Campbell | 2019-10-18 14:43:11 +0100 |
|---|---|---|
| committer | Brian Campbell | 2019-10-18 14:45:47 +0100 |
| commit | 73475b844cb09f06c78d8f8a426e9de0eeffc367 (patch) | |
| tree | cb6cbe65b0a715bdf62c466ac68a767de9333171 /lib | |
| parent | f9be5b3bba7113f62cb0d911eb634cc126782785 (diff) | |
Coq: tweak a state monad lifting rule to improve performance
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/coq/Sail2_state_lemmas.v | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/coq/Sail2_state_lemmas.v b/lib/coq/Sail2_state_lemmas.v index 49d35770..90ae6840 100644 --- a/lib/coq/Sail2_state_lemmas.v +++ b/lib/coq/Sail2_state_lemmas.v @@ -306,8 +306,15 @@ destruct c; reflexivity. Qed. Hint Resolve liftState_if_distrib_sumbool : liftState. (* As above, but simple apply doesn't seem to work (again, due to unification problems - with the M alias for monad *) -Hint Extern 0 (liftState _ _ = _) => apply liftState_if_distrib_sumbool : liftState. + with the M alias for monad). Be careful about only applying to a suitable goal to + avoid slowing down proofs. *) +Hint Extern 0 (liftState _ ?t = _) => + match t with + | match ?x with _ => _ end => + match type of x with + | sumbool _ _ => apply liftState_if_distrib_sumbool + end + end : liftState. Lemma liftState_let_pair Regs RegVal A B C E r (x : B * C) M : @liftState Regs RegVal A E r (let '(y, z) := x in M y z) = |
