src/HOL/Induct/Perm.thy
author paulson
Wed May 07 12:50:26 1997 +0200 (1997-05-07)
changeset 3120 c58423c20740
child 8354 c02e3c131eca
permissions -rw-r--r--
New directory to contain examples of (co)inductive definitions
paulson@3120
     1
(*  Title:      HOL/ex/Perm.thy
paulson@3120
     2
    ID:         $Id$
paulson@3120
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
paulson@3120
     4
    Copyright   1995  University of Cambridge
paulson@3120
     5
paulson@3120
     6
Permutations: example of an inductive definition
paulson@3120
     7
*)
paulson@3120
     8
paulson@3120
     9
Perm = List +
paulson@3120
    10
paulson@3120
    11
consts  perm    :: "('a list * 'a list) set"   
paulson@3120
    12
syntax "@perm"  :: ['a list, 'a list] => bool ("_ <~~> _"  [50,50] 50)
paulson@3120
    13
paulson@3120
    14
translations
paulson@3120
    15
    "x <~~> y" == "(x,y) : perm"
paulson@3120
    16
paulson@3120
    17
inductive perm
paulson@3120
    18
  intrs
paulson@3120
    19
    Nil   "[] <~~> []"
paulson@3120
    20
    swap  "y#x#l <~~> x#y#l"
paulson@3120
    21
    Cons  "xs <~~> ys ==> z#xs <~~> z#ys"
paulson@3120
    22
    trans "[| xs <~~> ys;  ys <~~> zs |] ==> xs <~~> zs"
paulson@3120
    23
paulson@3120
    24
end