Examples of Disjunction


Examples of ca.ucalgary.ispia.rebac.Disjunction

   

    else if (policy instanceof Disjunction){

      Disjunction temp = (Disjunction) policy;

     

      Set temp_setA = findFreeVars(temp.getPolicyA(), new HashSet<Object>());

      Set temp_setB = findFreeVars(temp.getPolicyB(), new HashSet<Object>());

      free_vars.addAll(temp_setA);

      free_vars.addAll(temp_setB);

    }

   

    else if (policy instanceof Box){

      Box temp = (Box) policy;

      findFreeVars(temp.getPolicy(), free_vars);

    }

   

    else if (policy instanceof Diamond){

      Diamond temp = (Diamond) policy;

      free_vars = findFreeVars(temp.getPolicy(), free_vars);

    }

   

    else if (policy instanceof Bind){

      Bind temp = (Bind) policy;

      findFreeVars(temp.getPolicy(), free_vars);

      free_vars.remove(temp.getVariable());

    }

   

    else if (policy instanceof At){

      At temp = (At) policy;

      findFreeVars(temp.getPolicy(), free_vars);

      free_vars.add(temp.getVariable());

    }

    return free_vars;
View Full Code Here

Examples of eas.users.lukas.tnt.propositionalCalculus.Disjunction

    public static void main(String[] args) throws CloneNotSupportedException {
        Variable a = new Variable(0), b = new Variable(1), c = new Variable(2);
        Variable d = new Variable(3), e = new Variable(4), f = new Variable(5);
        Statement s1 = new Negation(new Exists(new Exists(new Exists(new Equality(new Multiplication(new Multiplication(a, a), a), new Addition(new Multiplication(new Multiplication(new Addition(b, new Number(1)), new Addition(b, new Number(1))), new Addition(b, new Number(1))), new Multiplication(new Multiplication(new Addition(c, new Number(1)), new Addition(c, new Number(1))), new Addition(c, new Number(1))))), c), b), a));
        Statement s2 = s1.clone();
        s1 = new Disjunction(new Conjunction(s1.clone(), s1.clone()), s1.clone());
        Statement s3 = s2.clone();
        renameVarConsistently(s3, a.clone(), d.clone());
        renameVarConsistently(s3, b.clone(), e.clone());
        renameVarConsistently(s3, c.clone(), f.clone());
        s2 = new Disjunction(new Conjunction(s2.clone(), s3.clone()), s3.clone());
       
        renameVarConsistently(s2, b, a);
        System.out.println(s1);
        System.out.println(s2);
        System.out.println(match(s1, s2));
View Full Code Here

Examples of lupos.rif.model.Disjunction

        conj.addExpr((IExpression) node.accept(this, conj));
      return conj;
    case 1:
      final NodeListOptional orFormulas = (NodeListOptional) ((List<INode>) n.f0.choice
          .accept(this, argu)).get(2);
      final Disjunction disj = new Disjunction();
      disj.setParent(argu);
      for (final INode node : (List<INode>) orFormulas.accept(this, disj))
        disj.addExpr((IExpression) node.accept(this, disj));
      return disj;
    case 2:
      final List<INode> existINodes = (List<INode>) n.f0.choice.accept(
          this, argu);
      final ExistExpression exists = new ExistExpression();
View Full Code Here

Examples of lupos.rif.model.Disjunction

      result.exprs.add((IExpression) expr.accept(this, result));
    return result;
  }

  public IRuleNode visit(Disjunction obj, IRuleNode arg) throws RIFException {
    final Disjunction result = new Disjunction();
    result.setParent(arg);
    List<IExpression> exprs = new ArrayList<IExpression>(obj.exprs);
    for (IExpression expr : exprs)
      result.exprs.add((IExpression) expr.accept(this, result));
    return result;
  }
View Full Code Here

Examples of org.apache.ode.ql.tree.nodes.Disjunction

        return new Conjunction(childs);
    }
   
    private Disjunction createDisjunction(Node node) {
        Collection<LogicNode> childs = extractLogicNodes(node);
        return new Disjunction(childs);
    }
View Full Code Here

