src/main/java/org/thegalactic/rule/ImplicationalSystem.java
public TreeSet<Comparable> closure(TreeSet<Comparable> x) {
        TreeSet<Comparable> oldES = new TreeSet<Comparable>();
        // all the attributes are in their own closure
        TreeSet<Comparable> newES = new TreeSet<Comparable>(x);
        do {
            oldES.addAll(newES);
            for (Rule rule : this.sigma) {
                if (newES.containsAll(rule.getPremise()) || rule.getPremise().isEmpty()) {
                    newES.addAll(rule.getConclusion());
                }
            }
        } while (!oldES.equals(newES));
        return newES;
    }
/**
     * Builds the closure of a set X of indexed elements.
     *
     * The closure is initialised with X. The closure is incremented with the
     * conclusion of each rule whose premise is included in it. Iterations over
     * the rules are performed until no new element has to be added in the
     * closure.
     *
     * For direct ImplicationalSystem, only one iteration is needed, and the
     * treatment is performed in O(|Sigma||S|).
     *
     * For non direct ImplicationalSystem, at most |S| iterations are needed,
     * and this tratment is performed in O(|Sigma||S|^2).
     *
     * @param x a TreeSet of indexed elements
     *
     * @return the closure of X for this component
     */
Builds the closure of a set X of indexed elements.
The closure is initialised with X. The closure is incremented with the
conclusion of each rule whose premise is included in it. Iterations over
the rules are performed until no new element has to be added in the
closure.

For direct ImplicationalSystem, only one iteration is needed, and the
treatment is performed in O(|Sigma||S|).



@param x a TreeSet of indexed elements

@return the closure of X for this component
Builds the closure of a set X of indexed elements . The closure is initialised with X . The closure is incremented with the conclusion of each rule whose premise is included in it . Iterations over the rules are performed until no new element has to be added in the closure . For direct ImplicationalSystem only one iteration is needed and the treatment is performed in O ( |Sigma||S| ) . @param x a TreeSet of indexed elements @return the closure of X for this component
public TreeSet<Comparable> closure(TreeSet<Comparable> x) {
        TreeSet<Comparable> oldES = new TreeSet<Comparable>();
        TreeSet<Comparable> newES = new TreeSet<Comparable>(x);
        do {
            oldES.addAll(newES);
            for (Rule rule : this.sigma) {
                if (newES.containsAll(rule.getPremise()) || rule.getPremise().isEmpty()) {
                    newES.addAll(rule.getConclusion());
                }
            }
        } while (!oldES.equals(newES));
        return newES;
    }
public TreeSet < Comparable > closure ( TreeSet < Comparable > x ) { TreeSet < Comparable > oldES = new TreeSet < Comparable > ( ) ; TreeSet < Comparable > newES = new TreeSet < Comparable > ( x ) ; do { oldES . addAll ( newES ) ; for ( Rule rule : this . sigma ) { if ( newES . containsAll ( rule . getPremise ( ) ) || rule . getPremise ( ) . isEmpty ( ) ) { newES . addAll ( rule . getConclusion ( ) ) ; } } } while ( ! oldES . equals ( newES ) ) ; return newES ; }
Builds the closure of a set X of indexed elements.
Builds the closure of a set X of indexed elements .
// all the attributes are in their own closure