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