src/HOL/Library/LaTeXsugar.thy
author wenzelm
Tue Nov 07 11:47:57 2006 +0100 (2006-11-07)
changeset 21210 c17fd2df4e9e
parent 19674 22b635240905
child 22328 cc403d881873
permissions -rw-r--r--
renamed 'const_syntax' to 'notation';
nipkow@15469
     1
(*  Title:      HOL/Library/LaTeXsugar.thy
nipkow@15469
     2
    ID:         $Id$
nipkow@15469
     3
    Author:     Gerwin Klain, Tobias Nipkow, Norbert Schirmer
nipkow@15469
     4
    Copyright   2005 NICTA and TUM
nipkow@15469
     5
*)
nipkow@15469
     6
nipkow@15469
     7
(*<*)
nipkow@15469
     8
theory LaTeXsugar
nipkow@15469
     9
imports Main
nipkow@15469
    10
begin
nipkow@15469
    11
nipkow@15469
    12
(* LOGIC *)
wenzelm@21210
    13
notation (latex output)
wenzelm@19674
    14
  If  ("(\<^raw:\textsf{>if\<^raw:}> (_)/ \<^raw:\textsf{>then\<^raw:}> (_)/ \<^raw:\textsf{>else\<^raw:}> (_))" 10)
wenzelm@19674
    15
nipkow@15469
    16
syntax (latex output)
nipkow@15469
    17
nipkow@15469
    18
  "_Let"        :: "[letbinds, 'a] => 'a"
nipkow@15469
    19
  ("(\<^raw:\textsf{>let\<^raw:}> (_)/ \<^raw:\textsf{>in\<^raw:}> (_))" 10)
nipkow@15469
    20
nipkow@15469
    21
  "_case_syntax":: "['a, cases_syn] => 'b"
nipkow@15469
    22
  ("(\<^raw:\textsf{>case\<^raw:}> _ \<^raw:\textsf{>of\<^raw:}>/ _)" 10)
nipkow@15469
    23
nipkow@16110
    24
(* should become standard syntax once x-symbols supports it *)
nipkow@16110
    25
syntax (latex)
nipkow@16110
    26
  nexists :: "('a => bool) => bool"           (binder "\<nexists>" 10)
nipkow@16110
    27
translations
nipkow@16110
    28
  "\<nexists>x. P" <= "\<not>(\<exists>x. P)"
nipkow@16110
    29
nipkow@15469
    30
(* SETS *)
nipkow@15469
    31
nipkow@15469
    32
(* empty set *)
nipkow@15469
    33
syntax (latex output)
nipkow@15469
    34
  "_emptyset" :: "'a set"              ("\<emptyset>")
nipkow@15469
    35
translations
nipkow@15469
    36
  "_emptyset"      <= "{}"
nipkow@15469
    37
nipkow@15469
    38
(* insert *)
nipkow@15469
    39
translations 
nipkow@15469
    40
  "{x} \<union> A" <= "insert x A"
nipkow@15690
    41
  "{x,y}" <= "{x} \<union> {y}"
nipkow@15469
    42
  "{x,y} \<union> A" <= "{x} \<union> ({y} \<union> A)"
nipkow@15476
    43
  "{x}" <= "{x} \<union> _emptyset"
nipkow@15469
    44
nipkow@15469
    45
(* set comprehension *)
nipkow@15469
    46
syntax (latex output)
nipkow@15469
    47
  "_Collect" :: "pttrn => bool => 'a set"              ("(1{_ | _})")
nipkow@15469
    48
translations
nipkow@15469
    49
  "_Collect p P"      <= "{p. P}"
nipkow@15690
    50
  "_Collect p P"      <= "{p|xs. P}"
nipkow@15469
    51
nipkow@15469
    52
(* LISTS *)
nipkow@15469
    53
nipkow@15469
    54
(* Cons *)
wenzelm@21210
    55
notation (latex)
wenzelm@19674
    56
  Cons  ("_\<cdot>/_" [66,65] 65)
nipkow@15469
    57
nipkow@15469
    58
(* length *)
wenzelm@21210
    59
notation (latex output)
wenzelm@19674
    60
  length  ("|_|")
