diff -r 998d6b491003 -r dd4d05587bd0 Quot/Nominal/Terms.thy --- a/Quot/Nominal/Terms.thy Thu Feb 11 16:54:04 2010 +0100 +++ b/Quot/Nominal/Terms.thy Thu Feb 11 17:58:06 2010 +0100 @@ -1194,14 +1194,12 @@ -atom_decl name2 - datatype rfoo8 = Foo0 "name" | Foo1 "rbar8" "rfoo8" --"bind bv(bar) in foo" and rbar8 = - Bar0 "name2" -| Bar1 "name" "name2" "rbar8" --"bind second name in b" + Bar0 "name" +| Bar1 "name" "name" "rbar8" --"bind second name in b" primrec rbv8 @@ -1268,6 +1266,115 @@ + +datatype rlam9 = + Var9 "name" +| Lam9 "name" "rlam9" --"bind name in rlam" +and rbla9 = + Bla9 "rlam9" "rlam9" --"bind bv(first) in second" + +primrec + rbv9 +where + "rbv9 (Var9 x) = {}" +| "rbv9 (Lam9 x b) = {atom x}" + +primrec + rfv_lam9 and rfv_bla9 +where + "rfv_lam9 (Var9 x) = {atom x}" +| "rfv_lam9 (Lam9 b t) = (rfv_lam9 t - {atom b})" +| "rfv_bla9 (Bla9 l r) = (rfv_lam9 r - rbv9 l) \ rfv_lam9 l" + +instantiation + rlam9 and rbla9 :: pt +begin + +primrec + permute_rlam9 and permute_rbla9 +where + "permute_rlam9 pi (Var9 a) = Var9 (pi \ a)" +| "permute_rlam9 pi (Lam9 b t) = Lam9 (pi \ b) (permute_rlam9 pi t)" +| "permute_rbla9 pi (Bla9 l r) = Bla9 (permute_rlam9 pi l) (permute_rlam9 pi r)" + +instance sorry + +end + +inductive + alpha9l :: "rlam9 \ rlam9 \ bool" ("_ \9l _" [100, 100] 100) +and + alpha9b :: "rbla9 \ rbla9 \ bool" ("_ \9b _" [100, 100] 100) +where + a1: "a = b \ (Var9 a) \9l (Var9 b)" +| a4: "(\pi. (({atom x1}, t1) \gen alpha9l rfv_lam9 pi ({atom x2}, t2))) \ Lam9 x1 t1 \9l Lam9 x2 t2" +| a3: "b1 \9l b2 \ (\pi. (((rbv9 b1), t1) \gen alpha9l rfv_lam9 pi ((rbv9 b2), t2))) \ Bla9 b1 t1 \9b Bla9 b2 t2" + +quotient_type + lam9 = rlam9 / alpha9l and bla9 = rbla9 / alpha9b +sorry + +quotient_definition + "qVar9 :: name \ lam9" +as + "Var9" + +quotient_definition + "qLam :: name \ lam9 \ lam9" +as + "Lam9" + +quotient_definition + "qBla9 :: lam9 \ lam9 \ bla9" +as + "Bla9" + +quotient_definition + "fv_lam9 :: lam9 \ atom set" +as + "rfv_lam9" + +quotient_definition + "fv_bla9 :: bla9 \ atom set" +as + "rfv_bla9" + +quotient_definition + "bv9 :: lam9 \ atom set" +as + "rbv9" + +instantiation lam9 and bla9 :: pt +begin + +quotient_definition + "permute_lam9 :: perm \ lam9 \ lam9" +as + "permute :: perm \ rlam9 \ rlam9" + +quotient_definition + "permute_bla9 :: perm \ bla9 \ bla9" +as + "permute :: perm \ rbla9 \ rbla9" + +instance +sorry + +end + +lemma "\b1 = b2; \pi. fv_lam9 t1 - bv9 b1 = fv_lam9 t2 - bv9 b2 \ (fv_lam9 t1 - bv9 b1) \* pi \ pi \ t1 = t2\ + \ qBla9 b1 t1 = qBla9 b2 t2" +apply (lifting a3[unfolded alpha_gen]) +apply injection +sorry + + + + + + + + text {* type schemes *} datatype ty = Var "name"