An OCaml tool for translating signatures and proof scripts from Eunoia to LambdaPi.
Build the project with dune:
dune buildTranslate a directory of Eunoia (.eo) files to LambdaPi:
dune exec eo2lp -- -d <input_dir> -o <output_dir>Options:
-d <dir>- Input directory containing.eofiles (required)-o <dir>- Output directory for LambdaPi package (required)-v- Verbose output
Example:
dune exec eo2lp -- -d cpc-mini -o cpclp -vThis will:
- Build a signature graph from all
.eofiles incpc-mini/ - Check for cycles in the dependency graph
- Generate a LambdaPi package in
cpclp/with:Prelude.lp- Core Eunoia builtin symbolslambdapi.pkg- Package configuration- One
.lpfile for each.eofile
Each generated .lp file has the following import structure:
require <package>.Prelude as eo;
require open Stdlib.Set Stdlib.HOL ... <dependencies>;This allows Eunoia builtin symbols to be accessed via the eo namespace (e.g., eo.ite, eo.eq) while keeping Stdlib symbols in the global namespace.
Run the test suite:
dune testThe test suite includes:
- Parsing tests - Verify
.eofiles parse correctly - Elaboration tests - Test term elaboration and type inference
- Encoding tests - Test translation to LambdaPi
- Graph tests - Verify signature graph construction and topological sorting
- Integration tests - Full pipeline including optional LambdaPi checking
Run tests with custom timeout:
dune test -- -t 0.5 # 0.5 second timeout per testRun tests in verbose mode:
dune test -- -veo2lp/
├── src/ # Core library and CLI
│ ├── lexer.mll, parser.mly # Eunoia parser
│ ├── syntax_eo.ml # Eunoia AST and signature graphs
│ ├── elaborate.ml # Term elaboration
│ ├── encode.ml # Translation to LambdaPi
│ ├── syntax_lp.ml # LambdaPi AST
│ ├── api_lp.ml # LambdaPi file I/O
│ ├── main.ml # CLI and package generation
│ └── eo2lp_cli.ml # Entry point
├── test/ # Test suite
│ ├── test_infra.ml # Shared test infrastructure
│ ├── test_core.ml # Core.eo tests
│ ├── test_cpc_mini_*.ml # CPC test suite
│ ├── test_graph.ml # Graph algorithm tests
│ └── test_lp_check.ml # LambdaPi integration tests
├── eo/ # Core Eunoia prelude
├── cpc-mini/ # Example: CPC proof calculus (miniature)
└── ethos-tests/ # Additional test files
This repository is currently under construction.