Commit 17070382 authored by Joerg Steffen's avatar Joerg Steffen
Browse files

Merge branch 'developer'

# Conflicts:
#	src/main/java/de/dfki/lt/hfc/Operator.java
#	src/main/java/de/dfki/lt/hfc/OperatorRegistry.java
#	src/main/java/de/dfki/lt/hfc/TIntArrayHashingStrategy.java
parents da0370fd 51c73095
......@@ -13,3 +13,4 @@ hfc.iml
.idea
*~
**/~
/nbproject/
\ No newline at end of file
\begin{document}
\begin{table}
\begin{verbatim}
<query> ::= <select> <where> [<filter>] [<aggregate>] | ASK <groundtuple>
<select> ::= {"SELECT" | "SELECTALL"} ["DISTINCT"] {"*" | <var>^+}
<var> ::= "?"{a-zA-Z0-9}^+ | "?_"
<nwchar> ::= any NON-whitespace character
<where> ::= "WHERE" <tuple> {"&" <tuple>}^*
<tuple> ::= <literal>^+
<gtuple> ::= <constant>^+
<literal> ::= <var> | <constant>
<constant> ::= <uri> | <atom>
<uri> ::= "<" <nwchar>^+ ">"
<atom> ::= "\"" <char>^* "\"" [ "@" <langtag> | "^^" <xsdtype> ]
<char> ::= any character, incl. whitespaces, numbers, even '\"'
<langtag> ::= "de" | "en" | ...
<xsdtype> ::= "<xsd:int>" | "<xsd:long>" | "<xsd:float>" | "<xsd:double>" | "<xsd:dateTime>" |
"<xsd:string>" | "<xsd:boolean>" | "<xsd:date>" | "<xsd:gYear>" | "<xsd:gMonthDay>" |
"<xsd:gDay>" | "<xsd:gMonth>" | "<xsd:gYearMonth>" | "<xsd:duration>" | "<xsd:anyURI>" | ...
<filter> ::= "FILTER" <constr> {"&" <constr>}^*
<constr> ::= <ineq> | <predcall>
<ineq> ::= <var> "!=" <literal>
<predcall> ::= <predicate> <literal>^*
<predicate> ::= <nwchar>^+
<aggregate> ::= "AGGREGATE" <funcall> {"&" <funcall>}^*
<funcall> ::= <var>^+ "=" <function> <literal>^*
<function> ::= <nwchar>^+
\end{verbatim}
\caption{BNF for the hfc query syntax}
\end{table}
\textbf{Notes:}
\begin{itemize}
\item The reserved keywords ASK, SELECT, SELECTALL, DISTINCT, WHERE, FILTER, and
AGGREGATE need \emph{not} be written uppercase.
\item It is required that neither filter predicates nor aggregate functions have the same name as the above reserved keywords
\item \emph{don't-care} variables should be marked \emph{explicitly} by using
exactly the identifier \texttt{?\_}; this is especially important when using
\texttt{"*"} in a SELECT;
example:
\begin{verbatim}
SELECT DISTINCT WHERE ?s <rdf:type> ?_
SELECT WHERE ?s <rdf:type> ?o ?_ ?_
\end{verbatim}
when restricting the object position without projecting it, we explicitly
write down the selected vars:
\begin{verbatim}
SELECT ?s WHERE ?s <rdf:type> ?o ?_ ?_ FILTER ?o != <foo-class>
\end{verbatim}
\end{itemize}
\end{document}
\ No newline at end of file
......@@ -248,7 +248,7 @@
unless="maven.mode.offline">
<mkdir dir="${maven.repo.local}"/>
<mkdir dir="${maven.repo.local}/org/apache/xmlrpc/xmlrpc-client/3.1.3"/>
<get src="http://www.bsnsoft.de/nexus/content/groups/public//org/apache/xmlrpc/xmlrpc-client/3.1.3/xmlrpc-client-3.1.3.jar"
<get src="http://www.forschungssoftware.de/nexus/content/groups/public//org/apache/xmlrpc/xmlrpc-client/3.1.3/xmlrpc-client-3.1.3.jar"
dest="${maven.repo.local}/org/apache/xmlrpc/xmlrpc-client/3.1.3/xmlrpc-client-3.1.3.jar"
usetimestamp="false"
ignoreerrors="true"/>
......@@ -257,7 +257,7 @@
usetimestamp="false"
ignoreerrors="true"/>
<mkdir dir="${maven.repo.local}/org/apache/xmlrpc/xmlrpc-common/3.1.3"/>
<get src="http://www.bsnsoft.de/nexus/content/groups/public//org/apache/xmlrpc/xmlrpc-common/3.1.3/xmlrpc-common-3.1.3.jar"
<get src="http://www.forschungssoftware.de/nexus/content/groups/public//org/apache/xmlrpc/xmlrpc-common/3.1.3/xmlrpc-common-3.1.3.jar"
dest="${maven.repo.local}/org/apache/xmlrpc/xmlrpc-common/3.1.3/xmlrpc-common-3.1.3.jar"
usetimestamp="false"
ignoreerrors="true"/>
......@@ -266,7 +266,7 @@
usetimestamp="false"
ignoreerrors="true"/>
<mkdir dir="${maven.repo.local}/org/apache/ws/commons/util/ws-commons-util/1.0.2"/>
<get src="http://www.bsnsoft.de/nexus/content/groups/public//org/apache/ws/commons/util/ws-commons-util/1.0.2/ws-commons-util-1.0.2.jar"
<get src="http://www.forschungssoftware.de/nexus/content/groups/public//org/apache/ws/commons/util/ws-commons-util/1.0.2/ws-commons-util-1.0.2.jar"
dest="${maven.repo.local}/org/apache/ws/commons/util/ws-commons-util/1.0.2/ws-commons-util-1.0.2.jar"
usetimestamp="false"
ignoreerrors="true"/>
......@@ -275,7 +275,7 @@
usetimestamp="false"
ignoreerrors="true"/>
<mkdir dir="${maven.repo.local}/xml-apis/xml-apis/1.0.b2"/>
<get src="http://www.bsnsoft.de/nexus/content/groups/public//xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar"
<get src="http://www.forschungssoftware.de/nexus/content/groups/public//xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar"
dest="${maven.repo.local}/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar"
usetimestamp="false"
ignoreerrors="true"/>
......@@ -284,7 +284,7 @@
usetimestamp="false"
ignoreerrors="true"/>
<mkdir dir="${maven.repo.local}/org/apache/xmlrpc/xmlrpc-server/3.1.3"/>
<get src="http://www.bsnsoft.de/nexus/content/groups/public//org/apache/xmlrpc/xmlrpc-server/3.1.3/xmlrpc-server-3.1.3.jar"
<get src="http://www.forschungssoftware.de/nexus/content/groups/public//org/apache/xmlrpc/xmlrpc-server/3.1.3/xmlrpc-server-3.1.3.jar"
dest="${maven.repo.local}/org/apache/xmlrpc/xmlrpc-server/3.1.3/xmlrpc-server-3.1.3.jar"
usetimestamp="false"
ignoreerrors="true"/>
......@@ -293,7 +293,7 @@
usetimestamp="false"
ignoreerrors="true"/>
<mkdir dir="${maven.repo.local}/commons-logging/commons-logging/1.0.2"/>
<get src="http://www.bsnsoft.de/nexus/content/groups/public//commons-logging/commons-logging/1.0.2/commons-logging-1.0.2.jar"
<get src="http://www.forschungssoftware.de/nexus/content/groups/public//commons-logging/commons-logging/1.0.2/commons-logging-1.0.2.jar"
dest="${maven.repo.local}/commons-logging/commons-logging/1.0.2/commons-logging-1.0.2.jar"
usetimestamp="false"
ignoreerrors="true"/>
......@@ -302,7 +302,7 @@
usetimestamp="false"
ignoreerrors="true"/>
<mkdir dir="${maven.repo.local}/jline/jline/0.9.5"/>
<get src="http://www.bsnsoft.de/nexus/content/groups/public//jline/jline/0.9.5/jline-0.9.5.jar"
<get src="http://www.forschungssoftware.de/nexus/content/groups/public//jline/jline/0.9.5/jline-0.9.5.jar"
dest="${maven.repo.local}/jline/jline/0.9.5/jline-0.9.5.jar"
usetimestamp="false"
ignoreerrors="true"/>
......@@ -311,7 +311,7 @@
usetimestamp="false"
ignoreerrors="true"/>
<mkdir dir="${maven.repo.local}/net/sf/trove4j/trove4j/3.0.3"/>
<get src="http://www.bsnsoft.de/nexus/content/groups/public//net/sf/trove4j/trove4j/3.0.3/trove4j-3.0.3.jar"
<get src="http://www.forschungssoftware.de/nexus/content/groups/public//net/sf/trove4j/trove4j/3.0.3/trove4j-3.0.3.jar"
dest="${maven.repo.local}/net/sf/trove4j/trove4j/3.0.3/trove4j-3.0.3.jar"
usetimestamp="false"
ignoreerrors="true"/>
......@@ -320,7 +320,7 @@
usetimestamp="false"
ignoreerrors="true"/>
<mkdir dir="${maven.repo.local}/junit/junit/4.12"/>
<get src="http://www.bsnsoft.de/nexus/content/groups/public//junit/junit/4.12/junit-4.12.jar"
<get src="http://www.forschungssoftware.de/nexus/content/groups/public//junit/junit/4.12/junit-4.12.jar"
dest="${maven.repo.local}/junit/junit/4.12/junit-4.12.jar"
usetimestamp="false"
ignoreerrors="true"/>
......@@ -329,7 +329,7 @@
usetimestamp="false"
ignoreerrors="true"/>
<mkdir dir="${maven.repo.local}/org/hamcrest/hamcrest-core/1.3"/>
<get src="http://www.bsnsoft.de/nexus/content/groups/public//org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar"
<get src="http://www.forschungssoftware.de/nexus/content/groups/public//org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar"
dest="${maven.repo.local}/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar"
usetimestamp="false"
ignoreerrors="true"/>
......
......@@ -7,7 +7,7 @@
<groupId>de.dfki.lt.hfc</groupId>
<artifactId>hfc</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.5-SNAPSHOT</version>
<packaging>jar</packaging>
<inceptionYear>2015</inceptionYear>
......@@ -21,8 +21,8 @@
</licenses>
<properties>
<maven.compiler.source>7</maven.compiler.source>
<maven.compiler.target>7</maven.compiler.target>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<encoding>UTF-8</encoding>
</properties>
......@@ -41,6 +41,7 @@
</executions>
<configuration>
<failOnError>false</failOnError>
<additionalparam>-Xdoclint:none</additionalparam>
</configuration>
</plugin>
......@@ -99,6 +100,19 @@
</execution>
</executions>
</plugin>
<plugin>
<!-- Make sure all classes are used for tests, not just with 'Test' in name -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
<configuration>
<includes>
<include>de/dfki/lt/hfc/**/*.java</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
......@@ -115,12 +129,6 @@
<version>3.1.3</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.0.2</version>
</dependency>
<dependency>
<groupId>jline</groupId>
<artifactId>jline</artifactId>
......@@ -140,27 +148,23 @@
<scope>test</scope>
</dependency>
</dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.12</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.19</version>
</dependency>
<repositories>
<repository>
<id>BSNSOFT</id>
<name>BSNSOFT</name>
<url>http://www.bsnsoft.de/nexus/content/groups/public/</url>
</repository>
</repositories>
<distributionManagement>
<snapshotRepository>
<id>BSNSOFT</id>
<name>BSNSOFT</name>
<url>http://www.bsnsoft.de/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
<repository>
<id>BSNSOFT</id>
<name>BSNSOFT</name>
<url>http://www.bsnsoft.de/nexus/content/repositories/releases/</url>
</repository>
</distributionManagement>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
</dependencies>
</project>
......@@ -19,6 +19,9 @@
package de.dfki.lt.hfc;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.*;
import java.lang.reflect.*;
......@@ -36,7 +39,11 @@ import java.lang.reflect.*;
* @version Thu Jan 14 14:57:24 CET 2010
*/
public final class AggregateRegistry {
/**
* A basic LOGGER.
*/
private static final Logger logger = LoggerFactory.getLogger(AggregateRegistry.class);
/**
* all (custom) aggregates should be put in package de.dfki.lt.hfc.aggregates
*/
......@@ -119,9 +126,9 @@ public final class AggregateRegistry {
}
catch (Exception e) {
if (AggregateRegistry.EXIT_WHEN_REGISTRATION_FAILS)
System.exit(1);
throw new RuntimeException("FATAL ERROR");
else
System.out.println(" registering aggregate " + className + " fails");
logger.info(" registering aggregate " + className + " fails");
return null;
}
}
......
......@@ -473,7 +473,7 @@ public class BindingTable {
/**
* an implementation of TupleIterator for BindingTable objects
*/
class BindingTableIterator implements TupleIterator {
public class BindingTableIterator implements TupleIterator {
/**
* the number of tuples covered by the binding table
......
/*
* The Creative Commons CC-BY-NC 4.0 License
*
* http://creativecommons.org/licenses/by-nc/4.0/legalcode
*
* Creative Commons (CC) by DFKI GmbH
* - Hans Ulrich Krieger <krieger@dfki.de>
* - Bernd Kiefer <kiefer@dfki.de>
* - Christian Willms <christian.willms@dfki.de>
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
package de.dfki.lt.hfc;
/**
* FunctionalOperator (FO for short) is assumed to be the abstract superclass of all
* functional operators (functions and predicates) used in the forward chainer;
* every subclass of FunctionalOperator MUST implement exactly one unary method,
* called apply(int[] args), together with a package specification and (at least)
* one import statement:
*
* // put your FO in _this_ package:
* package de.dfki.lt.hfc.operators;
*
* // give access to methods from FunctionalOperator which safely access the tuple
* // store via class Operator
* import de.dfki.lt.hfc.FunctionalOperator;
*
* // put your code for the FO in here with exactly the same signature
* public int apply(int[] args) {
* ...
* }
*
* the args (an int array) given to apply() are exactly the arguments given to the FO
* specified in the rules of the forward chainer;
* the return value is usually a positive int, encoding the the application of the FO
* to its arguments;
*
* note that we reserve 0, -1, and -2 as special return values:
* @see FunctionalOperator.UNBOUND
* @see FunctionalOperator.TRUE
* @see FunctionalOperator.FALSE
* @see FunctionalOperator.DONT_KNOW
*
* even a prdicate must return a value (either FunctionalOperator.TRUE or FunctionalOperator.FALSE),
* that is why a predicate is subsumed by the term _Functional_Operator
*
* NOTE: a functional operator is required _not_ to implement any constructor;
*
* @see Operator for the abstract superclass providing useful implemented methods
* @see de.dfki.lt.hfc.Operator for a description of _relational_ operators
*
* @see de.dfki.lt.hfc.operators.NoValue for an example (predicate)
* @see de.dfki.lt.hfc.operators.Concatenate for an example (function)
*
* @author (C) Hans-Ulrich Krieger
* @since JDK 1.5
* @version Fri Mar 8 12:36:22 CET 2013
*/
public abstract class BooleanOperator extends FunctionalOperator {
public int apply(int[] args) { return holds(args) ? TRUE : FALSE; }
/**
* !!! this is the one and only method that you MUST implement !!!
*/
protected abstract boolean holds(int[] args);
}
......@@ -19,6 +19,9 @@
package de.dfki.lt.hfc;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.*;
import java.util.*;
......@@ -126,6 +129,11 @@ public class Configuration {
private HashSet<String> files = new HashSet<String>();
/**
* A basic LOGGER.
*/
private static final Logger logger = LoggerFactory.getLogger(Configuration.class);
/**
* the unary constructor takes a config file as explained above
*/
......@@ -142,10 +150,11 @@ public class Configuration {
st = new StringTokenizer(line, " =:\t");
processSpecification(st);
}
br.close();
}
catch (Exception e) {
System.err.println("\nerror while reading configuration file " + configFile);
System.exit(1);
logger.error("\nerror while reading configuration file " + configFile);
throw new RuntimeException("FATAL ERROR");
}
}
......@@ -197,7 +206,7 @@ public class Configuration {
private void processNames(String namespaceFile)
throws FileNotFoundException, WrongFormatException, IOException {
if (this.files.contains(namespaceFile)) {
System.out.println(namespaceFile + " used twice");
logger.info(namespaceFile + " used twice");
return;
}
if (this.namespace == null)
......@@ -214,7 +223,7 @@ public class Configuration {
*/
private void processTuples(String tupleFile) throws FileNotFoundException, IOException, WrongFormatException {
if (this.files.contains(tupleFile)) {
System.out.println(tupleFile + " used twice");
logger.info(tupleFile + " used twice");
return;
}
if (this.tupleStore == null) {
......@@ -234,7 +243,7 @@ public class Configuration {
*/
private void processRules(String ruleFile) throws IOException {
if (this.files.contains(ruleFile)) {
System.out.println(ruleFile + " used twice");
logger.info(ruleFile + " used twice");
return;
}
if (this.ruleStore == null) {
......
......@@ -22,8 +22,11 @@ package de.dfki.lt.hfc;
import java.io.*;
import java.util.*;
import java.util.concurrent.*;
import de.dfki.lt.hfc.indices.IndexingException;
import gnu.trove.set.hash.*;
import gnu.trove.map.hash.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* generates a tuple store, a rule store, and a namespace object in order to
......@@ -44,6 +47,11 @@ import gnu.trove.map.hash.*;
*/
public final class ForwardChainer {
/**
* A basic LOGGER.
*/
private static final Logger logger = LoggerFactory.getLogger(ForwardChainer.class);
/**q
* HFC version number string
*/
......@@ -118,7 +126,7 @@ public final class ForwardChainer {
* a similar variable exists in class RuleStore
* @see #exitOnError
*/
public boolean verbose = true;
public boolean verbose = false;
/**
* a constant that controls whether the system is terminated in case an invalid
......@@ -173,11 +181,11 @@ public final class ForwardChainer {
*/
private void init() {
if (this.verbose) {
System.out.println();
System.out.println(" Welcome to HFC, HUK's Forward Chainer");
System.out.println(" " + ForwardChainer.INFO);
System.out.println(" # CPU cores: " + this.noOfCores);
System.out.println(" " + this.toString());
//System.out.println();
logger.info(" Welcome to HFC, HUK's Forward Chainer");
logger.info(" " + ForwardChainer.INFO);
logger.info(" # CPU cores: " + this.noOfCores);
logger.info(" " + this.toString());
}
}
......@@ -363,6 +371,49 @@ public final class ForwardChainer {
this.noOfTasks = this.ruleStore.allRules.size();
}
/**
* this version allows to explicitly define the namespace
* @throws IOException
* @throws WrongFormatException
* @throws FileNotFoundException
*/
public ForwardChainer(String tupleFile, String ruleFile, String namespaceFile, String indexFile)
throws FileNotFoundException, WrongFormatException, IOException, IndexingException {
this();
Namespace namespace = new Namespace(namespaceFile);
IndexStore indexStore = new IndexStore(indexFile, this.verbose);
this.tupleStore = new TupleStore(this.noOfAtoms, this.noOfTuples, namespace, tupleFile, indexStore);
this.ruleStore = new RuleStore(this.tupleStore, ruleFile);
this.threadPool = Executors.newFixedThreadPool(this.noOfCores);
this.noOfTasks = this.ruleStore.allRules.size();
}
public ForwardChainer(int noOfCores,
boolean verbose,
boolean rdfCheck,
boolean eqReduction,
int minNoOfArgs,
int maxNoOfArgs,
int noOfAtoms,
int noOfTuples,
String tupleFile,
String ruleFile,
String namespaceFile,
String indexFile)
throws FileNotFoundException, WrongFormatException, IOException, IndexingException {
this(noOfCores, verbose);
this.noOfAtoms = noOfAtoms;
this.noOfTuples = noOfTuples;
Namespace namespace = new Namespace(namespaceFile, verbose);
IndexStore indexStore = new IndexStore(indexFile,this.verbose);
this.tupleStore = new TupleStore(verbose, rdfCheck, eqReduction, minNoOfArgs, maxNoOfArgs,
this.noOfAtoms, this.noOfTuples, namespace, tupleFile, indexStore);
this.ruleStore = new RuleStore(verbose, rdfCheck, minNoOfArgs, maxNoOfArgs,
this.tupleStore, ruleFile);
this.threadPool = Executors.newFixedThreadPool(this.noOfCores);
this.noOfTasks = this.ruleStore.allRules.size();
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
/**
......@@ -768,8 +819,8 @@ public final class ForwardChainer {
Set<Integer> rhsvars = rule.rhsVariables; // proper RHS vars w/o BN vars
Set<Integer> bnvars = rule.blankNodeVariables;
if (this.verbose) {
synchronized (System.out) {
System.out.println(" " + rule.name + ": " + rule.megaCluster.old.size() +
synchronized (logger) {
logger.info(" " + rule.name + ": " + rule.megaCluster.old.size() +
" " + rule.megaCluster.delta.size());
}
}
......@@ -857,8 +908,8 @@ public final class ForwardChainer {
// do not execute rules which have a priority less or equal 0
if (rule.priority <= 0) {
if (this.verbose)
synchronized (System.out) {
System.out.println(" " + rule.name + ": off");
synchronized (logger) {
logger.info(" " + rule.name + ": off");
}
return;
}
......@@ -867,8 +918,8 @@ public final class ForwardChainer {
// and check whether rule is applicable on local grounds
if (! rule.isApplicable) {
if (this.verbose)
synchronized (System.out) {
System.out.println(" " + rule.name + ": local");
synchronized (logger) {
logger.info(" " + rule.name + ": local");
}
return;
}
......@@ -876,8 +927,8 @@ public final class ForwardChainer {
executeGlobalMatch(rule);
if (! rule.isApplicable) {
if (this.verbose)
synchronized (System.out) {
System.out.println(" " + rule.name + ": global");
synchronized (logger) {
logger.info(" " + rule.name + ": global");
}
return;
}
......@@ -885,8 +936,8 @@ public final class ForwardChainer {
applyTests(rule);
if (! rule.isApplicable) {
if (this.verbose)
synchronized (System.out) {
System.out.println(" " + rule.name + ": tests");
synchronized (logger) {
logger.info(" " + rule.name + ": tests");
}
return;
}
......@@ -894,8 +945,8 @@ public final class ForwardChainer {
prepareInstantiation(rule);
if (! rule.isApplicable) {
if (this.verbose)
synchronized (System.out) {
System.out.println(" " + rule.name + ": cluster");
synchronized (logger) {
logger.info(" " + rule.name + ": cluster");
}
return;
}
......@@ -930,14 +981,14 @@ public final class ForwardChainer {
public boolean computeClosure(int noOfIterations, boolean cleanUpRepository) {
int noOfAllTuples = this.tupleStore.allTuples.size();
if (this.verbose)
System.out.println("\n number of all tuples: " + noOfAllTuples + "\n");
logger.info("\n number of all tuples: " + noOfAllTuples + "\n");
int currentIteration = 0;
long time = System.currentTimeMillis();
long fullTime = time;
boolean newInfo = false;
int noOfNewTuples = 0;
if (this.verbose)
System.out.println(" rule name: old new OR failure stage");
logger.info(" rule name: old new OR failure stage");
// increment generation counter for deletion here AND also at the very end
boolean notContained;
++this.tupleStore.generation;
......@@ -947,7 +998,7 @@ public final class ForwardChainer {
// increment number of local iterations wrt. computeClosure()
++currentIteration;
if (this.verbose)
System.out.println(" " + currentIteration);