Nominal Rewriting and Unification Theory

Nominal Rewriting and Unification Theory

Nominal Rewriting and Unification Theory Maribel Fern´andez FoPSS 2019 Maribel Fern´andez Nominal Rewriting and Unification Theory Nominal Rewriting and Unification Theory Introduction First-order languages • Languages with binding operators • Specifying binders: ↵-equivalence • Nominal terms • Nominal unification (unification modulo ↵-equivalence) • Nominal matching (matching modulo ↵-equivalence) • Nominal rewriting Extending first-order rewriting to specify binding operators • Closed rewriting • Confluence • Typed Rewriting Systems • Equational Axioms: AC operators • Maribel Fern´andez Nominal Rewriting and Unification Theory Further reading C. Urban, A. Pitts, M.J. Gabbay. Nominal Unification. • Theoretical Computer Science 323, pages 473-497, 2004. C. Calv`es, M. Fern´andez. Matching and Alpha-Equivalence • Check for Nominal Terms. Journal of Computer and System Sciences, 2010. M. Ayala-Rinc´on, M. Fern´andez, D. Nantes-Sobrinho. • Fixed-Point Constraints for Nominal Equational Unification. Proceedings of FSCD 2018, LIPICS. M. Fern´andez, M.J. Gabbay. Nominal Rewriting. Information • and Computation 205, pages 917-965, 2007. J. Dominguez, M. Fern´andez. Nominal Syntax with Atom • Substitution: Matching, Unification, Rewriting. Proceedings of FCT 2019, Lecture Notes in Computer Science, Springer. E. Fairweather, M. Fern´andez. Typed Nominal Rewriting. • ACM Transactions on Computational Logic, 2018. Maribel Fern´andez Nominal Rewriting and Unification Theory First-order languages vs. languages with binders Most programming languages support first-order data structures and first-order operators. Examples of first-order data structures: numbers, lists, trees, etc. First-order operator on lists: append(nil, x) x ! append(cons(x, z), y) cons(x, append(z, y)) ! Very few programming languages support data structures with binding constructs. However, in many situations, we need to manipulate data with bound names. Example: compilers, type checkers, code optimisation, etc. Maribel Fern´andez Nominal Rewriting and Unification Theory β and ⌘-reductions in the λ-calculus: • (λx.M)N M[x/N] ! (λx.Mx) M (x fv(M)) ! 62 ⇡-calculus: • P ⌫a.Q ⌫a.(P Q)(a fv(P)) | ! | 62 Logic equivalences: • Pand( x.Q) x(PandQ)(x fv(P)) 8 ,8 62 Binding operators: Examples Some concrete examples of binding constructs (informally): Operational semantics: • let a = N in M (fun a.M)N ! Maribel Fern´andez Nominal Rewriting and Unification Theory ⇡-calculus: • P ⌫a.Q ⌫a.(P Q)(a fv(P)) | ! | 62 Logic equivalences: • Pand( x.Q) x(PandQ)(x fv(P)) 8 ,8 62 Binding operators: Examples Some concrete examples of binding constructs (informally): Operational semantics: • let a = N in M (fun a.M)N ! β and ⌘-reductions in the λ-calculus: • (λx.M)N M[x/N] ! (λx.Mx) M (x fv(M)) ! 62 Maribel Fern´andez Nominal Rewriting and Unification Theory Logic equivalences: • Pand( x.Q) x(PandQ)(x fv(P)) 8 ,8 62 Binding operators: Examples Some concrete examples of binding constructs (informally): Operational semantics: • let a = N in M (fun a.M)N ! β and ⌘-reductions in the λ-calculus: • (λx.M)N M[x/N] ! (λx.Mx) M (x fv(M)) ! 62 ⇡-calculus: • P ⌫a.Q ⌫a.(P Q)(a fv(P)) | ! | 62 Maribel Fern´andez Nominal Rewriting and Unification Theory Binding operators: Examples Some concrete examples of binding constructs (informally): Operational semantics: • let a = N in M (fun a.M)N ! β and ⌘-reductions in the λ-calculus: • (λx.M)N M[x/N] ! (λx.Mx) M (x fv(M)) ! 62 ⇡-calculus: • P ⌫a.Q ⌫a.(P Q)(a fv(P)) | ! | 62 Logic equivalences: • Pand( x.Q) x(PandQ)(x fv(P)) 8 ,8 62 Maribel Fern´andez Nominal Rewriting and Unification Theory Binding operators - ↵-equivalence Terms are defined modulo renaming of bound variables,i.e., ↵-equivalence. Example: In x.P the variable x can be renamed (avoiding name capture) 8 x.P = y.P x y 8 ↵ 8 { 7! } How can we formally define (or program) binding operators? There are several alternatives. Maribel Fern´andez Nominal Rewriting and Unification Theory Efficient matching and unification algorithms (+) • No binders (-) • We need to ’implement’ ↵-equivalence and non-capturing • substitution from scratch (-) For example, we can encode a system with binders such as the • lambda-calculus using numbers to represent bound variables and operators such as “lift” and “shift” to encode non-capturing substitution (cf. De Bruijn’s notation) First-order frameworks We can encode ↵-equivalence in a first-order specification or programming language. Simple notion of substitution (first-order) (+) ) Maribel Fern´andez Nominal Rewriting and Unification Theory No binders (-) • We need to ’implement’ ↵-equivalence and non-capturing • substitution from scratch (-) For example, we can encode a system with binders such as the • lambda-calculus using numbers to represent bound variables and operators such as “lift” and “shift” to encode non-capturing substitution (cf. De Bruijn’s notation) First-order frameworks We can encode ↵-equivalence in a first-order specification or programming language. Simple notion of substitution (first-order) (+) • Efficient matching and unification algorithms (+) ) Maribel Fern´andez Nominal Rewriting and Unification Theory We need to ’implement’ ↵-equivalence and non-capturing • substitution from scratch (-) For example, we can encode a system with binders such as the • lambda-calculus using numbers to represent bound variables and operators such as “lift” and “shift” to encode non-capturing substitution (cf. De Bruijn’s notation) First-order frameworks We can encode ↵-equivalence in a first-order specification or programming language. Simple notion of substitution (first-order) (+) • Efficient matching and unification algorithms (+) • No binders (-) ) Maribel Fern´andez Nominal Rewriting and Unification Theory For example, we can encode a system with binders such as the • lambda-calculus using numbers to represent bound variables and operators such as “lift” and “shift” to encode non-capturing substitution (cf. De Bruijn’s notation) First-order frameworks We can encode ↵-equivalence in a first-order specification or programming language. Simple notion of substitution (first-order) (+) • Efficient matching and unification algorithms (+) • No binders (-) • We need to ’implement’ ↵-equivalence and non-capturing ) substitution from scratch (-) Maribel Fern´andez Nominal Rewriting and Unification Theory First-order frameworks We can encode ↵-equivalence in a first-order specification or programming language. Simple notion of substitution (first-order) (+) • Efficient matching and unification algorithms (+) • No binders (-) • We need to ’implement’ ↵-equivalence and non-capturing • substitution from scratch (-) For example, we can encode a system with binders such as the ) lambda-calculus using numbers to represent bound variables and operators such as “lift” and “shift” to encode non-capturing substitution (cf. De Bruijn’s notation) Maribel Fern´andez Nominal Rewriting and Unification Theory Logical frameworks based on Higher-Order Abstract Syntax • also work modulo ↵-equivalence. let a = N in M(a) (fun a M(a))N ! ! Higher-order frameworks Higher-order rewrite systems (CRS, HRS, etc.) include a • general binding construct and terms are defined modulo ↵-equivalence. Example: β-rule app(lam([a]Z(a)), Z 0) Z(Z 0) ! One step of rewriting: app(lam([a]f (a, g(a)), b) f (b, g(b)) ! using (a restriction of) higher-order matching. Maribel Fern´andez Nominal Rewriting and Unification Theory Higher-order frameworks Higher-order rewrite systems (CRS, HRS, etc.) include a • general binding construct and terms are defined modulo ↵-equivalence. Example: β-rule app(lam([a]Z(a)), Z 0) Z(Z 0) ! One step of rewriting: app(lam([a]f (a, g(a)), b) f (b, g(b)) ! using (a restriction of) higher-order matching. Logical frameworks based on Higher-Order Abstract Syntax • also work modulo ↵-equivalence. let a = N in M(a) (fun a M(a))N ! ! Maribel Fern´andez Nominal Rewriting and Unification Theory 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. • let a = N in M vs. let a = N in M(a) app(lambda[a]Z, Z 0)vs. app(lam([a]Z(a)), Z 0). Higher-order frameworks The syntax includes binders (+) ) Maribel Fern´andez Nominal Rewriting and Unification Theory 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. • let a = N in M vs. let a = N in M(a) app(lambda[a]Z, Z 0)vs. app(lam([a]Z(a)), Z 0). Higher-order frameworks The syntax includes binders (+) • Implicit ↵-equivalence (+) ) Maribel Fern´andez Nominal Rewriting and Unification Theory Substitution is a meta-operation using β (-) • Unification is undecidable in general (-) • Leaving name dependencies implicit is convenient, e.g. • let a = N in M vs. let a = N in M(a) app(lambda[a]Z, Z 0)vs. app(lam([a]Z(a)), Z 0). Higher-order frameworks The syntax includes binders (+) • Implicit ↵-equivalence (+) • We targeted ↵ but now we have to deal with β too (-) ) Maribel Fern´andez Nominal Rewriting and Unification Theory Unification is undecidable in general (-) • Leaving name dependencies implicit is convenient, e.g. • let a = N in M vs. let a = N in M(a) app(lambda[a]Z, Z 0)vs. app(lam([a]Z(a)), Z 0). Higher-order frameworks The syntax includes binders (+) • Implicit ↵-equivalence (+) • We targeted ↵ but now we have to deal with β too (-) • Substitution is a meta-operation using β (-) ) Maribel Fern´andez

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    160 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us