Git Product home page Git Product logo

n-alex-goncalves / lambdacalculusinterpreter Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 1.83 MB

An iterative untyped lambda calculus interpreter written in JavaScript.

Home Page: https://n-alex-goncalves.github.io/Lambda-Calculus-Interpreter/

License: MIT License

CSS 3.90% HTML 19.96% JavaScript 76.14%
interpreter javascript lambda-calculus interpreters lambda lambda-calculus-evaluator lambda-calculus-interpreter parser

lambdacalculusinterpreter's Introduction

Lambda Calculus Interpreter ๐Ÿ’ป

This is a single-line interpreter for the lambda calculus system

  • Built in the HTML/CSS/JavaScripts
  • User Interface built with Bootstrap and JQuery
  • Tested using Jest and Node.JS

The interpreter uses an applicative-order evaluation strategy to perform beta reduction on a lambda term. The interpreter can reduce complicated lambda expressions and also simulate SKI combinators and boolean logic (see notation at bottom).

The interpreter was built by considering the lambda calculus system as a tree-like data structure. The program parses the tree iteratively to find the beta normal form of the lambda expression.

Demo

Tested with over 80 lambda expressions from various books and websites

SKI Combinators & Boolean Logic Notation

NOT == C
TRUE == K
FALSE == KI
AND == (\pq.pq(KI))
OR == (\pq.pKq)

Note that the above notation is in prefix. So instead of TRUE AND FALSE, the input should be AND TRUE FALSE.

Dependencies

Thanks go to the following few authors:

jQuery
jQuery Terminal
BootStrap

lambdacalculusinterpreter's People

Contributors

n-alex-goncalves avatar

Stargazers

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