Nominal/Ex/Lambda.thy
changeset 2784 61384946ba2c
parent 2779 3c769bf10e63
child 2787 1a6593bc494d
equal deleted inserted replaced
2783:8412c7e503d4 2784:61384946ba2c
     1 theory Lambda
     1 theory Lambda
     2 imports "../Nominal2" 
     2 imports "../Nominal2" 
     3 begin
     3 begin
     4 
     4 
     5 inductive
     5 
     6   even :: "nat \<Rightarrow> bool" and
     6 (* inductive_cases do not simplify with simple equations *)
     7   odd  :: "nat \<Rightarrow> bool"
     7 atom_decl var
     8 where
     8 nominal_datatype expr =
     9   "even 0"
     9   eCnst nat
    10 | "odd n \<Longrightarrow> even (Suc n)"
    10 | eVar nat
    11 | "even n \<Longrightarrow> odd (Suc n)"
    11 
    12 
    12 inductive 
    13 thm even_odd_def
    13   eval :: "expr \<Rightarrow> nat \<Rightarrow> bool"
    14 
    14 where
    15 lemma
    15   evCnst: "eval (eCnst c) 0"
    16   shows "p \<bullet> (even n) = even (p \<bullet> n)"
    16 | evVar: "eval (eVar n) 2"
    17 unfolding even_def
    17 
    18 unfolding even_odd_def
    18 inductive_cases 
    19 apply(perm_simp)
    19   evInv_Cnst: "eval (eCnst c) m"
    20 apply(rule refl)
    20 
    21 done
    21 thm evInv_Cnst[simplified expr.distinct expr.eq_iff]
       
    22 
    22 
    23 
    23 atom_decl name
    24 atom_decl name
    24 
    25 
    25 nominal_datatype lam =
    26 nominal_datatype lam =
    26   Var "name"
    27   Var "name"