src/HOL/Library/LaTeXsugar.thy
author nipkow
Mon May 30 08:21:58 2005 +0200 (2005-05-30)
changeset 16110 c423bb89186d
parent 15690 1da2cfd1ca45
child 19674 22b635240905
permissions -rw-r--r--
added \nexists
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@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@15469
    32
syntax (latex output)
nipkow@15469
    33
  "_emptyset" :: "'a set"              ("\<emptyset>")
nipkow@15469
    34
translations
nipkow@15469
    35
  "_emptyset"      <= "{}"
nipkow@15469
    36
nipkow@15469
    37
(* insert *)
nipkow@15469
    38
translations 
nipkow@15469
    39
  "{x} \<union> A" <= "insert x A"
nipkow@15690
    40
  "{x,y}" <= "{x} \<union> {y}"
nipkow@15469
    41
  "{x,y} \<union> A" <= "{x} \<union> ({y} \<union> A)"
nipkow@15476
    42
  "{x}" <= "{x} \<union> _emptyset"
nipkow@15469
    43
nipkow@15469
    44
(* set comprehension *)
nipkow@15469
    45
syntax (latex output)
nipkow@15469
    46
  "_Collect" :: "pttrn => bool => 'a set"              ("(1{_ | _})")
nipkow@15469
    47
translations
nipkow@15469
    48
  "_Collect p P"      <= "{p. P}"
nipkow@15690
    49
  "_Collect p P"      <= "{p|xs. P}"
nipkow@15469
    50
nipkow@15469
    51
(* LISTS *)
nipkow@15469
    52
nipkow@15469
    53
(* Cons *)
nipkow@15469
    54
syntax (latex)
nipkow@15469
    55
  Cons :: "'a \<Rightarrow> 'a list \<Rightarrow> 'a list" ("_\<cdot>/_" [66,65] 65)
nipkow@15469
    56
nipkow@15469
    57
(* length *)
nipkow@15469
    58
syntax (latex output)
nipkow@15469
    59
  length :: "'a list \<Rightarrow> nat" ("|_|")
nipkow@15469
    60
nipkow@15469
    61
(* nth *)
nipkow@15469
    62
syntax (latex output)
nipkow@15469
    63
  nth :: "'a list \<Rightarrow> nat \<Rightarrow> 'a" ("_\<^raw:\ensuremath{_{[\mathit{>_\<^raw:}]}}>" [1000,0] 1000)
nipkow@15469
    64
nipkow@15469
    65
(* DUMMY *)
nipkow@15469
    66
consts DUMMY :: 'a ("\<^raw:\_>")
nipkow@15469
    67
nipkow@15469
    68
(* THEOREMS *)
nipkow@15469
    69
syntax (Rule output)
nipkow@15469
    70
  "==>" :: "prop \<Rightarrow> prop \<Rightarrow> prop"
nipkow@15469
    71
  ("\<^raw:\mbox{}\inferrule{\mbox{>_\<^raw:}}>\<^raw:{\mbox{>_\<^raw:}}>")
nipkow@15469
    72
nipkow@15469
    73
  "_bigimpl" :: "asms \<Rightarrow> prop \<Rightarrow> prop"
nipkow@15469
    74
  ("\<^raw:\mbox{}\inferrule{>_\<^raw:}>\<^raw:{\mbox{>_\<^raw:}}>")
nipkow@15469
    75
nipkow@15469
    76
  "_asms" :: "prop \<Rightarrow> asms \<Rightarrow> asms" 
nipkow@15469
    77
  ("\<^raw:\mbox{>_\<^raw:}\\>/ _")
nipkow@15469
    78
nipkow@15469
    79
  "_asm" :: "prop \<Rightarrow> asms" ("\<^raw:\mbox{>_\<^raw:}>")
nipkow@15469
    80
nipkow@15469
    81
syntax (IfThen 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:\mbox{>_\<^raw:}> /\<^raw:{\rmfamily\upshape\normalsize \,>and\<^raw:\,}>/ _")
nipkow@15469
    87
  "_asm" :: "prop \<Rightarrow> asms" ("\<^raw:\mbox{>_\<^raw:}>")
nipkow@15469
    88
nipkow@15469
    89
syntax (IfThenNoBox output)
nipkow@15469
    90
  "==>" :: "prop \<Rightarrow> prop \<Rightarrow> prop"
nipkow@15469
    91
  ("\<^raw:{\rmfamily\upshape\normalsize{}>If\<^raw:\,}> _/ \<^raw:{\rmfamily\upshape\normalsize \,>then\<^raw:\,}>/ _.")
nipkow@15469
    92
  "_bigimpl" :: "asms \<Rightarrow> prop \<Rightarrow> prop"
nipkow@15469
    93
  ("\<^raw:{\rmfamily\upshape\normalsize{}>If\<^raw:\,}> _ /\<^raw:{\rmfamily\upshape\normalsize \,>then\<^raw:\,}>/ _.")
nipkow@15469
    94
  "_asms" :: "prop \<Rightarrow> asms \<Rightarrow> asms" ("_ /\<^raw:{\rmfamily\upshape\normalsize \,>and\<^raw:\,}>/ _")
nipkow@15469
    95
  "_asm" :: "prop \<Rightarrow> asms" ("_")
nipkow@15469
    96
nipkow@15469
    97
end
nipkow@15469
    98
(*>*)