/** * Constructing the state for the initiator job. It is required that the * saturation is already computed for the root of the initiator job. * * @param initiatorJob * @param saturationState */ TransitiveReductionState(J initiatorJob, SaturationState<?> saturationState) { this.initiatorJob = initiatorJob; this.rootEquivalent = new ArrayList<ElkClass>(1); this.prunedSubsumers = new ArrayHashSet<IndexedClass>(8); Set<IndexedClassExpression> subsumers = saturationState.getContext( initiatorJob.getInput()).getComposedSubsumers(); this.subsumerIterator = subsumers.iterator(); this.subsumerCount = subsumers.size(); }
/** * Constructing the state for the initiator job. It is required that the * saturation is already computed for the root of the initiator job. * * @param initiatorJob * @param saturationState */ TransitiveReductionState(J initiatorJob, SaturationState<?> saturationState) { this.initiatorJob = initiatorJob; this.rootEquivalent = new ArrayList<ElkClass>(1); this.prunedSubsumers = new ArrayHashSet<IndexedClass>(8); Set<IndexedClassExpression> subsumers = saturationState.getContext( initiatorJob.getInput()).getComposedSubsumers(); this.subsumerIterator = subsumers.iterator(); this.subsumerCount = subsumers.size(); }
/** * Constructing the state for the initiator job. It is required that the * saturation is already computed for the root of the initiator job. * * @param initiatorJob * @param saturationState */ TransitiveReductionState(J initiatorJob, SaturationState<?> saturationState) { this.initiatorJob = initiatorJob; this.rootEquivalent = new ArrayList<ElkClass>(1); this.prunedSubsumers = new ArrayHashSet<IndexedClass>(8); Set<IndexedClassExpression> subsumers = saturationState.getContext( initiatorJob.getInput()).getComposedSubsumers(); this.subsumerIterator = subsumers.iterator(); this.subsumerCount = subsumers.size(); }
@Override protected void process(ArrayList<Context> contexts) { long ts = CachedTimeThread.getCurrentTimeMillis(); int contextCount = 0; int subsumerCount = 0; procNumber_++; for (Context context : contexts) { contextProcessor_.process(context); contextCount++; subsumerCount += context.getComposedSubsumers().size(); } localStats_.changeInitContextCollectionProcessingTime += (CachedTimeThread .getCurrentTimeMillis() - ts); localStats_.countContexts += contextCount; if (contextCount > 0) { localStats_.countContextSubsumers += (subsumerCount / contextCount); } }
@Override protected void process(ArrayList<Context> contexts) { long ts = CachedTimeThread.getCurrentTimeMillis(); int contextCount = 0; int subsumerCount = 0; procNumber_++; for (Context context : contexts) { contextProcessor_.process(context); contextCount++; subsumerCount += context.getComposedSubsumers().size(); } localStats_.changeInitContextCollectionProcessingTime += (CachedTimeThread .getCurrentTimeMillis() - ts); localStats_.countContexts += contextCount; if (contextCount > 0) { localStats_.countContextSubsumers += (subsumerCount / contextCount); } }
@Override protected void process(ArrayList<Context> contexts) { long ts = CachedTimeThread.getCurrentTimeMillis(); int contextCount = 0; int subsumerCount = 0; procNumber_++; for (Context context : contexts) { contextProcessor_.process(context); contextCount++; subsumerCount += context.getComposedSubsumers().size(); } localStats_.changeInitContextCollectionProcessingTime += (CachedTimeThread .getCurrentTimeMillis() - ts); localStats_.countContexts += contextCount; if (contextCount > 0) { localStats_.countContextSubsumers += (subsumerCount / contextCount); } }
@Override public void execute() throws ElkException { int cnt = 0; for (Context context : reasoner_.saturationState.getContexts()) { cnt += context.getComposedSubsumers().size(); } cnt = 2 * cnt - cnt; }
.getComposedSubsumers(); if (composedSubsumers .size() > changedComposedSubsumers_.length >> 2) {
.getComposedSubsumers(); if (composedSubsumers .size() > changedComposedSubsumers_.length >> 2) {
.getComposedSubsumers(); if (composedSubsumers .size() > changedComposedSubsumers_.length >> 2) {
@Override public void execute() throws ElkException { // check roots for all contexts now for (Context context : reasoner_.saturationState.getContexts()) { if (!context.getComposedSubsumers().contains(context.getRoot())) { LOGGER_.error(context.getRoot() + (context.isSaturated() ? " [saturated]" : " [modified]") + ": not a subsumer of itself"); } ClassInference inference = context.takeToDo(); if (inference != null) { LOGGER_.error(context.getRoot() + ": non-empty TODO: " + inference); } } }
.getNotSaturatedContexts()) { cleanedContexts.add(context.getRoot()); if (!context.getComposedSubsumers().isEmpty()) { LOGGER_.error( "{}: context not cleaned: there are {} subsumers: {}", context, context.getComposedSubsumers().size(), context.getComposedSubsumers());
Context context = saturationState.getContext(A); assertTrue("A contains A", context.getComposedSubsumers().contains(A)); assertTrue("A contains B", context.getComposedSubsumers().contains(B)); assertTrue("A contains C", context.getComposedSubsumers().contains(C)); assertTrue("A contains I", context.getComposedSubsumers().contains(I)); assertTrue("A contains D", context.getComposedSubsumers().contains(D));
.getComposedSubsumers()) { iceValidator_.checkNew(composedSubsumer);
classExpressionSaturation.finish(); assertTrue("A contains D", saturationState.getContext(A).getComposedSubsumers() .contains(D));