src/HOL/Library/LaTeXsugar.thy
author nipkow
Thu Jan 27 13:33:21 2005 +0100 (2005-01-27)
changeset 15476 b8cb20cc0c0b
parent 15469 f5d22f504ab9
child 15690 1da2cfd1ca45
permissions -rw-r--r--
fixed bugs
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 *)
nipkow@15469
    13
syntax (latex output)
nipkow@15469
    14
  If            :: "[bool, 'a, 'a] => 'a"
nipkow@15469
    15
  ("(\<^raw:\textsf{>if\<^raw:}> (_)/ \<^raw:\textsf{>then\<^raw:}> (_)/ \<^raw:\textsf{>else\<^raw:}> (_))" 10)
nipkow@15469
    16
nipkow@15469
    17
  "_Let"        :: "[letbinds, 'a] => 'a"
nipkow@15469
    18
  ("(\<^raw:\textsf{>let\<^raw:}> (_)/ \<^raw:\textsf{>in\<^raw:}> (_))" 10)
nipkow@15469
    19
nipkow@15469
    20
  "_case_syntax":: "['a, cases_syn] => 'b"
nipkow@15469
    21
  ("(\<^raw:\textsf{>case\<^raw:}> _ \<^raw:\textsf{>of\<^raw:}>/ _)" 10)
nipkow@15469
    22
nipkow@15469
    23
(* SETS *)
nipkow@15469
    24
nipkow@15469
    25
(* empty set *)
nipkow@15469
    26
syntax (latex output)
nipkow@15469
    27
  "_emptyset" :: "'a set"              ("\<emptyset>")
nipkow@15469
    28
translations
nipkow@15469
    29
  "_emptyset"      <= "{}"
nipkow@15469
    30
nipkow@15469
    31
(* insert *)
nipkow@15469
    32
translations 
nipkow@15469
    33
  "{x} \<union> A" <= "insert x A"
nipkow@15469
    34
  "{x,y} \<union> A" <= "{x} \<union> ({y} \<union> A)"
nipkow@15476
    35
  "{x}" <= "{x} \<union> _emptyset"
nipkow@15469
    36
nipkow@15469
    37
(* set comprehension *)
nipkow@15469
    38
syntax (latex output)
nipkow@15469
    39
  "_Collect" :: "pttrn => bool => 'a set"              ("(1{_ | _})")
nipkow@15469
    40
translations
nipkow@15469
    41
  "_Collect p P"      <= "{p. P}"
nipkow@15469
    42
nipkow@15469
    43
(* LISTS *)
nipkow@15469
    44
nipkow@15469
    45
(* Cons *)
nipkow@15469
    46
syntax (latex)
nipkow@15469
    47
  Cons :: "'a \<Rightarrow> 'a list \<Rightarrow> 'a list" ("_\<cdot>/_" [66,65] 65)
nipkow@15469
    48
nipkow@15469
    49
(* length *)
nipkow@15469
    50
syntax (latex output)
nipkow@15469
    51
  length :: "'a list \<Rightarrow> nat" ("|_|")
nipkow@15469
    52
nipkow@15469
    53
(* nth *)
nipkow@15469
    54
syntax (latex output)
nipkow@15469
    55
  nth :: "'a list \<Rightarrow> nat \<Rightarrow> 'a" ("_\<^raw:\ensuremath{_{[\mathit{>_\<^raw:}]}}>" [1000,0] 1000)
nipkow@15469
    56
nipkow@15469
    57
(* DUMMY *)
nipkow@15469
    58
consts DUMMY :: 'a ("\<^raw:\_>")
nipkow@15469
    59
nipkow@15469
    60
(* THEOREMS *)
nipkow@15469
    61
syntax (Rule output)
nipkow@15469
    62
  "==>" :: "prop \<Rightarrow> prop \<Rightarrow> prop"
nipkow@15469
    63
  ("\<^raw:\mbox{}\inferrule{\mbox{>_\<^raw:}}>\<^raw:{\mbox{>_\<^raw:}}>")
nipkow@15469
    64
nipkow@15469
    65
  "_bigimpl" :: "asms \<Rightarrow> prop \<Rightarrow> prop"
nipkow@15469
    66
  ("\<^raw:\mbox{}\inferrule{>_\<^raw:}>\<^raw:{\mbox{>_\<^raw:}}>")
nipkow@15469
    67
nipkow@15469
    68
  "_asms" :: "prop \<Rightarrow> asms \<Rightarrow> asms" 
nipkow@15469
    69
  ("\<^raw:\mbox{>_\<^raw:}\\>/ _")
nipkow@15469
    70
nipkow@15469
    71
  "_asm" :: "prop \<Rightarrow> asms" ("\<^raw:\mbox{>_\<^raw:}>")
nipkow@15469
    72
nipkow@15469
    73
syntax (IfThen output)
nipkow@15469
    74
  "==>" :: "prop \<Rightarrow> prop \<Rightarrow> prop"
nipkow@15469
    75
  ("\<^raw:{\rmfamily\upshape\normalsize{}>If\<^raw:\,}> _/ \<^raw:{\rmfamily\upshape\normalsize \,>then\<^raw:\,}>/ _.")
nipkow@15469
    76
  "_bigimpl" :: "asms \<Rightarrow> prop \<Rightarrow> prop"
nipkow@15469
    77
  ("\<^raw:{\rmfamily\upshape\normalsize{}>If\<^raw:\,}> _ /\<^raw:{\rmfamily\upshape\normalsize \,>then\<^raw:\,}>/ _.")
nipkow@15469
    78
  "_asms" :: "prop \<Rightarrow> asms \<Rightarrow> asms" ("\<^raw:\mbox{>_\<^raw:}> /\<^raw:{\rmfamily\upshape\normalsize \,>and\<^raw:\,}>/ _")
nipkow@15469
    79
  "_asm" :: "prop \<Rightarrow> asms" ("\<^raw:\mbox{>_\<^raw:}>")
nipkow@15469
    80
nipkow@15469
    81
syntax (IfThenNoBox output)
nipkow@15469
    82
  "==>" :: "prop \<Rightarrow> prop \<Rightarrow> prop"
nipkow@15469
    83
  ("\<^raw:{\rmfamily\upshape\normalsize{}>If\<^raw:\,}> _/ \<^raw:{\rmfamily\upshape\normalsize \,>then\<^raw:\,}>/ _.")
nipkow@15469
    84
  "_bigimpl" :: "asms \<Rightarrow> prop \<Rightarrow> prop"
nipkow@15469
    85
  ("\<^raw:{\rmfamily\upshape\normalsize{}>If\<^raw:\,}> _ /\<^raw:{\rmfamily\upshape\normalsize \,>then\<^raw:\,}>/ _.")
nipkow@15469
    86
  "_asms" :: "prop \<Rightarrow> asms \<Rightarrow> asms" ("_ /\<^raw:{\rmfamily\upshape\normalsize \,>and\<^raw:\,}>/ _")
nipkow@15469
    87
  "_asm" :: "prop \<Rightarrow> asms" ("_")
nipkow@15469
    88
nipkow@15469
    89
end
nipkow@15469
    90
(*>*)