src/main/java/org/thegalactic/rule/ImplicationalSystem.java
public int makeProper() {
        ImplicationalSystem save = new ImplicationalSystem(this);
        for (Rule rule : save.sigma) {
            // deletes elements of conclusion which are in the premise
            Rule newR = new Rule(rule.getPremise(), rule.getConclusion());
            for (Object e : rule.getConclusion()) {
                if (newR.getPremise().contains(e)) {
                    newR.removeFromConclusion(e);
                }
            }
            // replace the rule by the new rule is it has been modified
            if (!rule.equals(newR)) {
                this.replaceRule(rule, newR);
            }
            // delete rule with an empty conclusion
            if (newR.getConclusion().isEmpty()) {
                this.removeRule(newR);
            }
        }
        return save.sizeRules() - this.sizeRules();
    }
/**
     * Makes this component a proper ImplicationalSystem.
     *
     * Elements that are at once in the conclusion and in the premise are
     * deleted from the conclusion. When the obtained conclusion is an empty
     * set, the rule is deleted from this component
     *
     * This treatment is performed in O(|Sigma||S|).
     *
     * @return the difference between the number of rules of this component
     *         before and after this treatment
     */
Makes this component a proper ImplicationalSystem.
Elements that are at once in the conclusion and in the premise are
deleted from the conclusion. When the obtained conclusion is an empty
set, the rule is deleted from this component

This treatment is performed in O(|Sigma||S|).

@return the difference between the number of rules of this component
before and after this treatment
Makes this component a proper ImplicationalSystem . Elements that are at once in the conclusion and in the premise are deleted from the conclusion . When the obtained conclusion is an empty set the rule is deleted from this component This treatment is performed in O ( |Sigma||S| ) . @return the difference between the number of rules of this component before and after this treatment
public int makeProper() {
        ImplicationalSystem save = new ImplicationalSystem(this);
        for (Rule rule : save.sigma) {
            Rule newR = new Rule(rule.getPremise(), rule.getConclusion());
            for (Object e : rule.getConclusion()) {
                if (newR.getPremise().contains(e)) {
                    newR.removeFromConclusion(e);
                }
            }
            if (!rule.equals(newR)) {
                this.replaceRule(rule, newR);
            }
            if (newR.getConclusion().isEmpty()) {
                this.removeRule(newR);
            }
        }
        return save.sizeRules() - this.sizeRules();
    }
public int makeProper ( ) { ImplicationalSystem save = new ImplicationalSystem ( this ) ; for ( Rule rule : save . sigma ) { Rule newR = new Rule ( rule . getPremise ( ) , rule . getConclusion ( ) ) ; for ( Object e : rule . getConclusion ( ) ) { if ( newR . getPremise ( ) . contains ( e ) ) { newR . removeFromConclusion ( e ) ; } } if ( ! rule . equals ( newR ) ) { this . replaceRule ( rule , newR ) ; } if ( newR . getConclusion ( ) . isEmpty ( ) ) { this . removeRule ( newR ) ; } } return save . sizeRules ( ) - this . sizeRules ( ) ; }
Makes this component a proper ImplicationalSystem.
Makes this component a proper ImplicationalSystem .
// deletes elements of conclusion which are in the premise // replace the rule by the new rule is it has been modified // delete rule with an empty conclusion