public Substitution computeHomomorphsim(CQIE q1, CQIE q2) { IndexedCQ indexedQ1 = indexedCQcache.get(q1); if (indexedQ1 == null) { Collection<Function> q1body = q1.getBody(); if (dependencies != null) q1body = chaseAtoms(q1body); indexedQ1 = new IndexedCQ(q1.getHead(), q1body); indexedCQcache.put(q1, indexedQ1); } // just to speed up the check in case there can be no match for (Function q2atom : q2.getBody()) if (!indexedQ1.factMap.containsKey(q2atom.getFunctionSymbol())) { // in particular, !q2atom.isDataFunction() return null; } return indexedQ1.computeHomomorphism(q2); }
@Override public Substitution computeHomomorphsim(CQIE q1, CQIE q2) { IndexedCQ indexedQ1 = indexedCQcache.get(q1); if (indexedQ1 == null) { Collection<Function> q1body = q1.getBody(); if (dependencies != null) q1body = chaseAtoms(q1body); indexedQ1 = new IndexedCQ(q1.getHead(), q1body); indexedCQcache.put(q1, indexedQ1); } // just to speed up the check in case there can be no match for (Function q2atom : q2.getBody()) if (!indexedQ1.factMap.containsKey(q2atom.getFunctionSymbol())) { // in particular, !q2atom.isDataFunction() return null; } return indexedQ1.computeHomomorphism(q2); }