https://github.com/jozefg/simple-abt
Nothing fancy, just binding without pain
https://github.com/jozefg/simple-abt
Last synced: 2 months ago
JSON representation
Nothing fancy, just binding without pain
- Host: GitHub
- URL: https://github.com/jozefg/simple-abt
- Owner: jozefg
- Created: 2015-05-18T06:49:30.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-05-19T01:17:29.000Z (about 10 years ago)
- Last Synced: 2025-01-28T16:34:36.984Z (4 months ago)
- Language: Standard ML
- Size: 117 KB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Just Simple Abts
So I can scratch stuff out quickly and without thinking. In SML to aid in the
process of not thinking too hard.## How To Use This
If you want to use this library here's the basic procedure.
1. Copy this directory into your project's.
2. Add `simple-abt/sources.cm` to your `sources.cm`
3. Define a module for your language's operatorsEssentially you define a normal SML type which represents each branch of
your ABT. However, this type shouldn't be recursive! You then should define
the function `eq` and `toString` which do the right things for your
operators. Finally, define `arity`. Given an operator this should return a
list of numbers. There should be one number for each recursive component of
this node in the ABT. Each number should represent how many variables each
of those nodes should bind.4. Get your language's ABT for *free* with
Abt(structure O = Operator; structure V = Variable)
Consult the signatures for more details. You can find an example of the untyped
lambda calculus in `test/lam.sml`.