GithubHelp home page GithubHelp logo

tamingmerge's Introduction

Coq Formalization

Taming the Merge Operator: A Type-Directed Operational Semantics Approach

  • simple/coq/ for Coq formalization of the λi calculus
  • simple/spec/ for Ott specification of the λi calculus
  • plus/coq/ for Coq formalization of the λi+ calculus
  • plus/spec/ for Ott specification of the λi+ calculus

Building Instructions

Our Coq proofs are verified in Coq 8.11.1. We rely on two Coq libraries: metalib for the locally nameless representation in our proofs; and LibTactics.v, which is included in the directory.

Prerequisites

  1. Install Coq 8.11.1. The recommended way to install Coq is via OPAM. Refer to here for detailed steps. Or one could download the pre-built packages for Windows and MacOS via here. Choose a suitable installer according to your platform.

  2. Make sure Coq is installed (type coqc in the terminal, if you see "command not found" this means you have not properly installed Coq), then install Metalib:

    1. Open terminal
    2. git clone https://github.com/plclub/metalib
    3. cd metalib/Metalib
    4. Make sure the version is correct by git checkout 04b7aeaf82ceb7e00e1e456fc9fea20a85e09f6f
    5. make install

Build and Compile the Proofs

  1. Enter either simple/coq/ or plus/coq/directory.

  2. Type make in the terminal to build and compile the proofs.

  3. You should see something like the following (suppose > is the prompt):

    coq_makefile -arg '-w -variable-collision,-meta-collision,-require-in-module' -f _CoqProject -o CoqSrc.mk
    COQDEP VFILES
    COQC LibTactics.v
    COQC syntax_ott.v
    COQC rules_inf.v
    COQC Subtyping_inversion.v
    COQC Infrastructure.v
    COQC Deterministic.v
    COQC Type_Safety.v
  4. syntax_ott.v, rules_inf.v, and rules_inf2.v (in simple/coq/) are generated by Ott and LNgen. Run make ottclean to remove them. Then make can reproduce the code (with Ott and LNgen installed).

Proof Structure

  • syntax_ott.v contains the locally nameless definitions of the calculi and Dunfield's calculus. It involves the typing and semantics of the calculi, the semantics of Dunfield's calculus, and the typing of lambdai (icfp2016). One unified definition of type is used. The last two share the same set of expressions (dexp).
  • rules_inf.v (and rules_inf2.v) contains the lngen generated code.
  • Infrastructure.v contains the type systems of the calculi and some lemmas.
  • Subtyping_inversion.v contains some properties of the subtyping relation.
  • Key_properties.v constains some necessary lemmas about typed reduction, top-like relation and disjointness.
  • Deterministic.v contains the proofs of the determinism property.
  • Type_Safety.v contains the proofs of the type preservation and progress properties.
  • dunfield.v (in simple/coq/) contains the proofs of the soundness theorem with respect to Dunfield's calculus.
  • icfp.v(in simple/coq/) contains the proofs of the completeness theorem with respect to lambdai (icfp2016).

tamingmerge's People

Contributors

xsnow 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.