https://github.com/aygp-dr/reversible-meta-synthesis
Implementation of reversible meta-interpreter for inductive program synthesis based on Numao and Ma's research
https://github.com/aygp-dr/reversible-meta-synthesis
meta-programming prolog scheme
Last synced: 4 months ago
JSON representation
Implementation of reversible meta-interpreter for inductive program synthesis based on Numao and Ma's research
- Host: GitHub
- URL: https://github.com/aygp-dr/reversible-meta-synthesis
- Owner: aygp-dr
- License: mit
- Created: 2025-03-29T15:53:42.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-08-06T13:45:09.000Z (10 months ago)
- Last Synced: 2025-10-31T00:40:24.600Z (7 months ago)
- Topics: meta-programming, prolog, scheme
- Language: Clojure
- Homepage: https://www.researchgate.net/publication/2649827_Inductive_Program_Synthesis_by_Using_a_Reversible_Meta-Interpreter
- Size: 225 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 35
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Reversible Meta-Synthesis
An implementation of "Inductive Program Synthesis by Using a Reversible Meta-Interpreter" by Masayuki Numao and Masamichi Shimura (1990).
## Overview
This repository implements the concepts from the seminal paper on using reversible meta-interpreters for inductive program synthesis. The key innovations in this approach include:
1. A reversible interpreter that can both execute programs and synthesize them from examples
2. Explanation-based learning to accelerate program synthesis
3. Decomposition of explanations based on composability for flexible knowledge transfer
## Implementations
Four implementations are provided:
- **Prolog**: The original language used in the paper, providing the most faithful implementation
- **Clojure**: Modern Lisp on the JVM with rich data structures and concurrency support
- **Hy**: A Lisp dialect embedded in Python, bridging functional and imperative paradigms
- **Scheme**: A minimalist Lisp implementation focusing on core concepts
## Key Examples
The repository includes implementations of several examples from the paper:
- Basic append program synthesis
- Synthesizing merge3 from app3
- Synthesizing rzip from zip
- Synthesizing fullrev from reverse and flatten
## Getting Started
1. Clone this repository
2. Install the required languages:
- **Clojure**: Install [Clojure CLI tools](https://clojure.org/guides/getting_started)
- **Hy**: `pip install hy`
- **Scheme**: Install [GNU Guile](https://www.gnu.org/software/guile/)
- **Prolog**: Install [SWI-Prolog](https://www.swi-prolog.org/) (optional)
3. Test all implementations:
```bash
./test_all.sh
```
4. Or run examples individually:
```bash
# Clojure
clojure -M:run examples
# Hy
hy examples/hy/append_example.hy
# Scheme
guile examples/scheme/append-example.scm
# Prolog (if available)
swipl -q -t "test_append, halt" -f reversible-interpreter.pl
```
## Directory Structure
```
.
├── src/ # Source code
│ ├── reversible_meta_synthesis/ # Clojure implementation
│ ├── hy/ # Hy implementation
│ ├── scheme/ # Scheme implementation
│ ├── prolog/ # Prolog implementation
│ └── api/ # HTTP API server
├── examples/ # Working examples
│ ├── clojure/
│ ├── hy/
│ ├── scheme/
│ └── prolog/
├── tests/ # Test suites
├── reversible-interpreter.pl # Standalone Prolog implementation
└── test_all.sh # Test runner for all languages
```
## References
Numao, M., & Shimura, M. (1990). Inductive Program Synthesis by Using a Reversible Meta-Interpreter. In M. Bruynooghe (Ed.), Proc. the Second Workshop on Meta-Programming in Logic, pp. 123-136, Leuven, Belgium.