aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorclrenard2001-07-10 12:13:24 +0000
committerclrenard2001-07-10 12:13:24 +0000
commit879b392daebf8b58f708ebadc43bda73a4e57d28 (patch)
tree7368cd7650865f339399e617b994c6ca19ea6f45
parent47b05fc01cfc977201f84d1af1e1415f84cf39dc (diff)
Ajout du .v pour la tactique Setoid_replace
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@1842 85f007b7-540e-0410-9357-904b9bb8a0f7
-rw-r--r--theories/Setoid/Setoid_replace.v75
1 files changed, 75 insertions, 0 deletions
diff --git a/theories/Setoid/Setoid_replace.v b/theories/Setoid/Setoid_replace.v
new file mode 100644
index 0000000000..ba4e829f18
--- /dev/null
+++ b/theories/Setoid/Setoid_replace.v
@@ -0,0 +1,75 @@
+(***********************************************************************)
+(* v * The Coq Proof Assistant / The Coq Development Team *)
+(* <O___,, * INRIA-Rocquencourt & LRI-CNRS-Orsay *)
+(* \VV/ *************************************************************)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(***********************************************************************)
+
+(* $Id$: *)
+
+Declare ML Module "setoid_replace".
+
+Grammar tactic simple_tactic : ast :=
+ setoid_replace [ "Setoid_replace" constrarg($c1) "with" constrarg($c2) ] -> [(Setoid_replace $c1 $c2)]
+.
+
+Grammar tactic simple_tactic : ast :=
+ setoid_rewriteLR [ "Setoid_rewrite" "->" constrarg($c) ] -> [(Setoid_rewriteLR $c)]
+| setoid_rewriteRL [ "Setoid_rewrite" "<-" constrarg($c) ] -> [(Setoid_rewriteRL $c)]
+| setoid_rewrite [ "Setoid_rewrite" constrarg($c) ] -> [(Setoid_rewriteLR $c)]
+.
+
+Syntax tactic level 0 :
+ setoid_replace [<<(Setoid_replace $c1 $c2)>>] -> [[<hov 0>"Setoid_replace " $c1 [1 1] "with " $c2]]
+ | setoid_rewritelr [<<(Setoid_rewriteLR $c)>>] -> ["Setoid_rewrite " $c]
+ | setoid_rewriterl [<<(Setoid_rewriteRL $c)>>] -> ["Setoid_rewrite <- " $c]
+.
+
+Grammar vernac vernac : ast :=
+ add_setoid [ "Add" "Setoid" constrarg($a) constrarg($aeq) constrarg($t) "." ]
+ -> [(AddSetoid $a $aeq $t)]
+| new_morphism [ "Add" "Morphism" constrarg($m) ":" identarg($s) "." ] -> [(NamedNewMorphism $s $m)]
+.
+
+Section Setoid.
+
+Variable A : Type.
+Variable Aeq : A -> A -> Prop.
+
+Record Setoid_Theory : Prop :=
+{ Seq_refl : (x:A) (Aeq x x);
+ Seq_sym : (x,y:A) (Aeq x y) -> (Aeq y x);
+ Seq_trans : (x,y,z:A) (Aeq x y) -> (Aeq y z) -> (Aeq x z)
+}.
+
+End Setoid.
+
+Definition Prop_S : (Setoid_Theory Prop ([x,y:Prop] x<->y)).
+Split; Tauto.
+Save.
+
+Add Setoid Prop iff Prop_S.
+
+Hint prop_set : setoid := Resolve (Seq_refl Prop iff Prop_S).
+Hint prop_set : setoid := Resolve (Seq_sym Prop iff Prop_S).
+Hint prop_set : setoid := Resolve (Seq_trans Prop iff Prop_S).
+
+Add Morphism or : or_ext.
+Tauto.
+Save.
+
+Add Morphism and : and_ext.
+Tauto.
+Save.
+
+Add Morphism not : not_ext.
+Tauto.
+Save.
+
+Definition fleche [A,B:Prop] := A -> B.
+
+Add Morphism fleche : fleche_ext.
+Tauto.
+Save.
+