src/HOL/Library/LaTeXsugar.thy
author haftmann
Thu Jan 15 14:52:24 2009 +0100 (2009-01-15)
changeset 29493 ddcbd5e4041d
parent 27688 397de75836a1
child 30304 d8e4cd2ac2a1
permissions -rw-r--r--
dropped $Id$
nipkow@15469
     1
(*  Title:      HOL/Library/LaTeXsugar.thy
nipkow@15469
     2
    Author:     Gerwin Klain, Tobias Nipkow, Norbert Schirmer
nipkow@15469
     3
    Copyright   2005 NICTA and TUM
nipkow@15469
     4
*)
nipkow@15469
     5
nipkow@15469
     6
(*<*)
nipkow@15469
     7
theory LaTeXsugar
haftmann@27487
     8
imports Plain "~~/src/HOL/List"
nipkow@15469
     9
begin
nipkow@15469
    10
nipkow@15469
    11
(* LOGIC *)
wenzelm@21210
    12
notation (latex output)
wenzelm@19674
    13
  If  ("(\<^raw:\textsf{>if\<^raw:}> (_)/ \<^raw:\textsf{>then\<^raw:}> (_)/ \<^raw:\textsf{>else\<^raw:}> (_))" 10)
wenzelm@19674
    14
nipkow@15469
    15
syntax (latex output)
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@16110
    23
(* should become standard syntax once x-symbols supports it *)
nipkow@16110
    24
syntax (latex)
nipkow@16110
    25
  nexists :: "('a => bool) => bool"           (binder "\<nexists>" 10)
nipkow@16110
    26
translations
nipkow@16110
    27
  "\<nexists>x. P" <= "\<not>(\<exists>x. P)"
nipkow@16110
    28
nipkow@15469
    29
(* SETS *)
nipkow@15469
    30
nipkow@15469
    31
(* empty set *)
nipkow@27688
    32
notation (latex)
nipkow@27688
    33
  "{}" ("\<emptyset>")
nipkow@15469
    34
nipkow@15469
    35
(* insert *)
nipkow@15469
    36
translations 
nipkow@15469
    37
  "{x} \<union> A" <= "insert x A"
nipkow@15690
    38
  "{x,y}" <= "{x} \<union> {y}"
nipkow@15469
    39
  "{x,y} \<union> A" <= "{x} \<union> ({y} \<union> A)"
nipkow@27688
    40
  "{x}" <= "{x} \<union> \<emptyset>"
nipkow@15469
    41
nipkow@15469
    42
(* set comprehension *)
nipkow@15469
    43
syntax (latex output)
nipkow@15469
    44
  "_Collect" :: "pttrn => bool => 'a set"              ("(1{_ | _})")
nipkow@15469
    45
translations
nipkow@15469
    46
  "_Collect p P"      <= "{p. P}"
nipkow@15690
    47
  "_Collect p P"      <= "{p|xs. P}"
nipkow@15469
    48
nipkow@15469
    49
(* LISTS *)
nipkow@15469
    50
nipkow@15469
    51
(* Cons *)
wenzelm@21210
    52
notation (latex)
wenzelm@19674
    53
  Cons  ("_\<cdot>/_" [66,65] 65)
nipkow@15469
    54
nipkow@15469
    55
(* length *)
wenzelm@21210
    56
notation (latex output)
wenzelm@19674
    57
  length  ("|_|")
nipkow@15469
    58
nipkow@15469
    59
(* nth *)
wenzelm@21210
    60
notation (latex output)
wenzelm@19674
    61
  nth  ("_\<^raw:\ensuremath{_{[\mathit{>_\<^raw:}]}}>" [1000,0] 1000)
nipkow@15469
    62
nipkow@15469
    63
(* DUMMY *)
nipkow@15469
    64
consts DUMMY :: 'a ("\<^raw:\_>")
nipkow@15469
    65
nipkow@15469
    66
(* THEOREMS *)
nipkow@15469
    67
syntax (Rule output)
nipkow@15469
    68
  "==>" :: "prop \<Rightarrow> prop \<Rightarrow> prop"
nipkow@15469
    69
  ("\<^raw:\mbox{}\inferrule{\mbox{>_\<^raw:}}>\<^raw:{\mbox{>_\<^raw:}}>")
nipkow@15469
    70
nipkow@15469
    71
  "_bigimpl" :: "asms \<Rightarrow> prop \<Rightarrow> prop"
nipkow@15469
    72
  ("\<^raw:\mbox{}\inferrule{>_\<^raw:}>\<^raw:{\mbox{>_\<^raw:}}>")
nipkow@15469
    73
nipkow@15469
    74
  "_asms" :: "prop \<Rightarrow> asms \<Rightarrow> asms" 
nipkow@15469
    75
  ("\<^raw:\mbox{>_\<^raw:}\\>/ _")
nipkow@15469
    76
nipkow@15469
    77
  "_asm" :: "prop \<Rightarrow> asms" ("\<^raw:\mbox{>_\<^raw:}>")
nipkow@15469
    78
schirmer@22328
    79
syntax (Axiom output)
schirmer@22328
    80
  "Trueprop" :: "bool \<Rightarrow> prop"
schirmer@22328
    81
  ("\<^raw:\mbox{}\inferrule{\mbox{}}{\mbox{>_\<^raw:}}>")
schirmer@22328
    82
nipkow@15469
    83
syntax (IfThen output)
nipkow@15469
    84
  "==>" :: "prop \<Rightarrow> prop \<Rightarrow> prop"
nipkow@25467
    85
  ("\<^raw:{\normalsize{}>If\<^raw:\,}> _/ \<^raw:{\normalsize \,>then\<^raw:\,}>/ _.")
nipkow@15469
    86
  "_bigimpl" :: "asms \<Rightarrow> prop \<Rightarrow> prop"
nipkow@25467
    87
  ("\<^raw:{\normalsize{}>If\<^raw:\,}> _ /\<^raw:{\normalsize \,>then\<^raw:\,}>/ _.")
nipkow@25467
    88
  "_asms" :: "prop \<Rightarrow> asms \<Rightarrow> asms" ("\<^raw:\mbox{>_\<^raw:}> /\<^raw:{\normalsize \,>and\<^raw:\,}>/ _")
nipkow@15469
    89
  "_asm" :: "prop \<Rightarrow> asms" ("\<^raw:\mbox{>_\<^raw:}>")
nipkow@15469
    90
nipkow@15469
    91
syntax (IfThenNoBox output)
nipkow@15469
    92
  "==>" :: "prop \<Rightarrow> prop \<Rightarrow> prop"
nipkow@25467
    93
  ("\<^raw:{\normalsize{}>If\<^raw:\,}> _/ \<^raw:{\normalsize \,>then\<^raw:\,}>/ _.")
nipkow@15469
    94
  "_bigimpl" :: "asms \<Rightarrow> prop \<Rightarrow> prop"
nipkow@25467
    95
  ("\<^raw:{\normalsize{}>If\<^raw:\,}> _ /\<^raw:{\normalsize \,>then\<^raw:\,}>/ _.")
nipkow@25467
    96
  "_asms" :: "prop \<Rightarrow> asms \<Rightarrow> asms" ("_ /\<^raw:{\normalsize \,>and\<^raw:\,}>/ _")
nipkow@15469
    97
  "_asm" :: "prop \<Rightarrow> asms" ("_")
nipkow@15469
    98
nipkow@15469
    99
end
nipkow@15469
   100
(*>*)