Giter Site home page Giter Site logo

Comments (4)

greeny277 avatar greeny277 commented on May 25, 2024

I'm using version 2.6.4-SNAPSHOT. However, the Pellet reasoner already has this bug.

from openllet.

ignazio1977 avatar ignazio1977 commented on May 25, 2024

at least use a try{...}catch(Exception e){...} construct

That's a reasonable expectation but the issue here is more subtle.

There is a .next() on an empty iterator, and from the code I suspect there is an incorrect condition being checked:

                 if (dtReasoner.isSatisfiable(types))
			{
				if (!dtReasoner.containsAtLeast(2, types))

                                   ^^^^^^^^^^^^^^^ This is strange. 

I think the ! is misplaced - it's trying to merge nodes when there are not at least two nodes, i.e., when there is one node or no nodes, like in this case. I suspect the intention was to only merge nodes when there are two or more nodes (and where the .next() operation would have been safe)

				{
					/*
					 * This literal is a variable, but given _current ranges can only
					 * take on a single _value.  Merge with that _value.
					 */
					final Object value = dtReasoner.valueIterator(types).next();
					final ATermAppl valueTerm = dtReasoner.getLiteral(value);
					Literal valueLiteral = _abox.getLiteral(valueTerm);
					if (valueLiteral == null)
						/*
						 * No dependency set is used here because omitting it prevents the
						 * constant literal from being removed during backtrack
						 */
						valueLiteral = _abox.addLiteral(valueTerm);
					DependencySet mergeDs = DependencySet.INDEPENDENT;
					for (final DependencySet ds : _depends.values())
						mergeDs = mergeDs.union(ds, _abox.doExplanation());
					_merge = new NodeMerge(this, valueLiteral, mergeDs);
				}
			}

from openllet.

greeny277 avatar greeny277 commented on May 25, 2024

Ah ok. So I guess it's a bug that can be easily fixed.

from openllet.

Galigator avatar Galigator commented on May 25, 2024

In fact I spend some weekends on it. It is harder to fix because simple change around this create problems elsewhere. It may need a modern rewrite with less mutable structures.

from openllet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.