Giter VIP home page Giter VIP logo

silex-proofs's Introduction

Proving silex correct

Coq Proofs on Lexing with Derivatives and Zippers

This project is a collection of Coq proofs showing the correctness of the approach taken by the silex lexing library. The lexing algorithm of silex is based on a novel combination of Brzozowski's derivatives and Huet's zippers. In this approach, regular expressions and their derivatives are represented as zippers. Each zipper is a set, which represents a disjunction of contexts. Contexts are themselves sequences of regular expressions, represented as lists.

The first main result is that Brzozowski's derivation adapted to zippers is correct with respect to regular expressions' semantics (Zippers.v, line 584).

Theorem derive_correct : forall z c w,
  zipper_matches z (c :: w) <->
  zipper_matches (derive c z) w.

The correctness of the recogniser follows almost immediately after (Zippers.v, line 684).

Theorem accepts_correct : forall e w,
  accepts e w = true <->
  matches e w.

The second main result shows a bound on the number of different zippers that can be encountered by successive derivation (Zippers.v, line 1035).

Theorem finiteness:
  forall z,
  exists Z,
  forall w,
  forall ctx,
  set_In ctx (derive_word w z) ->
  set_In ctx Z.

Dependencies

The project only relies on a relatively recent installation of Coq. The project does not depend on any Coq extensions.

Compiling the Proofs

Once you have a relatively recent installation of Coq, simply call the following commands to compile the project's proofs:

./configure
make

silex-proofs's People

Contributors

redelmann avatar

Stargazers

Suminda Sirinath Salpitikorala Dharmasena avatar  avatar

Watchers

Etienne Kneuss avatar James Cloos avatar Nicolas Voirol avatar  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.