Compare commits
9 Commits
acbc247e10
...
master
Author | SHA1 | Date | |
---|---|---|---|
5bff77e4a7 | |||
8c8ea69890 | |||
6d14333e52 | |||
ab9057148a | |||
c07edf1b50 | |||
1bb0b91e20
|
|||
b20604de5c | |||
d2f8b1c8fb
|
|||
3022c2ffc0
|
@ -1,11 +1,8 @@
|
|||||||
# 🐑 Lamb: A Lambda Calculus Engine
|
# 🐑 Lamb: A Lambda Calculus Engine
|
||||||
|
|
||||||
- [Primary Repo](https://git.betalupi.com/Mark/lamb)
|

|
||||||
- [Github Mirror](https://github.com/rm-dr/lamb)
|
|
||||||
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
|
|
||||||
## :brain: What is lambda calculus?
|
## :brain: What is lambda calculus?
|
||||||
|
|
||||||
@ -15,7 +12,7 @@
|
|||||||
|
|
||||||
- [blog](https://www.driverlesscrocodile.com/technology/lambda-calculus-for-people-a-step-behind-me-1): Another introduction. Moves slower than the two videos above and doesn't assume CS knowledge. Four-part series.
|
- [blog](https://www.driverlesscrocodile.com/technology/lambda-calculus-for-people-a-step-behind-me-1): Another introduction. Moves slower than the two videos above and doesn't assume CS knowledge. Four-part series.
|
||||||
|
|
||||||
- [handout](https://nc.betalupi.com/s/ormc-handouts/download?path=%2FAdvanced&files=Lambda%20Calculus.pdf): A handout I've written on lambda calculus. Solutions are available somewhere on `git.betalupi.com`. You'll have to find them yourself if you want them.
|
- [handout](https://static.betalupi.com/ormc/Advanced/Lambda%20Calculus.pdf): A handout I've written on lambda calculus.
|
||||||
|
|
||||||
## :package: Installation
|
## :package: Installation
|
||||||
|
|
||||||
@ -116,9 +113,7 @@ The lines in a file look exactly the same as regular entries in the prompt, but
|
|||||||
- Cleanup warnings
|
- Cleanup warnings
|
||||||
- Truncate long expressions in warnings
|
- Truncate long expressions in warnings
|
||||||
- Loop detection
|
- Loop detection
|
||||||
- α-equivalence check
|
|
||||||
- Unchurch command: make church numerals human-readable
|
- Unchurch command: make church numerals human-readable
|
||||||
- Better syntax highlighting
|
- Better syntax highlighting
|
||||||
- Tab-complete file names and commands
|
- Tab-complete file names and commands
|
||||||
- Load default macros without manually downloading `macros.lamb` (via `requests`, maybe?)
|
- Load default macros without manually downloading `macros.lamb` (via `requests`, maybe?)
|
||||||
- Tests
|
|
@ -77,8 +77,8 @@ class Node:
|
|||||||
self.parent_side: Direction = None # type: ignore
|
self.parent_side: Direction = None # type: ignore
|
||||||
|
|
||||||
# Left and right nodes, None if empty
|
# Left and right nodes, None if empty
|
||||||
self._left: Node | None = None
|
self._left = None
|
||||||
self._right: Node | None = None
|
self._right = None
|
||||||
|
|
||||||
# The runner this node is attached to.
|
# The runner this node is attached to.
|
||||||
# Set by Node.set_runner()
|
# Set by Node.set_runner()
|
||||||
@ -341,7 +341,7 @@ class Bound(EndNode):
|
|||||||
# The name of the macro this bound came from.
|
# The name of the macro this bound came from.
|
||||||
# Always equal to self.name, unless the macro
|
# Always equal to self.name, unless the macro
|
||||||
# this came from had a subscript.
|
# this came from had a subscript.
|
||||||
self.macro_name: str | None = macro_name
|
self.macro_name = macro_name
|
||||||
|
|
||||||
if forced_id is None:
|
if forced_id is None:
|
||||||
self.identifier = bound_counter
|
self.identifier = bound_counter
|
||||||
@ -381,9 +381,9 @@ class Func(Node):
|
|||||||
Func.from_parse(result)
|
Func.from_parse(result)
|
||||||
)
|
)
|
||||||
|
|
||||||
def __init__(self, input: Macro | Bound, output: Node, *, runner = None) -> None:
|
def __init__(self, input, output: Node, *, runner = None) -> None:
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.input: Macro | Bound = input
|
self.input = input
|
||||||
self.left: Node = output
|
self.left: Node = output
|
||||||
self.right: None = None
|
self.right: None = None
|
||||||
self.runner = runner # type: ignore
|
self.runner = runner # type: ignore
|
||||||
|
@ -14,7 +14,7 @@ help_texts = {}
|
|||||||
|
|
||||||
def lamb_command(
|
def lamb_command(
|
||||||
*,
|
*,
|
||||||
command_name: str | None = None,
|
command_name = None,
|
||||||
help_text: str
|
help_text: str
|
||||||
):
|
):
|
||||||
"""
|
"""
|
||||||
|
@ -46,7 +46,7 @@ class Runner:
|
|||||||
# Maximum amount of reductions.
|
# Maximum amount of reductions.
|
||||||
# If None, no maximum is enforced.
|
# If None, no maximum is enforced.
|
||||||
# Must be at least 1.
|
# Must be at least 1.
|
||||||
self.reduction_limit: int | None = 1_000_000
|
self.reduction_limit = 1_000_000
|
||||||
|
|
||||||
# Ensure bound variables are unique.
|
# Ensure bound variables are unique.
|
||||||
# This is automatically incremented whenever we make
|
# This is automatically incremented whenever we make
|
||||||
@ -74,7 +74,7 @@ class Runner:
|
|||||||
message = self.prompt_message
|
message = self.prompt_message
|
||||||
)
|
)
|
||||||
|
|
||||||
def parse(self, line) -> tuple[lamb_engine.nodes.Root | MacroDef | Command, list]:
|
def parse(self, line): # -> tuple[lamb_engine.nodes.Root | MacroDef | Command, list]
|
||||||
e = self.parser.parse_line(line)
|
e = self.parser.parse_line(line)
|
||||||
|
|
||||||
w = []
|
w = []
|
||||||
|
@ -15,7 +15,7 @@ lamb = "lamb_engine:main"
|
|||||||
[project]
|
[project]
|
||||||
name = "lamb_engine"
|
name = "lamb_engine"
|
||||||
description = "A lambda calculus engine"
|
description = "A lambda calculus engine"
|
||||||
version = "1.1.8"
|
version = "1.1.9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"prompt-toolkit==3.0.31",
|
"prompt-toolkit==3.0.31",
|
||||||
"pyparsing==3.0.9"
|
"pyparsing==3.0.9"
|
||||||
|
Reference in New Issue
Block a user