Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/backtracking/combine
OCaml library for combinatorics
https://github.com/backtracking/combine
Last synced: 3 months ago
JSON representation
OCaml library for combinatorics
- Host: GitHub
- URL: https://github.com/backtracking/combine
- Owner: backtracking
- License: other
- Created: 2013-02-08T13:54:38.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2022-12-15T15:01:12.000Z (almost 2 years ago)
- Last Synced: 2024-05-03T00:52:45.028Z (6 months ago)
- Language: OCaml
- Homepage: https://www.lri.fr/~filliatr/combine/
- Size: 653 KB
- Stars: 35
- Watchers: 6
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README
- Changelog: CHANGES
- License: LICENSE
Awesome Lists containing this project
- awesome-ocaml - combine
README
##########################################################################
# #
# Combine - an OCaml library for combinatorics #
# #
# Copyright (C) 2012-2014 #
# Remy El Sibaie #
# Jean-Christophe Filliatre #
# #
# This software is free software; you can redistribute it and/or #
# modify it under the terms of the GNU Library General Public #
# License version 2.1, with the special exception on linking #
# described in file LICENSE. #
# #
# This software is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
# #
##########################################################################* Library
The Combine library contains four main modules:
- Dlx: implements Knuth's dancing links
- Zdd: implements Zero-suppressed binary decision diagrams
- Emc: a common interface to modules Dlx and Zdd to solve EMC +
reduction of EMC to SAT
- Tiling: converts a 2D tiling problem into an EMC problemUsage: the Combine library is packed into a single module Combine, installed
in the subdirectory combine/ of OCaml's standard library. Thus, it must be
used as follows:ocamlc -I +combine combine.cma
full documentation : https://www.lri.fr/~filliatr/combine/
* Examples
The distribution contains several example programs:
- queens.ml: solve the N-queens puzzle
- sudoku.ml: well, you haved guessed already
- color.ml: 4-color planar graphs using DLX and SAT (requires OCamlgraph
and an explicit 'make color.opt')* Tiling language and interpreter
In addition to the library, Combine provides a language to describe 2D tiling
problems and an interpreter (combine) for this language.Directory tests/ contains various examples of tiling problems (.cmb files).
To execute such a test, just run "combine" on the file.The grammar of the tiling language is the following:
::= | decl ... decl
::=
| pattern =
| tiles =
| problem equal tl = tiles
| assert b = boolean_expr
| solve a = algo out = output
| count a = algo
| dimacs
| debug st = state
| timing st = state
| exit
| includealgo ::=
| dlx
| zdd
| satstate ::=
| on
| offoption ::=
| one
| maybe
| sym
| rottiles ::=
|
|tile_list ::=
| [ tile, ..., tile ]output ::=
| svg_out
| ascii_outisometry ::=
| id
| rot90
| rot180
| rot270
| vertrefl
| horizrefl
| diag1refl
| diag2refltile ::=
| o = list(option)expr ::=
| lpar rpar
|
| constant
| union
| inter
| diff
| xor
| minus
| ampamp
| barbar
| hat
| set
| crop
| shift
| resize
| apply
|bool ::=
| false
| trueboolean_expr::=
|
| equal