GithubHelp home page GithubHelp logo

fxdpntthm / system-f-omega Goto Github PK

View Code? Open in Web Editor NEW

This project forked from andraskovacs/system-f-omega

0.0 0.0 0.0 653 KB

System F-omega normalization by hereditary substitution in Agda

Agda 100.00%

system-f-omega's Introduction

system-f-omega

An intrinsically typed formalization of impredicative System F-omega, plus its normalization by hereditary substitution.

The presentation follows Altenkirch and Keller, but we need significant extra machinery to adapt it to F-omega.

We need normalization and a large part of its correctness proof for types (which is essentially a simply typed lambda calculus) in order to be able to define the term operations in an intrinsically well-typed way. This consitutes the bulk of the line count of this project; I could've probably copied Altenkirch and Keller and written some proofs to glue it to System F-omega, but I considered it a valuable effort to redo it in a way that by default mirrors System F-omega term operations.

Note: normalization by evaluation would be a much simpler and more efficient solution for type normalization! I only did hereditary substitution for types because I wanted to understand and rewrite the Altenkirch-Keller proofs.

Most notably, what we don't have is a termination proof for term substitution. It eventually dawned on me that the main reason why hereditary substitution works for STLC is because applying a term to a spine is structurally recursive in the type of the term, and this is irreparably foiled in impredicative System F. Here, if a term has type ∀ (a : k) . t, if we apply it to t' : k the resultant type would be a t [a := t'] substitution, which isn't smaller than the starting type by any measure. For example, we can have id = Λ (a : ⋆). λ (x : a) . x with id : ∀ (a : *). a → a, and then id [∀ (a : *). a → a] id has the same type (definitionally) as id.

This setup would be amenable to simple termination proofs only for predicative or stratified System F, similarly to what's in the paper of Eades and Stump, and also Mangin and Sozeau.

However, eta expansion, renaming and type substition is still total (as certified by Agda) and hopefully useful. We also have a rather large chunk of the correctness proof for STLC's normalization, and we can play around with the F-omega normalization function.

system-f-omega's People

Contributors

andraskovacs avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.