Skip to content
This repository has been archived by the owner on Dec 17, 2020. It is now read-only.

Commit

Permalink
chore: Remove the [dup] tactic
Browse files Browse the repository at this point in the history
Coq already provides [pose proof] which is equivalent.

See: #5
  • Loading branch information
soraros authored and lthms committed Jul 30, 2019
1 parent 4466152 commit e1f86d3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
14 changes: 7 additions & 7 deletions theories/Data/Integer.v
Original file line number Diff line number Diff line change
Expand Up @@ -600,13 +600,13 @@ Proof.
++ apply Z.ge_le in g.
rewrite Z.add_comm in g.
apply Zle_not_gt in g.
dup l l'.
pose proof l as l'.
now apply Z.lt_gt in l'.
+ destruct Z_lt_ge_dec.
++ apply Z.ge_le in g.
rewrite Z.add_comm in g.
apply Zle_not_gt in g.
dup l l'.
pose proof l as l'.
now apply Z.lt_gt in l'.
++ reflexivity.
Qed.
Expand All @@ -630,7 +630,7 @@ Proof.
apply Z.add_assoc.
++++ (* absurd case *)
rewrite <- Z.add_assoc in F.
dup H2 H2'.
pose proof H2 as H2'.
apply Z.lt_asymm in H2'.
apply Z.ge_le in F.
now apply Zle_not_lt in F.
Expand All @@ -639,7 +639,7 @@ Proof.
apply Zle_not_gt in F.
contradict F.
apply Z.lt_gt.
dup H2 H2'.
pose proof H2 as H2'.
rewrite Z.add_assoc in H2'.
rewrite <- (Z.add_0_r (unsigned.max n)) in H2'.
apply Z.add_lt_cases in H2'.
Expand All @@ -651,7 +651,7 @@ Proof.
apply Z.ge_le in H4.
apply Zle_not_lt in H4.
destruct (Z_lt_ge_dec (x + y + z) (unsigned.max n)) as [H5|H5].
++++ dup H5 H5'.
++++ pose proof H5 as H5'.
now apply H4 in H5'.
++++ reflexivity.
+++ reflexivity.
Expand All @@ -664,7 +664,7 @@ Proof.
now apply Z.ge_le.
}
destruct Z_lt_ge_dec as [H4|H4]; [| reflexivity ].
dup H4 H4'.
pose proof H4 as H4'.
now apply Zlt_not_le in H4'.
Qed.

Expand Down Expand Up @@ -734,4 +734,4 @@ Definition signed_mul
{n: size}
(x y: signed.t n)
: signed.t n :=
unsigned_to_signed (unsigned_mul (signed_to_unsigned x) (signed_to_unsigned y)).
unsigned_to_signed (unsigned_mul (signed_to_unsigned x) (signed_to_unsigned y)).
8 changes: 1 addition & 7 deletions theories/Tactics.v
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
Require Import Coq.Logic.Eqdep.

(** [dup H H'] will duplicate the hypothesis [H], under the name [H'].
*)
Ltac dup H H' :=
let T := type of H in
assert (H': T) by exact H.

(** [ssubst] will deal with hypotheses of the form [existT _ _ x =
existT _ _ y] *)
Ltac ssubst :=
Expand All @@ -15,4 +9,4 @@ Ltac ssubst :=
ssubst
| [ |- _]
=> subst
end.
end.

0 comments on commit e1f86d3

Please sign in to comment.