| author | paulson <lp15@cam.ac.uk> | 
| Fri, 20 Mar 2015 16:11:28 +0000 | |
| changeset 59765 | 26d1c71784f1 | 
| parent 56245 | 84fc7dfa3cd4 | 
| child 61143 | 5f898411ce87 | 
| permissions | -rw-r--r-- | 
| 15469 | 1 | (* Title: HOL/Library/OptionalSugar.thy | 
| 55052 | 2 | Author: Gerwin Klein, Tobias Nipkow | 
| 15469 | 3 | Copyright 2005 NICTA and TUM | 
| 4 | *) | |
| 15476 | 5 | (*<*) | 
| 15469 | 6 | theory OptionalSugar | 
| 30663 
0b6aff7451b2
Main is (Complex_Main) base entry point in library theories
 haftmann parents: 
30503diff
changeset | 7 | imports Complex_Main LaTeXsugar | 
| 15469 | 8 | begin | 
| 9 | ||
| 30474 | 10 | (* hiding set *) | 
| 22835 | 11 | translations | 
| 30404 
d03dd6301678
more robust treatment of (authentic) consts within translations;
 wenzelm parents: 
29494diff
changeset | 12 | "xs" <= "CONST set xs" | 
| 22835 | 13 | |
| 30474 | 14 | (* hiding numeric conversions - embeddings only *) | 
| 15 | translations | |
| 16 | "n" <= "CONST of_nat n" | |
| 17 | "n" <= "CONST int n" | |
| 35115 | 18 | "n" <= "CONST real n" | 
| 30474 | 19 | "n" <= "CONST real_of_nat n" | 
| 20 | "n" <= "CONST real_of_int n" | |
| 30502 | 21 | "n" <= "CONST of_real n" | 
| 22 | "n" <= "CONST complex_of_real n" | |
| 30474 | 23 | |
| 15469 | 24 | (* append *) | 
| 25 | syntax (latex output) | |
| 35115 | 26 | "_appendL" :: "'a list \<Rightarrow> 'a list \<Rightarrow> 'a list" (infixl "\<^raw:\isacharat>" 65) | 
| 15469 | 27 | translations | 
| 35115 | 28 | "_appendL xs ys" <= "xs @ ys" | 
| 29 | "_appendL (_appendL xs ys) zs" <= "_appendL xs (_appendL ys zs)" | |
| 15469 | 30 | |
| 31 | ||
| 32891 | 32 | (* deprecated, use thm with style instead, will be removed *) | 
| 15469 | 33 | (* aligning equations *) | 
| 21210 | 34 | notation (tab output) | 
| 38864 
4abe644fcea5
formerly unnamed infix equality now named HOL.eq
 haftmann parents: 
35250diff
changeset | 35 |   "HOL.eq"  ("(_) \<^raw:}\putisatab\isa{\ >=\<^raw:}\putisatab\isa{> (_)" [50,49] 50) and
 | 
| 56245 | 36 |   "Pure.eq"  ("(_) \<^raw:}\putisatab\isa{\ >\<equiv>\<^raw:}\putisatab\isa{> (_)")
 | 
| 15469 | 37 | |
| 38 | (* Let *) | |
| 39 | translations | |
| 35250 | 40 | "_bind (p, CONST DUMMY) e" <= "_bind p (CONST fst e)" | 
| 41 | "_bind (CONST DUMMY, p) e" <= "_bind p (CONST snd e)" | |
| 15469 | 42 | |
| 43 | "_tuple_args x (_tuple_args y z)" == | |
| 44 | "_tuple_args x (_tuple_arg (_tuple y z))" | |
| 45 | ||
| 35250 | 46 | "_bind (CONST Some p) e" <= "_bind p (CONST the e)" | 
| 47 | "_bind (p # CONST DUMMY) e" <= "_bind p (CONST hd e)" | |
| 48 | "_bind (CONST DUMMY # p) e" <= "_bind p (CONST tl e)" | |
| 15469 | 49 | |
| 29494 | 50 | (* type constraints with spacing *) | 
| 55038 
f2179be64805
prefer Isar commands over old-fashioned ML (see also a189c6274c7a);
 wenzelm parents: 
42297diff
changeset | 51 | |
| 
f2179be64805
prefer Isar commands over old-fashioned ML (see also a189c6274c7a);
 wenzelm parents: 
42297diff
changeset | 52 | no_syntax (xsymbols output) | 
| 
f2179be64805
prefer Isar commands over old-fashioned ML (see also a189c6274c7a);
 wenzelm parents: 
42297diff
changeset | 53 |   "_constrain" :: "logic => type => logic"  ("_\<Colon>_" [4, 0] 3)
 | 
| 
f2179be64805
prefer Isar commands over old-fashioned ML (see also a189c6274c7a);
 wenzelm parents: 
42297diff
changeset | 54 |   "_constrain" :: "prop' => type => prop'"  ("_\<Colon>_" [4, 0] 3)
 | 
| 
f2179be64805
prefer Isar commands over old-fashioned ML (see also a189c6274c7a);
 wenzelm parents: 
42297diff
changeset | 55 | |
| 
f2179be64805
prefer Isar commands over old-fashioned ML (see also a189c6274c7a);
 wenzelm parents: 
42297diff
changeset | 56 | syntax (xsymbols output) | 
| 
f2179be64805
prefer Isar commands over old-fashioned ML (see also a189c6274c7a);
 wenzelm parents: 
42297diff
changeset | 57 |   "_constrain" :: "logic => type => logic"  ("_ \<Colon> _" [4, 0] 3)
 | 
| 
f2179be64805
prefer Isar commands over old-fashioned ML (see also a189c6274c7a);
 wenzelm parents: 
42297diff
changeset | 58 |   "_constrain" :: "prop' => type => prop'"  ("_ \<Colon> _" [4, 0] 3)
 | 
| 
f2179be64805
prefer Isar commands over old-fashioned ML (see also a189c6274c7a);
 wenzelm parents: 
42297diff
changeset | 59 | |
| 29494 | 60 | |
| 61 | (* sorts as intersections *) | |
| 55038 
f2179be64805
prefer Isar commands over old-fashioned ML (see also a189c6274c7a);
 wenzelm parents: 
42297diff
changeset | 62 | |
| 
f2179be64805
prefer Isar commands over old-fashioned ML (see also a189c6274c7a);
 wenzelm parents: 
42297diff
changeset | 63 | syntax (xsymbols output) | 
| 
f2179be64805
prefer Isar commands over old-fashioned ML (see also a189c6274c7a);
 wenzelm parents: 
42297diff
changeset | 64 |   "_topsort" :: "sort"  ("\<top>" 1000)
 | 
| 
f2179be64805
prefer Isar commands over old-fashioned ML (see also a189c6274c7a);
 wenzelm parents: 
42297diff
changeset | 65 |   "_sort" :: "classes => sort"  ("'(_')" 1000)
 | 
| 
f2179be64805
prefer Isar commands over old-fashioned ML (see also a189c6274c7a);
 wenzelm parents: 
42297diff
changeset | 66 |   "_classes" :: "id => classes => classes"  ("_ \<inter> _" 1000)
 | 
| 
f2179be64805
prefer Isar commands over old-fashioned ML (see also a189c6274c7a);
 wenzelm parents: 
42297diff
changeset | 67 |   "_classes" :: "longid => classes => classes"  ("_ \<inter> _" 1000)
 | 
| 15469 | 68 | |
| 15476 | 69 | end | 
| 70 | (*>*) |