Git Product home page Git Product logo

derivatives's Introduction

Regular Expression Derivatives

A pair of implementations of regular expression matching using derivatives, as presented in Regular-expression derivatives reexamined by Owens, Reppy, Turon.

Getting Started

This repository contains two implementations of extended regular expression matching using derivatives: a naive one in naive and an optimized one in opt. Both implementations include a repl which accepts bitstrings of the form (0|1)* and outputs whether each bitstring has even parity as determined by the regular expression (0*10*10*)*.

Navigate to either naive or opt, build and launch the repl, and then enter bitstrings. For example, here's what it looks like when you run the naive implementation.

$ corebuild -pkg async main.byte && rlwrap ./main.byte
(0*10*10*)*
λ
true
λ 0
false
λ 1
false
λ 00
false
λ 11
true
λ 01010
true
λ 00101000010101000111110010111001000100110101010
Fatal error: out of memory.

And here's what it looks like when you run the optimized version:

$ corebuild -pkg async main.byte && rlwrap ./main.byte
(0*10*10*)*
λ
true
λ 0
false
λ 1
false
λ 00
false
λ 11
true
λ 01010
true
λ 00101000010101000111110010111001000100110101010
false
λ 00101010100011111111111111111111111111111100000000000000000000000000010100101
true

derivatives's People

Contributors

mwhittaker avatar

Watchers

 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.