(** Stdlib notations *) Module StdlibNotations. Import IfNotations. PrintNotation"x -> y". PrintNotation"x <-> y". PrintNotation"x /\ y". PrintNotation"x \/ y". PrintNotation"~ x". PrintNotation"x = y :> T". PrintNotation"x = y". PrintNotation"x = y = z". PrintNotation"x <> y :> T". PrintNotation"x <> y". PrintNotation"x <= y". PrintNotation"x < y". PrintNotation"x >= y". PrintNotation"x > y". PrintNotation"x <= y <= z". PrintNotation"x <= y < z". PrintNotation"x < y < z". PrintNotation"x < y <= z". PrintNotation"x + y". PrintNotation"x - y". PrintNotation"x * y". PrintNotation"x / y". PrintNotation"- x". PrintNotation"/ x". PrintNotation"x ^ y". PrintNotation"x || y". PrintNotation"x && y". PrintNotation"( x , y , .. , z )". PrintNotation"{ x }". PrintNotation"{ A } + { B }". PrintNotation"A + { B }". PrintNotation"{ x | P }". PrintNotation"{ x | P & Q }". PrintNotation"{ x : A | P }". PrintNotation"{ x : A | P & Q }". PrintNotation"{ x & P }". PrintNotation"{ x & P & Q }". PrintNotation"{ x : A & P }". PrintNotation"{ x : A & P & Q }". PrintNotation"{ ' pat | P }". PrintNotation"{ ' pat | P & Q }". PrintNotation"{ ' pat : A | P }". PrintNotation"{ ' pat : A | P & Q }". PrintNotation"{ ' pat & P }". PrintNotation"{ ' pat & P & Q }". PrintNotation"{ ' pat : A & P }". PrintNotation"{ ' pat : A & P & Q }". PrintNotation"'if' c 'is' p 'then' u 'else' v". End StdlibNotations.
(* Print Notatation doesn't work with custom notations *) Module Custom. Declare Custom Entry Foo.
Reserved Notation"{{ x }}" (in custom Foo at level 0). PrintNotation"{{ x }}" in custom Foo. PrintNotation"{{ _ }}" in custom Foo.
Fail PrintNotation"{{ x }}" in custom Bar.
Fail PrintNotation"{{ _ }}" in custom Bar.
Fail PrintNotation"[[ x ]]" in custom Foo.
Fail PrintNotation"[[ _ ]]" in custom Foo. End Custom.
Module OnlyLetters.
Reserved Infix"mod" (at level 40, no associativity).
Fail PrintNotation"x mod y". PrintNotation"x 'mod' y". PrintNotation"_ mod _". PrintNotation"_ 'mod' _". Axiom foo : Type. Axiom bar : forall _ : foo, forall _ : foo, foo. Infix"mod" := bar (only parsing). Check (_ mod _ mod _). End OnlyLetters.
Module SingleQuotes.
Reserved Infix"'mod'" (at level 40, no associativity).
Fail PrintNotation"x 'mod' y". PrintNotation"x ''mod'' y".
Fail PrintNotation"_ 'mod' _". (* FIXME I expected this to work *) PrintNotation"_ ''mod'' _". Axiom foo : Type. Axiom bar : forall _ : foo, forall _ : foo, foo. Infix"'mod'" := bar (only parsing). Check (_ 'mod' _ 'mod' _). End SingleQuotes.
Module Recursive.
Reserved Notation"'exists' x .. y , p"
(at level 200, x binder, right associativity,
format "'[' 'exists' '/ ' x .. y , '/ ' p ']'").
Fail PrintNotation"exists x .. y , p". PrintNotation"'exists' x .. y , p". PrintNotation"exists _ .. _ , _".
Fail PrintNotation"exists _ , _".
Fail PrintNotation"exists _ _ , _". End Recursive.
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.