Package aterm

Examples of aterm.ATermList


    }

    axiom.getOWLClass().accept( this );
    ATermAppl c = term;

    ATermList classes = ATermUtils.EMPTY_LIST;
    for( OWLClassExpression desc : axiom.getClassExpressions() ) {
      desc.accept( this );
      classes = classes.insert( result() );
    }

    kb.addDisjointClasses( classes );
    kb.addEquivalentClass( c, ATermUtils.makeOr( classes ) );
  }
View Full Code Here


      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
    ATermList setOfTerms = size > 0
      ? ATermUtils.toSet( terms, size )
      : ATermUtils.EMPTY_LIST;
    term = ATermUtils.makeAnd( setOfTerms );
  }
View Full Code Here

      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
    ATermList setOfTerms = size > 0
      ? ATermUtils.toSet( terms, size )
      : ATermUtils.EMPTY_LIST;
    term = ATermUtils.makeOr( setOfTerms );
  }
View Full Code Here

        visit((ATermAppl) term.getArgument(0));
  }

  public void visitOneOf(ATermAppl term) {
        out.print("{");
        ATermList list = (ATermList) term.getArgument(0);
    while (!list.isEmpty()) {
      ATermAppl value = (ATermAppl) list.getFirst();
      visit((ATermAppl) value.getArgument(0));
      list = list.getNext();
      if(!list.isEmpty())
        out.print(" ");
    }
        out.print("}");
  }
View Full Code Here

 
  public void visitRestrictedDatatype(ATermAppl dt) {
        out.print("");
        visit((ATermAppl) dt.getArgument(0));
        out.print("[");
        ATermList list = (ATermList) dt.getArgument( 1 );
    while (!list.isEmpty()) {
      ATermAppl facet = (ATermAppl) list.getFirst();
      out.print( FACETS.get( facet.getArgument( 0 ) ));
      out.print(" ");
      visit((ATermAppl) facet.getArgument( 1 ));
      list = list.getNext();
      if(!list.isEmpty())
        out.print(", ");
    }
        out.print("]");
  }
View Full Code Here

    if( node != null ) {
      return IteratorUtils.singletonIterator( node );
    }

    if( ATermUtils.isAnd( c ) ) {
      ATermList list = (ATermList) c.getArgument( 0 );
      CachedNode[] nodes = new CachedNode[list.getLength()];
      for( int i = 0; !list.isEmpty(); list = list.getNext() ) {
        ATermAppl d = (ATermAppl) list.getFirst();
        node = abox.getCached( d );
        if( node == null )
          return IteratorUtils.emptyIterator();
        else if( node.isBottom() )
          return IteratorUtils.singletonIterator( node );
View Full Code Here

      ATerm p = av.getArgument(0);
      ATermAppl c = (ATermAppl) av.getArgument(1);
      Role s = cxt.blocked.getABox().getRole(p);

      if (p instanceof ATermList) {
        ATermList chain = (ATermList) p;

        if (!isBlockedByChain(cxt, chain, c))
          return false;
      }
      else if (s.isDatatypeRole()) {
        continue;
      }
      else {
        Role invS = s.getInverse();

        if (cxt.isRSuccessor(invS) && !cxt.blocked.getParent().hasType(c))
          return false;

        if (!s.isSimple()) {
          Set<ATermList> subRoleChains = s.getSubRoleChains();
          for (Iterator<ATermList> it = subRoleChains.iterator(); it.hasNext();) {
            ATermList chain = it.next();

            if (!isBlockedByChain(cxt, chain, c))
              return false;
          }
        }
View Full Code Here

    /* (non-Javadoc)
     * @see org.mindswap.pellet.utils.ATermVisitor#visitOneOf(aterm.ATermAppl)
     */
    public void visitOneOf(ATermAppl term) {
        out.print("oneOf(");
        ATermList list = (ATermList) term.getArgument(0);
    while (!list.isEmpty()) {
      ATermAppl value = (ATermAppl) list.getFirst();
      visit((ATermAppl) value.getArgument(0));
      list = list.getNext();
      if(!list.isEmpty())
        out.print(" ");
    }
        out.print(")");
    }
View Full Code Here

   */
  public void visitRestrictedDatatype(ATermAppl dt) {
        out.print("datatypeRestriction(");
        visit((ATermAppl) dt.getArgument(0));
        out.print(" ");
        ATermList list = (ATermList) dt.getArgument( 1 );
    while (!list.isEmpty()) {
      ATermAppl facet = (ATermAppl) list.getFirst();
      out.print("(");
      visit((ATermAppl) facet.getArgument( 0 ));
      out.print(" ");
      visit((ATermAppl) facet.getArgument( 1 ));
      out.print(")");     
      list = list.getNext();
      if(!list.isEmpty())
        out.print(" ");
    }
        out.print(" )");
  }
View Full Code Here

    obj = factory.getOWLObjectHasSelf( prop );

  }

  public void visitOneOf(ATermAppl term) {
    ATermList list = (ATermList) term.getArgument( 0 )

    if( ATermUtils.isLiteral((ATermAppl) ((ATermAppl) list.getFirst()).getArgument( 0 ))) {
      Set<OWLLiteral> set = new HashSet<OWLLiteral>();

      for( ; !list.isEmpty(); list = list.getNext() ) {   
        ATermAppl first = (ATermAppl) list.getFirst();
        if (!ATermUtils.isLiteral((ATermAppl) first.getArgument(0)))
          throw new InternalReasonerException("Conversion error, expecting literal but found: " + first);
        visitLiteral((ATermAppl) first.getArgument(0));
        set.add( (OWLLiteral) obj );
      }

      obj = factory.getOWLDataOneOf( set );
    }
    else {
      Set<OWLIndividual> set = new HashSet<OWLIndividual>();

      for( ; !list.isEmpty(); list = list.getNext() ) {   
        ATermAppl first = (ATermAppl) list.getFirst();
        OWLIndividual ind = convertIndividual( (ATermAppl) first.getArgument( 0 ) );
        set.add( ind );
      }

      obj = factory.getOWLObjectOneOf( set );
View Full Code Here

TOP

Related Classes of aterm.ATermList

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.