Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Roqc/test-suite/output/   (Fast Lexical Analyzer Version 2.6©)  Datei vom 15.8.2025 mit Größe 1 kB image not shown  

Quelle  lexical_convention_in_doc.v   Sprache: Coq

 
Set Printing AllSet Warnings "-prefix-incompatible-level".

(* if ``~`` and ``~~`` are both defined as tokens,
   the inputs ``~ ~`` and ``~~`` generate different tokens *)

Section TestLexer0.

Local Notation "~" := not.
Local Notation "~~" := not.

Check ~ ~ True.
Check ~~ True.

End TestLexer0.

(* whereas if ``~~`` is not defined,
   then the two inputs are equivalent *)

Section TestLexer1.

Local Notation "~" := not.

Set Printing All.
Check ~ ~ True.
Check ~~ True.

End TestLexer1.

(* Also, if ``~`` and ``~_h`` are both defined as tokens, the input
   ``~_ho`` is interpreted as ``~ _ho`` rather than ``~_h o`` so as
   not to cut the identifier-like subsequence ``ho``. *)

Section TestLexer2.

Local Notation "~" := not.
Local Notation "~_h" := (fun x => not (not x)).
Local Notation "'_ho'" := False.
Let o := True.

Check ~_ho.
Check ~_h o.

End TestLexer2.


(* Contrastingly, if only ``~_h`` is defined as a token, then ``~_ho``
   is an error because no token can be found that includes the whole
   subsequence ``ho`` without cutting it in the middle. *)

Section TestLexer3.

Local Notation "~_h" := (fun x => not (not x)).

Fail Check ~_ho.

End TestLexer3.

(* Finally, if all of ``~``, ``~_h`` and ``~_ho`` are defined as
   tokens, the input ``~_ho`` is interpreted using the longest match
   rule, i.e. as the token ``~_ho``. *)

Section TestLexer4.

Local Notation "~" := not.
Local Notation "~_h" := (fun x => not (not x)).
Local Notation "'_ho'" := False.
Local Notation "~_ho" := True.

Check ~_ho.

End TestLexer4.

Messung V0.5
C=93 H=100 G=96

¤ Dauer der Verarbeitung: 0.20 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

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 und die Messung sind noch experimentell.