0.0
No commit activity in last 3 years
No release in over 3 years
Combinatory logic parsing and reduction
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0

Runtime

>= 0
 Project Readme

Master Forest

This gem parses and reduces combinatory logic written in Lazy K syntax.

Usage

MasterForest::Term methods
initialize(string) argument is a Lazy K string
leaf? Is it a single letter like `s`, `k`, or `i`?
valid? Is it syntactically valid?
normal? Is it in normal form? (i.e. not further reducible)
to_s Serialize back to Lazy K
l Left applicand; nil if leaf
r Right applicand; nil if leaf
reduce Return single β reduction of term or term itself
fully_reduce(depth) Reduce depth times or until normal, default depth is ∞

Performance

This gem includes two implementations of the same functionality, MasterForest::Term and MasterForest::MemcacheTerm. If you run memcache then the latter will use it to memoize previous reductions. This goes much faster. You can test the speed by running benchmark/run.rb.