Package aterm

Examples of aterm.ATermInt


    return this;
  }

  public boolean equivalent(SharedObject obj) {
    if(obj instanceof ATermInt){
      ATermInt peer = (ATermInt) obj;
      if(peer.getType() != getType()) return false;
     
      return (peer.getInt() == value && peer.getAnnotations().equals(getAnnotations()));
    }
   
    return false;
  }
View Full Code Here


        ATermList next = (ATermList) importTerm(list.getNext());
       
        result = makeList(first, next);
        break;
      case ATerm.INT:
        ATermInt integer = (ATermInt) term;
       
        result = makeInt(integer.getInt());
        break;
      case ATerm.LONG:
        ATermLong elongatedType = (ATermLong) term;
       
        result = makeLong(elongatedType.getLong());
View Full Code Here

      }
      else if( af.equals( ATermUtils.VALUEFUN ) || af.equals( ATermUtils.SELFFUN || af.equals( ATermUtils.RESTRDATATYPEFUN ) ) {
        newterm = term;
      }
      else if( af.equals( ATermUtils.MAXFUN ) ) {
        ATermInt n = (ATermInt) arg.getArgument( 1 );
        newterm = ATermUtils.makeMin( arg.getArgument( 0 ), n.getInt() + 1, nnf( arg
            .getArgument( 2 ) ) );
      }
      else if( af.equals( ATermUtils.MINFUN ) ) {
        ATermInt n = (ATermInt) arg.getArgument( 1 );
        if( n.getInt() == 0 ) {
                  newterm = ATermUtils.BOTTOM;
                }
                else {
                  newterm = ATermUtils.makeMax( arg.getArgument( 0 ), n.getInt() - 1, nnf( arg
              .getArgument( 2 ) ) );
                }
      }
      else if( af.equals( ATermUtils.CARDFUN ) ) {
        newterm = nnf( makeNot( makeExactCard( arg.getArgument( 0 ), ((ATermInt) arg
View Full Code Here

      ATermAppl arg = (ATermAppl) arg1;
      if( isNot( arg ) ) {
              simp = simplify( (ATermAppl) arg.getArgument( 0 ) );
            }
            else if( isMin( arg ) ) {
        ATermInt n = (ATermInt) arg.getArgument( 1 );
        if( n.getInt() == 0 ) {
                  simp = BOTTOM;
                }
      }
    }
    else if( fun.equals( ANDFUN ) ) {
      ATermList conjuncts = (ATermList) arg1;
      if( conjuncts.isEmpty() ) {
              simp = TOP;
            }
            else {
        Set<ATermAppl> set = new HashSet<ATermAppl>();
        List<ATermAppl> negations = new ArrayList<ATermAppl>();
        MultiListIterator i = new MultiListIterator( conjuncts );
        while( i.hasNext() ) {
          ATermAppl c = i.next();
          if( c.equals( TOP ) ) {
                      continue;
                    }
                    else if( c.equals( BOTTOM ) ) {
                      return BOTTOM;
                    }
                    else if( isAnd( c ) ) {
                      i.append( (ATermList) c.getArgument( 0 ) );
                    }
                    else if( isNot( c ) ) {
                      negations.add( c );
                    }
                    else {
                      set.add( c );
                    }
        }

        for( ATermAppl notC : negations ) {
          ATermAppl c = (ATermAppl) notC.getArgument( 0 );
          if( set.contains( c ) ) {
                      return BOTTOM;
                    }
        }

        if( set.isEmpty() ) {
          if( negations.isEmpty() ) {
                      return TOP;
                    }
                    else if( negations.size() == 1 ) {
                      return negations.get( 0 );
                    }
        }
        else if( set.size() == 1 && negations.isEmpty() ) {
                  return set.iterator().next();
                }

        negations.addAll( set );
        int size = negations.size();
        ATermAppl[] terms = new ATermAppl[size];
        negations.toArray( terms );
        simp = makeAnd( toSet( terms, size ) );
      }
    }
    else if( fun.equals( ALLFUN ) ) {
      if( arg2.equals( TOP ) ) {
              simp = TOP;
            }
    }
    else if( fun.equals( MINFUN ) ) {
      ATermInt n = (ATermInt) arg2;
      if( n.getInt() == 0 ) {
              simp = TOP;
            }
      if( arg3.equals( ATermUtils.BOTTOM ) ) {
              simp = BOTTOM;
            }
    }
    else if( fun.equals( MAXFUN ) ) {
      ATermInt n = (ATermInt) arg2;
      if( n.getInt() > 0 && arg3.equals( ATermUtils.BOTTOM ) ) {
              simp = TOP;
            }
    }
        else {
          throw new InternalReasonerException( "Unknown term type: " + term );
View Full Code Here

TOP

Related Classes of aterm.ATermInt

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.