Nominal/Ex/Lambda_add.thy
author Cezary Kaliszyk <kaliszyk@in.tum.de>
Fri, 24 Jun 2011 11:14:58 +0900
changeset 2896 59be22e05a0a
parent 2752 9f44608ea28d
permissions -rw-r--r--
The examples in Lambda_add can be defined by nominal_function directly

theory Lambda_add
imports "Lambda"
begin

nominal_primrec
  addlam :: "lam \<Rightarrow> lam"
where
  "fv \<noteq> x \<Longrightarrow> addlam (Var x) = Lam [fv]. App (Var fv) (Var x)"
| "addlam (App t1 t2) = App t1 t2"
| "addlam (Lam [x]. t) = Lam [x].t"
  unfolding addlam_graph_def eqvt_def
  apply perm_simp
  apply auto
  apply (case_tac x rule: lam.exhaust)
  apply auto
  apply (rule_tac x="name" and ?'a="name" in obtain_fresh)
  apply (simp add: fresh_at_base)
  apply (simp add: Abs1_eq_iff lam.fresh fresh_at_base)
  done

termination by lexicographic_order

end