nipkow@15469
    61
nipkow@15469
    62
(* nth *)
wenzelm@21210
    63
notation (latex output)
wenzelm@19674
    64
  nth  ("_\<^raw:\ensuremath{_{[\mathit{>_\<^raw:}]}}>" [1000,0] 1000)
nipkow@15469
    65
nipkow@15469
    66
(* DUMMY *)
nipkow@15469
    67
consts DUMMY :: 'a ("\<^raw:\_>")
nipkow@15469
    68
nipkow@15469
    69
(* THEOREMS *)
nipkow@15469
    70
syntax (Rule output)
nipkow@15469
    71
  "==>" :: "prop \<Rightarrow> prop \<Rightarrow> prop"
nipkow@15469
    72
  ("\<^raw:\mbox{}\inferrule{\mbox{>_\<^raw:}}>\<^raw:{\mbox{>_\<^raw:}}>")
nipkow@15469
    73
nipkow@15469
    74
  "_bigimpl" :: "asms \<Rightarrow> prop \<Rightarrow> prop"
nipkow@15469
    75
  ("\<^raw:\mbox{}\inferrule{>_\<^raw:}>\<^raw:{\mbox{>_\<^raw:}}>")
nipkow@15469
    76
nipkow@15469
    77
  "_asms" :: "prop \<Rightarrow> asms \<Rightarrow> asms" 
nipkow@15469
    78
  ("\<^raw:\mbox{>_\<^raw:}\\>/ _")
nipkow@15469
    79
nipkow@15469
    80
  "_asm" :: "prop \<Rightarrow> asms" ("\<^raw:\mbox{>_\<^raw:}>")
nipkow@15469
    81
nipkow@15469
    82
syntax (IfThen output)
nipkow@15469
    83
  "==>" :: "prop \<Rightarrow> prop \<Rightarrow> prop"
nipkow@15469
    84
  ("\<^raw:{\rmfamily\upshape\normalsize{}>If\<^raw:\,}> _/ \<^raw:{\rmfamily\upshape\normalsize \,>then\<^raw:\,}>/ _.")
nipkow@15469
    85
  "_bigimpl" :: "asms \<Rightarrow> prop \<Rightarrow> prop"
nipkow@15469
    86
  ("\<^raw:{\rmfamily\upshape\normalsize{}>If\<^raw:\,}> _ /\<^raw:{\rmfamily\upshape\normalsize \,>then\<^raw:\,}>/ _.")
nipkow@15469
    87
  "_asms" :: "prop \<Rightarrow> asms \<Rightarrow> asms" ("\<^raw:\mbox{>_\<^raw:}> /\<^raw:{\rmfamily\upshape\normalsize \,>and\<^raw:\,}>/ _")
nipkow@15469
    88
  "_asm" :: "prop \<Rightarrow> asms" ("\<^raw:\mbox{>_\<^raw:}>")
nipkow@15469
    89
nipkow@15469
    90
syntax (IfThenNoBox output)
nipkow@15469
    91
  "==>" :: "prop \<Rightarrow> prop \<Rightarrow> prop"
nipkow@15469
    92
  ("\<^raw:{\rmfamily\upshape\normalsize{}>If\<^raw:\,}> _/ \<^raw:{\rmfamily\upshape\normalsize \,>then\<^raw:\,}>/ _.")
nipkow@15469
    93
  "_bigimpl" :: "asms \<Rightarrow> prop \<Rightarrow> prop"
nipkow@15469
    94
  ("\<^raw:{\rmfamily\upshape\normalsize{}>If\<^raw:\,}> _ /\<^raw:{\rmfamily\upshape\normalsize \,>then\<^raw:\,}>/ _.")
nipkow@15469
    95
  "_asms" :: "prop \<Rightarrow> asms \<Rightarrow> asms" ("_ /\<^raw:{\rmfamily\upshape\normalsize \,>and\<^raw:\,}>/ _")
nipkow@15469
    96
  "_asm" :: "prop \<Rightarrow> asms" ("_")
nipkow@15469
    97
nipkow@15469
    98
end
nipkow@15469
    99
(*>*)