(* Some acid tests for token modes *) theory TokensAcid imports Main begin (* Here's a table of all tokens for symbols, produced by unicode-tokens-list-tokens *) (* \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \

\ \ \ \ \ \ \ \ \ \ *) (* Demonstrating variants on token names: different token names, same appearance. Simulated overloading. Let's take back \ from the meta-level. *) consts andprops :: "bool set \ bool" andpreds :: "('a \ bool) set \ bool" notation (xsymbols) andprops ("\") and (* token , hover to see this *) andpreds ("\") (* token , hover to see this *) term "\ {True, False}" term "\ {\ x. True, \ y. False}" (* Note: of course, copy and paste will produce wrong result for above: default token without variant is produced! *) (* Tokens for layout control: next char *) (* NB: below here cannot be processed: just in terms to check with string font for terms *) term "a\<^sub>b" term "a\<^sup>b" term "a\<^isub>b" term "a\<^isup>b" term "\<^loc>a" term "\<^bold>b" term "\<^italic>b" (* Tokens for layout control: regions *) term "a\<^bsub>long\<^esub>" term "b\<^bsup>long\<^esup>" term "\<^bbold>Bold text \\\\ \ \\<^ebold>" term "\<^bitalic>Italic text \\\\ \\\<^eitalic>" term "\<^bscript>Script \\\\\\\<^escript>" term "\<^bfrakt>Frakt \\\\ \\\<^efrakt>" term "\<^bserif>Roman \\\\ \\\<^eserif>" (* Note: nesting regions not reliable; merging properties flaw? *) term "\<^bbold>Bold and \<^bitalic>italic\<^eitalic>\<^ebold>" term "\<^bitalic>Italic and \<^bbold>bold\<^ebold>\<^eitalic>" (* Font changes work, though *) term "\<^bbold>Bold and \<^bscript>script\<^escript>\<^ebold>" term "\<^bserif>Roman and \<^bitalic>italic\<^eitalic> and \<^bbold>bold\<^ebold> \<^eserif>" term "\<^bfrakt>Frakt and \<^bitalic>italic\<^eitalic> and \<^bbold>bold\<^ebold> \<^efrakt>" end