chocoteam / choco-parsers

Parsers to Choco3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

choco-parsers

choco-parsers is an extension library for choco-solver.

It aims at importing models to various format. It provides a parser for the FlatZinc language, a low-level solver input language that is the target language for MiniZinc, a parser for XCSP3, an intermediate integrated XML-based format and a parser for MPS a file format for presenting and archiving linear programming (LP) and mixed integer programming problems.

It also provides utilities to export a model written with Choco to a JSON format and to import a JSON format file into a Model.

Parsing a file

By default, the extension of a file helps choosing the accurate parser. Thus, any supported file (FlatZinc, XCSP3, MPS or JSON) can be parsed and solved using the following command:

java -jar .:/path/to/choco-parsers-4.0.5-with-dependencies.jar [options] <file>

Only the file name is mandatory. Alternatively, if the file has no explicit extension, the option -pa followed a digit between 1 and 4 can be declared to specify the parser to use; 1: FlatZinc, 2: XCSP3, 3: MPS and 4: JSON.

A Bash file named parse.sh can also be found in ./src/main/bash/ that handles basic options.

Finally, if one can to use a specific parser directly, in that case, click on the right link above.

About

Parsers to Choco3

License:BSD 4-Clause "Original" or "Old" License


Languages

Language:Java 89.4%Language:Python 7.7%Language:Shell 1.6%Language:ANTLR 1.2%