Examples of org.hibernate.criterion.Disjunction

    DocumentBuilder<?> builder = searchFactoryImplementor.getDocumentBuilder( entityType );
    String idName = builder.getIdentifierName();
    int loop = maxResults / MAX_IN_CLAUSE;
    boolean exact = maxResults % MAX_IN_CLAUSE == 0;
    if ( !exact ) loop++;
    Disjunction disjunction = Restrictions.disjunction();
    for (int index = 0; index < loop; index++) {
      int max = index * MAX_IN_CLAUSE + MAX_IN_CLAUSE <= maxResults ?
          index * MAX_IN_CLAUSE + MAX_IN_CLAUSE :
          maxResults;
      List<Serializable> ids = new ArrayList<Serializable>( max - index * MAX_IN_CLAUSE );
      for (int entityInfoIndex = index * MAX_IN_CLAUSE; entityInfoIndex < max; entityInfoIndex++) {
        ids.add( entityInfos[entityInfoIndex].id );
      }
      disjunction.add( Restrictions.in( idName, ids ) );
    }
    criteria.add( disjunction );
    criteria.list(); //load all objects
  }
View Full Code Here

Examples of org.hibernate.criterion.Disjunction

    Set<Class<?>> indexedEntities = searchFactoryImplementor.getIndexedTypesPolymorphic( new Class<?>[] { entityType } );
    DocumentBuilderIndexedEntity<?> builder = searchFactoryImplementor.getDocumentBuilderIndexedEntity(
        indexedEntities.iterator().next()
    );
    String idName = builder.getIdentifierName();
    Disjunction disjunction = Restrictions.disjunction();

    int loop = maxResults / MAX_IN_CLAUSE;
    boolean exact = maxResults % MAX_IN_CLAUSE == 0;
    if ( !exact ) {
      loop++;
    }
    for ( int index = 0; index < loop; index++ ) {
      int max = index * MAX_IN_CLAUSE + MAX_IN_CLAUSE <= maxResults ?
          index * MAX_IN_CLAUSE + MAX_IN_CLAUSE :
          maxResults;
      List<Serializable> ids = new ArrayList<Serializable>( max - index * MAX_IN_CLAUSE );
      for ( int entityInfoIndex = index * MAX_IN_CLAUSE; entityInfoIndex < max; entityInfoIndex++ ) {
        ids.add( entityInfos[entityInfoIndex].id );
      }
      disjunction.add( Restrictions.in( idName, ids ) );
    }
    criteria.add( disjunction );
    //not best effort so fail fast
    if ( timeoutManager.getType() != TimeoutManager.Type.LIMIT ) {
      Long timeLeftInSecond = timeoutManager.getTimeoutLeftInSeconds();
View Full Code Here

Examples of org.hibernate.criterion.Disjunction

    {
      for(String alias: aliases)
      {
        criteria.createAlias(alias, alias);
      }
      Disjunction disjunction = Restrictions.disjunction();
      criteria.add(disjunction);
      for(String property: properties)
      {
        disjunction.add(Restrictions.ilike(property,
              searchPanel.getDefaultModelObject().toString(),
              MatchMode.ANYWHERE));
      }
    }
  }
View Full Code Here

Examples of org.hibernate.criterion.Disjunction

    } catch (Exception e) {
      logger.trace("Exception", e);
    }
    if (aktuellerNutzer != null) {
      if (loginForm.getMaximaleBerechtigung() > 1) {
        Disjunction dis = Restrictions.disjunction();
        for (Projekt proj : aktuellerNutzer.getProjekteList()) {
          dis.add(Restrictions.eq("projekt", proj));
        }
        con.add(dis);
      }
    }
  }
View Full Code Here

Examples of org.hibernate.criterion.Disjunction

   */
  public Criterion build(PropertyFilter filter) {
    Object value = convertMatchValue(filter.getMatchValue(), filter.getFieldType());
    Criterion criterion = null;
    if (filter.hasMultiplePropertyNames()) {
      Disjunction disjunction = Restrictions.disjunction();
      for (String propertyName:filter.getPropertyNames()) {
        disjunction.add(build(propertyName,value));
      }
      criterion = disjunction;
    } else {
      criterion = build(filter.getSinglePropertyName(),value);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.