LogicNG alternatives and similar libraries
Based on the "Science" category.
Alternatively, view LogicNG alternatives based on common mentions on social networks and blogs.
5.7 0.0 LogicNG VS BioJava:book::microscope::coffee: BioJava is an open-source project dedicated to providing a Java library for processing biological data.
4.4 0.0 LogicNG VS ChartFxA scientific charting library focused on performance optimised real-time data visualisation at 25 Hz update rates for data sets with a few 10 thousand up to 5 million data points.
4.0 6.3 LogicNG VS Chart-FXA scientific charting library focused on performance optimised real-time data visualisation at 25 Hz update rates for data sets with a few 10 thousand up to 5 million data points. [Moved to: https://github.com/fair-acc/chart-fx]
Do you think we are missing an alternative of LogicNG or a related project?
Its main focus lies on memory-efficient data-structures for Boolean formulas and efficient algorithms for manipulating and solving them. The library is designed to be used in industrial systems which have to manipulate and solve millions of formulas per day.
The most important philosophy of the library is to avoid unnecessary object creation. Therefore formulas can only be generated via formula factories. A formula factory assures that a formula is only created once in memory. If another instance of the same formula is created by the user, the already existing one is returned by the factory. This leads to a small memory footprint and fast execution of algorithms. Formulas can cache the results of algorithms executed on them and since every formula is hold only once in memory it is assured that the same algorithm on the same formula is also executed only once.
Compared to other implementation of logic libraries on the JVM this is a huge memory and performance improvement.
LogicNG is released in the Maven Central Repository. To include it just add
<dependency> <groupId>org.logicng</groupId> <artifactId>logicng</artifactId> <version>2.3.2</version> </dependency>
to your Maven POM.
master branch contains the latest release of LogicNG. If you want a stable and well tested version you should choose this branch. The
branch reflects the current state of the next version. This branch will always compile, but code might not be as well tested and APIs may still change before
the next release. If you want to try cutting edge features, you can checkout this branch at your own risk. It is not recommended to use the development
version for production systems. Larger features will be developed in their own branches and will be merged to the development branch when ready.
To compile LogicNG simply run
mvn compile to build the parsers and compile the source code. You can build a jar of the library with
mvn package or install
it in your local maven repository via
The following code creates the Boolean Formula A and not (B or not C) programmatically:
FormulaFactory f = new FormulaFactory(); Variable a = f.variable("A"); Variable b = f.variable("B"); Literal notC = f.literal("C", false); Formula formula = f.and(a, f.not(f.or(b, notC)));
Alternatively you can just parse the formula from a string:
FormulaFactory f = new FormulaFactory(); PropositionalParser p = new PropositionalParser(f); Formula formula = p.parse("A & ~(B | ~C)");
Once you created the formula you can for example convert it to NNF or CNF or solve it with an instance of MiniSAT:
Formula nnf = formula.nnf(); Formula cnf = formula.cnf(); SATSolver miniSat = MiniSat.miniSat(f); miniSat.add(formula); Tristate result = miniSat.sat();
There is a Tutorial for a a more in-depth introduction to LogicNG.
For an extensive documentation see the wiki.
License & Commercial Support
The library is released under the Apache License and therefore is free to use in any private, educational, or commercial projects. Commercial support is available through the German company BooleWorks GmbH - the company behind LogicNG. Please contact Christoph Zengler at [email protected] for further details.
*Note that all licence references and agreements mentioned in the LogicNG README section above are relevant to that project's source code only.