diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 2016-09-17 14:59:11 +0200 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@inria.fr> | 2016-09-17 14:59:11 +0200 |
commit | 6b87278c399332f67a4b40958ea2386bb3c1c66e (patch) | |
tree | dc8961306b936e005165b9dad628051c79eda284 | |
parent | 365ba9bd749f060e3ff9287b3283f0157d848557 (diff) | |
download | compcert-6b87278c399332f67a4b40958ea2386bb3c1c66e.tar.gz compcert-6b87278c399332f67a4b40958ea2386bb3c1c66e.zip |
Decidableplus: remove stuff that was cut-and-paste from Coq 8.5 library
The cut-and-paste was for compatibility with Coq 8.4
-rw-r--r-- | lib/Decidableplus.v | 49 |
1 files changed, 1 insertions, 48 deletions
diff --git a/lib/Decidableplus.v b/lib/Decidableplus.v index 932b885a..7772e07b 100644 --- a/lib/Decidableplus.v +++ b/lib/Decidableplus.v @@ -19,56 +19,9 @@ of Coq 8.5 with more instances of decidable properties, including universal and existential quantification over finite types. *) -(** Temporarily and for compatibility with Coq 8.4, this file includes - a copy of the relevant definitions from the Coq 8.5 [DecidableClass] - library. This library is copyright INRIA. *) - +Require Export DecidableClass. Require Import Coqlib. -Class Decidable (P : Prop) := { - Decidable_witness : bool; - Decidable_spec : Decidable_witness = true <-> P -}. - -Lemma Decidable_sound : forall P (H : Decidable P), - Decidable_witness = true -> P. -Proof. - intros. rewrite <- Decidable_spec. auto. -Qed. - -Lemma Decidable_complete : forall P (H : Decidable P), - P -> Decidable_witness = true. -Proof. - intros. rewrite Decidable_spec. auto. -Qed. - -Lemma Decidable_sound_alt : forall P (H : Decidable P), - ~ P -> Decidable_witness = false. -Proof. - intros. destruct Decidable_witness eqn:E; auto. elim H0. eapply Decidable_sound; eauto. -Qed. - -Lemma Decidable_complete_alt : forall P (H : Decidable P), - Decidable_witness = false -> ~ P. -Proof. - intros; red; intros. rewrite (Decidable_complete P H) in H0 by auto. discriminate. -Qed. - -Definition decide P {H : Decidable P} := Decidable_witness (Decidable:=H). - -Ltac _decide_ P H := - let b := fresh "b" in - set (b := decide P) in *; - assert (H : decide P = b) by reflexivity; - clearbody b; - destruct b; [apply Decidable_sound in H|apply Decidable_complete_alt in H]. - -Tactic Notation "decide" constr(P) "as" ident(H) := - _decide_ P H. - -Tactic Notation "decide" constr(P) := - let H := fresh "H" in _decide_ P H. - Ltac decide_goal := eapply Decidable_sound; reflexivity. (** Deciding logical connectives *) |