aboutsummaryrefslogtreecommitdiffhomepage
path: root/theories/Init
diff options
context:
space:
mode:
authorGravatar letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7>2011-05-05 15:12:23 +0000
committerGravatar letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7>2011-05-05 15:12:23 +0000
commit157bee13827f9a616b6c82be4af110c8f2464c64 (patch)
tree5b51be276e4671c04f817b2706176c2b14921cad /theories/Init
parent74352a7bbfe536f43d73b4b6cec75252d2eb39e8 (diff)
Modularization of BinNat + fixes of stdlib
A sub-module N in BinNat now contains functions add (ex-Nplus), mul (ex-Nmult), ... and properties. In particular, this sub-module N directly instantiates NAxiomsSig and includes all derived properties NProp. Files Ndiv_def and co are now obsolete and kept only for compat git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@14100 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'theories/Init')
-rw-r--r--theories/Init/Datatypes.v11
-rw-r--r--theories/Init/Tactics.v8
2 files changed, 19 insertions, 0 deletions
diff --git a/theories/Init/Datatypes.v b/theories/Init/Datatypes.v
index 4598b2030..1ea54e620 100644
--- a/theories/Init/Datatypes.v
+++ b/theories/Init/Datatypes.v
@@ -110,6 +110,17 @@ Proof.
intros P b H H0; destruct H0 in H; assumption.
Defined.
+(** The [BoolSpec] inductive will be used to relate a [boolean] value
+ and two propositions corresponding respectively to the [true]
+ case and the [false] case.
+ Interest: [BoolSpec] behave nicely with [case] and [destruct].
+ See also [Bool.reflect] when [Q = ~P].
+*)
+
+Inductive BoolSpec (P Q : Prop) : bool -> Prop :=
+ | BoolSpecT : P -> BoolSpec P Q true
+ | BoolSpecF : Q -> BoolSpec P Q false.
+
(********************************************************************)
(** * Peano natural numbers *)
diff --git a/theories/Init/Tactics.v b/theories/Init/Tactics.v
index 2caf6a4b8..4d64b8238 100644
--- a/theories/Init/Tactics.v
+++ b/theories/Init/Tactics.v
@@ -77,6 +77,10 @@ Ltac false_hyp H G :=
Ltac case_eq x := generalize (refl_equal x); pattern x at -1; case x.
+(* use either discriminate or injection on a hypothesis *)
+
+Ltac destr_eq H := discriminate H || (try (injection H; clear H; intro H)).
+
(* Similar variants of destruct *)
Tactic Notation "destruct_with_eqn" constr(x) :=
@@ -185,6 +189,10 @@ Ltac easy :=
Tactic Notation "now" tactic(t) := t; easy.
+(** Slightly more than [easy]*)
+
+Ltac easy' := repeat split; simpl; easy || now destruct 1.
+
(** A tactic to document or check what is proved at some point of a script *)
Ltac now_show c := change c.