Пример #1
0
  @Override
  public boolean isApplicable(TableauTree tree) {
    if (tree.getConcepts() == null || tree.getConcepts().isEmpty()) {
      tree.addAppliedRule(this.getClass());
      return false;
    }

    if (tree.isRuleApplied(this.getClass())) {
      return false;
    }

    return getExistencialTerm(tree) != null;
  }
Пример #2
0
  /**
   * @return
   * @author jmayaalv
   */
  private RoleTerm getExistencialTerm(TableauTree tree) {

    RoleTerm rTerm = null;
    for (Term term : tree.getConcepts()) {
      if (term instanceof RoleTerm) {
        RoleTerm roleTerm = (RoleTerm) term;
        if (RoleTerm.RoleTermOperation.EXISTENTIAL_RESTRICTION.equals(roleTerm.getOperation())) {
          rTerm = roleTerm;
          break;
        }
      }
    }

    if (rTerm == null) {
      tree.addAppliedRule(this.getClass());
    }

    return rTerm;
  }