arnaud-m / cryptator

A constraint-based cryptarithm solver

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cryptator

https://img.shields.io/badge/License-BSD%203--Clause-blue.svg

https://github.com/arnaud-m/cryptator/actions/workflows/CryptatorTest.yml/badge.svg

Cryptator is a cryptarithm solver using Constraint Programming.
It is based on choco-solver which is an open-source Java library for Constraint Programming.

It is described in the white paper (in French) published at the conference JFPC 2023.

About cryptarithms

Cryptarithm, or alphametic, is a type of mathematical game consisting of a mathematical equation among unknown numbers, whose digits are represented by letters of the alphabet.

Download and Installation

In the following, we distinguish two usages:

  • as a standalone application: the jar file includes all required dependencies,
  • as a library: the jar file excludes all dependencies.

Prerequisites

This project works on 32 bits and 64 bits environment and requires:

  • JDK 11+
  • Maven 3+

As a stand-alone application

This project uses the Cross-platform Maven build system.

mvn clean package

or to skip unit tests

mvn clean package -DskipTests=true

The jar file contains all required dependencies. The next step is simply to run the console application.

java -cp target/cryptator-*-with-dependencies.jar cryptator.Cryptator send+more=money

There are three console applications and the links below point to demonstration scripts.

As a library

The jar file does not contains any dependencies, as of being used as a dependency of another application. The next step is to add the jar file to your classpath of your application and also add the required dependencies.

Inside a maven project

First, you must build from source and install it into your local .m2 repository.

mvn install

Then, you only have to edit your pom.xml to declare the following library dependency:

<dependency>
   <groupId>fr.univ-cotedazur</groupId>
   <artifactId>cryptator</artifactId>
   <version>1.0.1-SNAPSHOT</version>
</dependency>

Integration tests

The tests solve around 150 cryptarithms. By default, the tests are not executed by the regular maven lifecycle test execution. Indeed, their names are outside of the standard maven test runner nomenclature.

Just include it manually by feeding it as a parameter to the runner.

mvn test -Dtest=ExtensiveTesting

Contributing

Please read CONTRIBUTING.md for details on our how you can become a contributor and the process for submitting pull requests to us.

Versioning

This project makes use of SemVer for versioning. A list of existing versions can be found in the project’s releases.

Authors

See AUTHORS and CONTRIBUTORS files.

License

This project is licensed under the 3-Clause BSD License - see the LICENSE file for details.

About

A constraint-based cryptarithm solver

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Java 96.7%Language:Shell 1.8%Language:R 0.9%Language:ANTLR 0.6%