Skip to content
WolframInstitutePublic

About

A universal natural-number DSL for program synthesis and evolution, with lambda compilation and Lean-checked formal semantics.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

22 Commits

Folders and files

Repository files navigation

Recursor

CI Release

A universal natural-number language for program synthesis and evolution.

Recursor includes a direct interpreter, a compiler to closed lambda terms, a text parser, scope-aware genetic operators, evolutionary search and program and ancestry plots.

Requires Wolfram Language 15.0 or later.

Documentation · Wolfram resource · Releases

Why a DSL for evolving lambda expressions?

A compact DSL provides a structured search space for generating, testing and evolving programs, with explicit rules for scope and execution. Recursor compiles these programs directly to lambda expressions, giving them a portable representation and a basis for formal reasoning.

Wolfram Language supports the experiments and visualizations. Arbitrary WL expressions can depend on definitions, attributes, evaluation order and side effects; a faithful lambda translation would need to reproduce those behaviors. WL can implement the system, while Recursor gives generated programs a small, explicit semantics that can be translated and verified independently.

Get started

Install and load the paclet:

PacletInstall[ResourceObject["https://wolfr.am/1IuTobNWg"]]
Needs["WolframInstitute`Recursor`"]

Compute a factorial:

EvaluateRecursor[RecursorExamples["Factorial"], 6]
(* 720 *)

Run a countdown:

EvaluateRecursor[WhileLoop[Var, Acc, Pred[Acc]], 100]
(* 0 *)

WhileLoop provides unbounded iteration. ToRecursor translates counter machines and partial-recursive codes. Lean checks the formal language's universality theorem. The evaluator uses finite resource budgets by default and returns Failure when one is exhausted. Each budget accepts Infinity.

External libraries

Open the local library installer:

SetupRecursor[]

For scripts, install the selected libraries directly:

InstallRecursorLibraries[{"LeanLink", "MathlibLink", "Lambda"}]

Use RecursorLibraries[] to check their status. See library installation for setup details.

Run CheckRecursorProofs[] to build and check the packaged Lean proofs.

Documentation

Development

Load the source paclet from this repository:

PacletDirectoryLoad[FileNameJoin[{Directory[], "Recursor"}]]
Needs["WolframInstitute`Recursor`"]
Command Purpose
make check Check source, metadata and reference coverage
make check-proofs Build and check the Lean proofs
make test Run tests
make notebooks Build documentation with PacletPage
make check-publish Build the paclet archive without publishing
make publish Publish the paclet and documentation

See GUIDE.md for development conventions and API naming for public-name conventions. The CI and release guide describes automated checks and publication.

Released under the MIT license.

About

A universal natural-number DSL for program synthesis and evolution, with lambda compilation and Lean-checked formal semantics.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages