Nominal/Ex/LetFun.thy
changeset 2454 9ffee4eb1ae1
child 2475 486d4647bb37
equal deleted inserted replaced
2453:2f47291b6ff9 2454:9ffee4eb1ae1
       
     1 theory LetFun
       
     2 imports "../Nominal2"
       
     3 begin
       
     4 
       
     5 atom_decl name
       
     6 
       
     7 (* x is bound in both e1 and e2
       
     8    names in p are bound only in e1 *)
       
     9 
       
    10 nominal_datatype exp =
       
    11   Var name
       
    12 | Pair exp exp
       
    13 | LetRec x::name p::pat e1::exp e2::exp  bind x in e2, bind x "bp p" in e1
       
    14 and pat =
       
    15   PVar name
       
    16 | PUnit
       
    17 | PPair pat pat
       
    18 binder
       
    19   bp :: "pat \<Rightarrow> atom list"
       
    20 where
       
    21   "bp (PVar x) = [atom x]"
       
    22 | "bp (PUnit) = []"
       
    23 | "bp (PPair p1 p2) = bp p1 @ bp p2"
       
    24 
       
    25 end