pip install git+https://github.com/LMCRC/Newclid.git
git clone https://github.com/LMCRC/Newclid.git
cd Newclid
pip install -e .
To simply solve a problem using Newclid, use the command line:
newclid --problem-name problem_name --problems-file path/to/problem
For example:
newclid --problem-name orthocenter_consequence_aux --problems-file ./problems_datasets/examples.txt
See other command line interface options with:
newclid --help
For more complex applications, use the Python interface. Below is a minimal example to load a specific problem, then uses the built solver to solve it:
from newclid import GeometricSolverBuilder, GeometricSolver
solver_builder = GeometricSolverBuilder()
solver_builder.load_problem_from_txt(
"a b c = triangle a b c; "
"d = on_tline d b a c, on_tline d c a b "
"? perp a d b c"
)
# We now obtain the GeometricSolver with the build method
solver: GeometricSolver = solver_builder.build()
# And run the GeometricSolver
success = solver.run()
if success:
print("Successfuly solved the problem!")
else:
print("Failed to solve the problem...")
print(f"Run infos {solver.run_infos}")
Some more advanced examples of script using the Python interface
are displayed in the folder examples
or used in tests
.
See the online documentation for more detailed informations about Newclid.
- Clone the repository
git clone https://github.com/LMCRC/Newclid.git
cd Newclid
- (Optional) Create a virtual environment, for example with venv:
python -m venv venv
# On UNIX
source ./bin/activate
# On Windows
.\venv\Scripts\activate
- Install as an editable package with dev requirements
pip install -e .[dev]
- Install pre-commit and pre-push checks
pre-commit install -t pre-commit -t pre-push
- Run tests
pytest tests
Newclid is a successor to AlphaGeometry, introduced in this early 2024 Nature paper: Solving Olympiad Geometry without Human Demonstrations. whose original codebase can be found here.
If you found Newclid useful, please cite us as:
@article{newclid2024sicca,
author = {Sicca, Vladmir and Xia, Tianxiang and F\'ed\'erico, Math\"is and Gorinski, Philip John and Frieder, Simon and Jui, Shangling},
journal = {arXiv preprint},
title = {Newclid: A User-Friendly Replacement for AlphaGeometry with Agentic Support},
year = {2024}
}
The AlphaGeometry checkpoints and vocabulary are made available under the terms of the Creative Commons Attribution 4.0 International (CC BY 4.0) license. You can find details at: https://creativecommons.org/licenses/by/4.0/legalcode