Nominal Rewriting and Types Maribel Fern´ andez King’s College London Joint work with M.J. Gabbay and I. Mackie Maribel Fern´ andez Nominal Rewriting and Types
Motivations Rewrite rules can be used to define • equational theories, and theorem provers; • algebraic specifications of operators and data structures; • operational semantics of programs; • a theory of functions; • a theory of processes; • etc. Maribel Fern´ andez Nominal Rewriting and Types
Motivations Specifying binding operations — informal presentations: • Operational semantics: let a = N in M − → (fun a → M ) N α -conversion is implicit, but (fun a → M ) � = α (fun b → M ) since a may occur in M . Maribel Fern´ andez Nominal Rewriting and Types
Motivations Specifying binding operations — informal presentations: • Operational semantics: let a = N in M − → (fun a → M ) N • β and η -reductions in the λ -calculus: ( λ x . M ) N → M [ x / N ] → ( x �∈ fv( M )) ( λ x . Mx ) M α -conversion is implicit, but (fun a → M ) � = α (fun b → M ) since a may occur in M . Maribel Fern´ andez Nominal Rewriting and Types
Motivations Specifying binding operations — informal presentations: • Operational semantics: let a = N in M − → (fun a → M ) N • β and η -reductions in the λ -calculus: ( λ x . M ) N → M [ x / N ] → ( x �∈ fv( M )) ( λ x . Mx ) M • π -calculus: P | ν a . Q → ν a . ( P | Q ) ( a �∈ fv( P )) α -conversion is implicit, but (fun a → M ) � = α (fun b → M ) since a may occur in M . Maribel Fern´ andez Nominal Rewriting and Types
Motivations Specifying binding operations — informal presentations: • Operational semantics: let a = N in M − → (fun a → M ) N • β and η -reductions in the λ -calculus: ( λ x . M ) N → M [ x / N ] → ( x �∈ fv( M )) ( λ x . Mx ) M • π -calculus: P | ν a . Q → ν a . ( P | Q ) ( a �∈ fv( P )) • Logic equivalences: P and ( ∀ x . Q ) ⇔ ∀ x ( P and Q ) ( x �∈ fv( P )) α -conversion is implicit, but (fun a → M ) � = α (fun b → M ) since a may occur in M . Maribel Fern´ andez Nominal Rewriting and Types
Formally: Rewrite Systems There are several alternatives. • First-order rewrite systems. append ( nil , x ) → x → append ( cons ( x , z ) , y ) cons ( x , append ( z , y )) Maribel Fern´ andez Nominal Rewriting and Types
Formally: Rewrite Systems There are several alternatives. • First-order rewrite systems. append ( nil , x ) → x → append ( cons ( x , z ) , y ) cons ( x , append ( z , y )) ⇒ No binders. (-) Maribel Fern´ andez Nominal Rewriting and Types
Formally: Rewrite Systems There are several alternatives. • First-order rewrite systems. append ( nil , x ) → x → append ( cons ( x , z ) , y ) cons ( x , append ( z , y )) • No binders. (-) ⇒ First-order matching: we need to ’specify’ α -conversion. (-) Maribel Fern´ andez Nominal Rewriting and Types
Formally: Rewrite Systems There are several alternatives. • First-order rewrite systems. append ( nil , x ) → x → append ( cons ( x , z ) , y ) cons ( x , append ( z , y )) • No binders. (-) • First-order matching: we need to ’specify’ α -conversion. (-) ⇒ Simple notion of substitution. (+) Maribel Fern´ andez Nominal Rewriting and Types
Formally: Rewrite Systems There are several alternatives. • First-order rewrite systems. append ( nil , x ) → x → append ( cons ( x , z ) , y ) cons ( x , append ( z , y )) • No binders. (-) • First-order matching: we need to ’specify’ α -conversion. (-) • Simple notion of substitution. (+) • Algebraic λ -calculi: First-order rewriting + β -rule. Maribel Fern´ andez Nominal Rewriting and Types
Higher-order frameworks • Higher-order rewrite systems (CRS, HRS, etc.) β -rule: app ( lam ([ a ] Z ( a )) , Z ′ ) → Z ( Z ′ ) Then app ( lam ([ a ] f ( a , g ( a )) , b ) → f ( b , g ( b )) using higher-order matching. Maribel Fern´ andez Nominal Rewriting and Types
Higher-order frameworks • Higher-order rewrite systems (CRS, HRS, etc.) β -rule: app ( lam ([ a ] Z ( a )) , Z ′ ) → Z ( Z ′ ) Then app ( lam ([ a ] f ( a , g ( a )) , b ) → f ( b , g ( b )) using higher-order matching. • Higher-Order Abstract Syntax: let a = N in M ( a ) − → (fun a → M ( a )) N Maribel Fern´ andez Nominal Rewriting and Types
Higher-order frameworks • Higher-order rewrite systems (CRS, HRS, etc.) β -rule: app ( lam ([ a ] Z ( a )) , Z ′ ) → Z ( Z ′ ) Then app ( lam ([ a ] f ( a , g ( a )) , b ) → f ( b , g ( b )) using higher-order matching. • Higher-Order Abstract Syntax: let a = N in M ( a ) − → (fun a → M ( a )) N ⇒ Terms with binders. (+) Maribel Fern´ andez Nominal Rewriting and Types
Higher-order frameworks • Higher-order rewrite systems (CRS, HRS, etc.) β -rule: app ( lam ([ a ] Z ( a )) , Z ′ ) → Z ( Z ′ ) Then app ( lam ([ a ] f ( a , g ( a )) , b ) → f ( b , g ( b )) using higher-order matching. • Higher-Order Abstract Syntax: let a = N in M ( a ) − → (fun a → M ( a )) N • Terms with binders. (+) ⇒ Implicit α -equivalence. (+) Maribel Fern´ andez Nominal Rewriting and Types
Higher-order frameworks • Higher-order rewrite systems (CRS, HRS, etc.) β -rule: app ( lam ([ a ] Z ( a )) , Z ′ ) → Z ( Z ′ ) Then app ( lam ([ a ] f ( a , g ( a )) , b ) → f ( b , g ( b )) using higher-order matching. • Higher-Order Abstract Syntax: let a = N in M ( a ) − → (fun a → M ( a )) N • Terms with binders. (+) • Implicit α -equivalence. (+) ⇒ We targeted α but now we have to deal with β too. (-) Maribel Fern´ andez Nominal Rewriting and Types
Higher-order frameworks • Higher-order rewrite systems (CRS, HRS, etc.) β -rule: app ( lam ([ a ] Z ( a )) , Z ′ ) → Z ( Z ′ ) Then app ( lam ([ a ] f ( a , g ( a )) , b ) → f ( b , g ( b )) using higher-order matching. • Higher-Order Abstract Syntax: let a = N in M ( a ) − → (fun a → M ( a )) N • Terms with binders. (+) • Implicit α -equivalence. (+) • We targeted α but now we have to deal with β too. (-) ⇒ Substitution is a meta-operation using β . (-) Maribel Fern´ andez Nominal Rewriting and Types
Higher-order frameworks • Higher-order rewrite systems (CRS, HRS, etc.) β -rule: app ( lam ([ a ] Z ( a )) , Z ′ ) → Z ( Z ′ ) Then app ( lam ([ a ] f ( a , g ( a )) , b ) → f ( b , g ( b )) using higher-order matching. • Higher-Order Abstract Syntax: let a = N in M ( a ) − → (fun a → M ( a )) N • Terms with binders. (+) • Implicit α -equivalence. (+) • We targeted α but now we have to deal with β too. (-) • Substitution is a meta-operation using β . (-) ⇒ Unification is undecidable in general. (-) Maribel Fern´ andez Nominal Rewriting and Types
Higher-order frameworks • Higher-order rewrite systems (CRS, HRS, etc.) β -rule: app ( lam ([ a ] Z ( a )) , Z ′ ) → Z ( Z ′ ) Then app ( lam ([ a ] f ( a , g ( a )) , b ) → f ( b , g ( b )) using higher-order matching. • Higher-Order Abstract Syntax: let a = N in M ( a ) − → (fun a → M ( a )) N • Terms with binders. (+) • Implicit α -equivalence. (+) • We targeted α but now we have to deal with β too. (-) • Substitution is a meta-operation using β . (-) • Unification is undecidable in general. (-) ⇒ Leaving name dependencies implicit is convenient (e.g. ∀ x . P ). Maribel Fern´ andez Nominal Rewriting and Types
Nominal Rewriting Inspired by the work on Nominal Logic (Pitts et al.) Key ideas: Freshness conditions a # t , name swapping ( a b ) · t . Example: β and η rules as NRS: app ( lam ([ a ] Z ) , Z ′ ) → subst ([ a ] Z , Z ′ ) a # M ⊢ ( λ ([ a ] app ( M , a )) → M ⇒ Terms with binders. Maribel Fern´ andez Nominal Rewriting and Types
Nominal Rewriting Inspired by the work on Nominal Logic (Pitts et al.) Key ideas: Freshness conditions a # t , name swapping ( a b ) · t . Example: β and η rules as NRS: app ( lam ([ a ] Z ) , Z ′ ) → subst ([ a ] Z , Z ′ ) a # M ⊢ ( λ ([ a ] app ( M , a )) → M • Terms with binders. ⇒ Built-in α -equivalence. Maribel Fern´ andez Nominal Rewriting and Types
Nominal Rewriting Inspired by the work on Nominal Logic (Pitts et al.) Key ideas: Freshness conditions a # t , name swapping ( a b ) · t . Example: β and η rules as NRS: app ( lam ([ a ] Z ) , Z ′ ) → subst ([ a ] Z , Z ′ ) a # M ⊢ ( λ ([ a ] app ( M , a )) → M • Terms with binders. • Built-in α -equivalence. ⇒ Simple notion of substitution (first order). Maribel Fern´ andez Nominal Rewriting and Types
Nominal Rewriting Inspired by the work on Nominal Logic (Pitts et al.) Key ideas: Freshness conditions a # t , name swapping ( a b ) · t . Example: β and η rules as NRS: app ( lam ([ a ] Z ) , Z ′ ) → subst ([ a ] Z , Z ′ ) a # M ⊢ ( λ ([ a ] app ( M , a )) → M • Terms with binders. • Built-in α -equivalence. • Simple notion of substitution (first order). ⇒ Dependencies of terms on names are implicit. Maribel Fern´ andez Nominal Rewriting and Types
Recommend
More recommend