Skip to content

n-alex-goncalves/LambdaCalculusInterpreter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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