static public ATermList toSet(final Collection<ATermAppl> terms) { final int size = terms.size(); final ATermAppl[] a = new ATermAppl[size]; terms.toArray(a); return toSet(a, size); }
static public ATermList toSet(final Collection<ATermAppl> terms) { final int size = terms.size(); final ATermAppl[] a = new ATermAppl[size]; terms.toArray(a); return toSet(a, size); }
@Override public void addDisjointClasses(final List<ATermAppl> classes) { if (null == classes) return; addDisjointClasses(ATermUtils.toSet(classes)); }
@Override public void addDisjointClasses(final List<ATermAppl> classes) { if (null == classes) return; addDisjointClasses(ATermUtils.toSet(classes)); }
private static void addTo(final Map<ATermAppl, ATermAppl> map, final ATermAppl roleName, final Set<ATermAppl> asserted) { if (asserted.isEmpty()) return; ATermAppl range = null; if (asserted.size() == 1) range = asserted.iterator().next(); else range = ATermUtils.makeAnd(ATermUtils.toSet(asserted)); range = ELSyntaxUtils.simplify(ATermUtils.nnf(range)); map.put(roleName, range); }
private static void addTo(final Map<ATermAppl, ATermAppl> map, final ATermAppl roleName, final Set<ATermAppl> asserted) { if (asserted.isEmpty()) return; ATermAppl range = null; if (asserted.size() == 1) range = asserted.iterator().next(); else range = ATermUtils.makeAnd(ATermUtils.toSet(asserted)); range = ELSyntaxUtils.simplify(ATermUtils.nnf(range)); map.put(roleName, range); }
public static ATermList normalize(final ATermList list) { final int size = list.getLength(); final ATerm[] terms = new ATerm[size]; int i = 0; for (final ATerm term : list) { terms[i] = normalize((ATermAppl) term); i++; } return toSet(terms, size); }
public static ATermList normalize(final ATermList list) { final int size = list.getLength(); final ATerm[] terms = new ATerm[size]; int i = 0; for (final ATerm term : list) { terms[i] = normalize((ATermAppl) term); i++; } return toSet(terms, size); }
@Override public void visit(final OWLDataIntersectionOf and) { final Set<OWLDataRange> operands = asSet(and.operands()); final ATerm[] terms = new ATerm[operands.size()]; int size = 0; for (final OWLDataRange desc : operands) { desc.accept(this); terms[size++] = _term; } // create a sorted set of terms so we will have a stable // concept creation and removal using this concept will work final ATermList setOfTerms = size > 0 ? ATermUtils.toSet(terms, size) : ATermUtils.EMPTY_LIST; _term = ATermUtils.makeAnd(setOfTerms); }
@Override public void visit(final OWLObjectIntersectionOf and) { final Set<OWLClassExpression> operands = asSet(and.operands()); final ATerm[] terms = new ATerm[operands.size()]; int size = 0; for (final OWLClassExpression desc : operands) { desc.accept(this); terms[size++] = _term; } // create a sorted set of terms so we will have a stable // concept creation and removal using this concept will work final ATermList setOfTerms = size > 0 ? ATermUtils.toSet(terms, size) : ATermUtils.EMPTY_LIST; _term = ATermUtils.makeAnd(setOfTerms); }
@Override public void visit(final OWLDataUnionOf or) { final Set<OWLDataRange> operands = asSet(or.operands()); final ATerm[] terms = new ATerm[operands.size()]; int size = 0; for (final OWLDataRange desc : operands) { desc.accept(this); terms[size++] = _term; } // create a sorted set of terms so we will have a stable // concept creation and removal using this concept will work final ATermList setOfTerms = size > 0 ? ATermUtils.toSet(terms, size) : ATermUtils.EMPTY_LIST; _term = ATermUtils.makeOr(setOfTerms); }
@Override public void visit(final OWLDataUnionOf or) { final Set<OWLDataRange> operands = asSet(or.operands()); final ATerm[] terms = new ATerm[operands.size()]; int size = 0; for (final OWLDataRange desc : operands) { desc.accept(this); terms[size++] = _term; } // create a sorted set of terms so we will have a stable // concept creation and removal using this concept will work final ATermList setOfTerms = size > 0 ? ATermUtils.toSet(terms, size) : ATermUtils.EMPTY_LIST; _term = ATermUtils.makeOr(setOfTerms); }
@Override public void visit(final OWLObjectUnionOf or) { final Set<OWLClassExpression> operands = asSet(or.operands()); final ATerm[] terms = new ATerm[operands.size()]; int size = 0; for (final OWLClassExpression desc : operands) { desc.accept(this); terms[size++] = _term; } // create a sorted set of terms so we will have a stable // concept creation and removal using this concept will work final ATermList setOfTerms = size > 0 ? ATermUtils.toSet(terms, size) : ATermUtils.EMPTY_LIST; _term = ATermUtils.makeOr(setOfTerms); }
@Override public void visit(final OWLDataUnionOf or) { final Set<OWLDataRange> operands = asSet(or.operands()); final ATerm[] terms = new ATerm[operands.size()]; int size = 0; for (final OWLDataRange desc : operands) { desc.accept(this); terms[size++] = _term; } // create a sorted set of terms so we will have a stable // concept creation and removal using this concept will work final ATermList setOfTerms = size > 0 ? ATermUtils.toSet(terms, size) : ATermUtils.EMPTY_LIST; _term = ATermUtils.makeOr(setOfTerms); }
@Override public void visit(final OWLDataIntersectionOf and) { final Set<OWLDataRange> operands = asSet(and.operands()); final ATerm[] terms = new ATerm[operands.size()]; int size = 0; for (final OWLDataRange desc : operands) { desc.accept(this); terms[size++] = _term; } // create a sorted set of terms so we will have a stable // concept creation and removal using this concept will work final ATermList setOfTerms = size > 0 ? ATermUtils.toSet(terms, size) : ATermUtils.EMPTY_LIST; _term = ATermUtils.makeAnd(setOfTerms); }
@Override public void visit(final OWLObjectUnionOf or) { final Set<OWLClassExpression> operands = asSet(or.operands()); final ATerm[] terms = new ATerm[operands.size()]; int size = 0; for (final OWLClassExpression desc : operands) { desc.accept(this); terms[size++] = _term; } // create a sorted set of terms so we will have a stable // concept creation and removal using this concept will work final ATermList setOfTerms = size > 0 ? ATermUtils.toSet(terms, size) : ATermUtils.EMPTY_LIST; _term = ATermUtils.makeOr(setOfTerms); }
@Override public void visit(final OWLObjectOneOf enumeration) { final Set<OWLIndividual> operands = asSet(enumeration.individuals()); final ATerm[] terms = new ATerm[operands.size()]; int size = 0; for (final OWLIndividual ind : operands) { ind.accept(this); terms[size++] = ATermUtils.makeValue(_term); } // create a sorted set of terms so we will have a stable // concept creation and removal using this concept will work final ATermList setOfTerms = size > 0 ? ATermUtils.toSet(terms, size) : ATermUtils.EMPTY_LIST; _term = ATermUtils.makeOr(setOfTerms); }
@Override public void visit(final OWLObjectOneOf enumeration) { final Set<OWLIndividual> operands = asSet(enumeration.individuals()); final ATerm[] terms = new ATerm[operands.size()]; int size = 0; for (final OWLIndividual ind : operands) { ind.accept(this); terms[size++] = ATermUtils.makeValue(_term); } // create a sorted set of terms so we will have a stable // concept creation and removal using this concept will work final ATermList setOfTerms = size > 0 ? ATermUtils.toSet(terms, size) : ATermUtils.EMPTY_LIST; _term = ATermUtils.makeOr(setOfTerms); }
private ATermAppl canonicalize(final ATermAppl term) { if (ATermUtils.isAnd(term) || ATermUtils.isOr(term)) { final List<ATermAppl> list = new ArrayList<>(); for (ATermList l = (ATermList) term.getArgument(0); !l.isEmpty(); l = l.getNext()) list.add(canonicalize((ATermAppl) l.getFirst())); final ATermList args = ATermUtils.toSet(list); if (ATermUtils.isAnd(term)) return ATermUtils.makeAnd(args); else return ATermUtils.makeOr(args); } else return term; }
private ATermAppl canonicalize(final ATermAppl term) { if (ATermUtils.isAnd(term) || ATermUtils.isOr(term)) { final List<ATermAppl> list = new ArrayList<>(); for (ATermList l = (ATermList) term.getArgument(0); !l.isEmpty(); l = l.getNext()) list.add(canonicalize((ATermAppl) l.getFirst())); final ATermList args = ATermUtils.toSet(list); if (ATermUtils.isAnd(term)) return ATermUtils.makeAnd(args); else return ATermUtils.makeOr(args); } else return term; }