src/HOL/Library/OptionalSugar.thy
author wenzelm
Wed May 17 01:23:48 2006 +0200 (2006-05-17)
changeset 19674 22b635240905
parent 15476 b8cb20cc0c0b
child 21210 c17fd2df4e9e
permissions -rw-r--r--
const_syntax;
nipkow@15469
     1
(*  Title:      HOL/Library/OptionalSugar.thy
nipkow@15469
     2
    ID:         $Id$
nipkow@15469
     3
    Author:     Gerwin Klain, Tobias Nipkow
nipkow@15469
     4
    Copyright   2005 NICTA and TUM
nipkow@15469
     5
*)
nipkow@15476
     6
(*<*)
nipkow@15469
     7
theory OptionalSugar
nipkow@15469
     8
imports LaTeXsugar
nipkow@15469
     9
begin
nipkow@15469
    10
nipkow@15469
    11
(* append *)
nipkow@15469
    12
syntax (latex output)
nipkow@15469
    13
  "appendL" :: "'a list \<Rightarrow> 'a list \<Rightarrow> 'a list" (infixl "\<^raw:\isacharat>" 65)
nipkow@15469
    14
translations
nipkow@15469
    15
  "appendL xs ys" <= "xs @ ys" 
nipkow@15469
    16
  "appendL (appendL xs ys) zs" <= "appendL xs (appendL ys zs)"
nipkow@15469
    17
nipkow@15469
    18
nipkow@15469
    19
(* aligning equations *)
wenzelm@19674
    20
const_syntax (tab output)
wenzelm@19674
    21
  "op ="  ("(_) \<^raw:}\putisatab\isa{\ >=\<^raw:}\putisatab\isa{> (_)" [50,49] 50)
wenzelm@19674
    22
  "=="  ("(_) \<^raw:}\putisatab\isa{\ >\<equiv>\<^raw:}\putisatab\isa{> (_)")
nipkow@15469
    23
nipkow@15469
    24
(* Let *)
nipkow@15469
    25
translations 
nipkow@15469
    26
  "_bind (p,DUMMY) e" <= "_bind p (fst e)"
nipkow@15469
    27
  "_bind (DUMMY,p) e" <= "_bind p (snd e)"
nipkow@15469
    28
nipkow@15469
    29
  "_tuple_args x (_tuple_args y z)" ==
nipkow@15469
    30
    "_tuple_args x (_tuple_arg (_tuple y z))"
nipkow@15469
    31
nipkow@15469
    32
  "_bind (Some p) e" <= "_bind p (the e)"
nipkow@15469
    33
  "_bind (p#DUMMY) e" <= "_bind p (hd e)"
nipkow@15469
    34
  "_bind (DUMMY#p) e" <= "_bind p (tl e)"
nipkow@15469
    35
nipkow@15469
    36
nipkow@15476
    37
end
nipkow@15476
    38
(*>*)