diff -r 46f59511b7bb -r d97fdabd9e2b src/HOL/Nominal/Examples/Class1.thy --- a/src/HOL/Nominal/Examples/Class1.thy Fri Sep 20 19:07:10 2024 +0200 +++ b/src/HOL/Nominal/Examples/Class1.thy Fri Sep 20 19:51:08 2024 +0200 @@ -8,14 +8,14 @@ text \types\ -no_notation not ("NOT") +no_notation not (\NOT\) nominal_datatype ty = PR "string" | NOT "ty" - | AND "ty" "ty" ("_ AND _" [100,100] 100) - | OR "ty" "ty" ("_ OR _" [100,100] 100) - | IMP "ty" "ty" ("_ IMP _" [100,100] 100) + | AND "ty" "ty" (\_ AND _\ [100,100] 100) + | OR "ty" "ty" (\_ OR _\ [100,100] 100) + | IMP "ty" "ty" (\_ IMP _\ [100,100] 100) instantiation ty :: size begin @@ -50,30 +50,30 @@ nominal_datatype trm = Ax "name" "coname" - | Cut "\coname\trm" "\name\trm" ("Cut <_>._ ('(_'))._" [0,0,0,100] 101) - | NotR "\name\trm" "coname" ("NotR ('(_'))._ _" [0,100,100] 101) - | NotL "\coname\trm" "name" ("NotL <_>._ _" [0,100,100] 101) - | AndR "\coname\trm" "\coname\trm" "coname" ("AndR <_>._ <_>._ _" [0,100,0,100,100] 101) - | AndL1 "\name\trm" "name" ("AndL1 (_)._ _" [100,100,100] 101) - | AndL2 "\name\trm" "name" ("AndL2 (_)._ _" [100,100,100] 101) - | OrR1 "\coname\trm" "coname" ("OrR1 <_>._ _" [100,100,100] 101) - | OrR2 "\coname\trm" "coname" ("OrR2 <_>._ _" [100,100,100] 101) - | OrL "\name\trm" "\name\trm" "name" ("OrL (_)._ (_)._ _" [100,100,100,100,100] 101) - | ImpR "\name\(\coname\trm)" "coname" ("ImpR (_).<_>._ _" [100,100,100,100] 101) - | ImpL "\coname\trm" "\name\trm" "name" ("ImpL <_>._ (_)._ _" [100,100,100,100,100] 101) + | Cut "\coname\trm" "\name\trm" (\Cut <_>._ ('(_'))._\ [0,0,0,100] 101) + | NotR "\name\trm" "coname" (\NotR ('(_'))._ _\ [0,100,100] 101) + | NotL "\coname\trm" "name" (\NotL <_>._ _\ [0,100,100] 101) + | AndR "\coname\trm" "\coname\trm" "coname" (\AndR <_>._ <_>._ _\ [0,100,0,100,100] 101) + | AndL1 "\name\trm" "name" (\AndL1 (_)._ _\ [100,100,100] 101) + | AndL2 "\name\trm" "name" (\AndL2 (_)._ _\ [100,100,100] 101) + | OrR1 "\coname\trm" "coname" (\OrR1 <_>._ _\ [100,100,100] 101) + | OrR2 "\coname\trm" "coname" (\OrR2 <_>._ _\ [100,100,100] 101) + | OrL "\name\trm" "\name\trm" "name" (\OrL (_)._ (_)._ _\ [100,100,100,100,100] 101) + | ImpR "\name\(\coname\trm)" "coname" (\ImpR (_).<_>._ _\ [100,100,100,100] 101) + | ImpL "\coname\trm" "\name\trm" "name" (\ImpL <_>._ (_)._ _\ [100,100,100,100,100] 101) text \named terms\ -nominal_datatype ntrm = Na "\name\trm" ("((_):_)" [100,100] 100) +nominal_datatype ntrm = Na "\name\trm" (\((_):_)\ [100,100] 100) text \conamed terms\ -nominal_datatype ctrm = Co "\coname\trm" ("(<_>:_)" [100,100] 100) +nominal_datatype ctrm = Co "\coname\trm" (\(<_>:_)\ [100,100] 100) text \renaming functions\ nominal_primrec (freshness_context: "(d::coname,e::coname)") - crename :: "trm \ coname \ coname \ trm" ("_[_\c>_]" [100,0,0] 100) + crename :: "trm \ coname \ coname \ trm" (\_[_\c>_]\ [100,0,0] 100) where "(Ax x a)[d\c>e] = (if a=d then Ax x e else Ax x a)" | "\a\(d,e,N);x\M\ \ (Cut .M (x).N)[d\c>e] = Cut .(M[d\c>e]) (x).(N[d\c>e])" @@ -92,7 +92,7 @@ by(finite_guess | simp add: abs_fresh abs_supp fin_supp | fresh_guess)+ nominal_primrec (freshness_context: "(u::name,v::name)") - nrename :: "trm \ name \ name \ trm" ("_[_\n>_]" [100,0,0] 100) + nrename :: "trm \ name \ name \ trm" (\_[_\n>_]\ [100,0,0] 100) where "(Ax x a)[u\n>v] = (if x=u then Ax v a else Ax x a)" | "\a\N;x\(u,v,M)\ \ (Cut .M (x).N)[u\n>v] = Cut .(M[u\n>v]) (x).(N[u\n>v])" @@ -610,7 +610,7 @@ qed nominal_primrec (freshness_context: "(y::name,c::coname,P::trm)") - substn :: "trm \ name \ coname \ trm \ trm" ("_{_:=<_>._}" [100,100,100,100] 100) + substn :: "trm \ name \ coname \ trm \ trm" (\_{_:=<_>._}\ [100,100,100,100] 100) where "(Ax x a){y:=.P} = (if x=y then Cut .P (y).Ax y a else Ax x a)" | "\a\(c,P,N);x\(y,P,M)\ \ (Cut .M (x).N){y:=.P} = @@ -673,7 +673,7 @@ done nominal_primrec (freshness_context: "(d::name,z::coname,P::trm)") - substc :: "trm \ coname \ name \ trm \ trm" ("_{_:=('(_'))._}" [100,0,0,100] 100) + substc :: "trm \ coname \ name \ trm \ trm" (\_{_:=('(_'))._}\ [100,0,0,100] 100) where "(Ax x a){d:=(z).P} = (if d=a then Cut .(Ax x a) (z).P else Ax x a)" | "\a\(d,P,N);x\(z,P,M)\ \ (Cut .M (x).N){d:=(z).P} = @@ -2423,7 +2423,7 @@ qed (use fic_rest_elims in force)+ inductive - l_redu :: "trm \ trm \ bool" ("_ \\<^sub>l _" [100,100] 100) + l_redu :: "trm \ trm \ bool" (\_ \\<^sub>l _\ [100,100] 100) where LAxR: "\x\M; a\b; fic M a\ \ Cut .M (x).(Ax x b) \\<^sub>l M[a\c>b]" | LAxL: "\a\M; x\y; fin M x\ \ Cut .(Ax y a) (x).M \\<^sub>l M[x\n>y]" @@ -3044,7 +3044,7 @@ inductive - c_redu :: "trm \ trm \ bool" ("_ \\<^sub>c _" [100,100] 100) + c_redu :: "trm \ trm \ bool" (\_ \\<^sub>c _\ [100,100] 100) where left[intro]: "\\fic M a; a\N; x\M\ \ Cut .M (x).N \\<^sub>c M{a:=(x).N}" | right[intro]: "\\fin N x; a\N; x\M\ \ Cut .M (x).N \\<^sub>c N{x:=.M}" @@ -3098,7 +3098,7 @@ by (induct rule: c_redu.induct) (auto simp: abs_fresh rename_fresh subst_fresh)+ inductive - a_redu :: "trm \ trm \ bool" ("_ \\<^sub>a _" [100,100] 100) + a_redu :: "trm \ trm \ bool" (\_ \\<^sub>a _\ [100,100] 100) where al_redu[intro]: "M\\<^sub>l M' \ M \\<^sub>a M'" | ac_redu[intro]: "M\\<^sub>c M' \ M \\<^sub>a M'" @@ -3477,7 +3477,7 @@ text \Transitive Closure\ abbreviation - a_star_redu :: "trm \ trm \ bool" ("_ \\<^sub>a* _" [80,80] 80) + a_star_redu :: "trm \ trm \ bool" (\_ \\<^sub>a* _\ [80,80] 80) where "M \\<^sub>a* M' \ (a_redu)\<^sup>*\<^sup>* M M'"