Coder Social home page Coder Social logo

regular-languages's Introduction

Regular Languages

A library to explore regular languages, and their various representations

Inspired by a reading of "Introduction to the Theory of Computation" by Michael Sipser and "Introduction to Automata Theory, Languages, and Computation" by Hopcroft, et al.

The library includes:

  • A high-level representation of a regular language, for which membership in the language can be tested, and arbitrary functions for which regular languages are closed over can be performed on. This abstraction can be created from and converted to any support regular language representation
  • Implementations of NFAs, DFAs, and regular expressions
  • Functions to convert between NFA, DFAs, and regular expressions
  • Functions to perform operations that are closed for regular languages, like union, intersection, complement, and more
  • A regular language abstraction that can be instantiated using any regular language representation, have any operation performed on it for which regular languages are closed, and be converted to any regular language representation
    • This effectively allows for performing operations on representations for which that operation may not be easy to perform. For example, taking the complement of a regular expression

In Progress

  • Determining if two DFAs are equivalent
  • Most of the regular language operations
  • The regular language abstraction
  • Supporting more advanced regex operations
  • Serializing and deserializing the primary representations to/from JSON
  • Improving the types
  • Unit tests
  • Publishing the package to PyPI
  • Regular grammars

Usage

  • Run with Python 3.10. Because that includes some really nice typing capabilities, and pattern matching
  • Create a virtual environment
python3 -m venv venv
  • Activate the virtual environment
source ./venv/bin/activate
  • Install the package in editable mode
pip3 install -e .
  • Import the package
from regular_languages import ...

regular-languages's People

Contributors

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