Java API for the clingo
Clingo4j is distributed under the Apache License 2.0.
<dependency>
<groupId>org.lorislab.clingo4j</groupId>
<artifactId>clingo4j</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
Clingo.init("src/main/clingo");
try (Clingo control = Clingo.create()) {
System.out.println(control.getVersion());
control.add("base", "b :- not a. a :- not b.");
control.ground("base");
try (SolveHandle handle = control.solve()) {
for (Model model : handle) {
System.out.println("Model type: " + model.getType());
for (Symbol atom : model.getSymbols()) {
System.out.println(atom);
}
}
}
} catch (ClingoException ex) {
System.err.println(ex.getMessage());
}
mvn clean install
java -jar src/main/jnaerator/jnaerator.jar src/main/jnaerator/c.jnaerator