Giter Club home page Giter Club logo

combinators's Introduction

combinators.scm - A Small Combinator Calculus Evaluator

combinators.scm is a very small combinator calculus evaluator written in Scheme. To run it, you will need to have Chez Scheme installed on your machine.

Usage

Running an expression

$ ./combinators.scm "S K K 1"
=> 1

Running an expression and converting it to an integer

$ ./combinators.scm "SUCC ZERO" as number
=> 1

Supported Combinators

Here is a list of supported combinators. Please ensure that their names are CAPITALIZED in the expression.

  1. S
  2. K
  3. I
  4. Y
  5. C1
  6. C2
  7. PAIR
  8. ZERO
  9. SUCC
  10. ADD
  11. MUL
  12. FIRST
  13. SECOND
  14. M
  15. I2
  16. ONE
  17. FAC

Additionally, users can use (TO-CHURCH <integer>) to get the church numeral representation of a number.

$ ./combinators.scm "ADD (SUCC ONE) (TO-CHURCH 1)" as number
=> 3

Known Issues

The church numeral to number conversion fails for some expressions due to type errors.

Acknowledgements

I primarily used this lecture’s slides for the definitions of the advanced combinators.

License

This program is licensed under GPL v3 or later. Β© 2023 Sarthak Shah (cel7t)

combinators's People

Contributors

cel7t avatar

Stargazers

πŸƒ Greg 'Krait' Hab πŸ‚ avatar  avatar Bihart avatar Grigory Shepelev 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.