hylar/core/ReasoningEngine.js
function(FeAdd, FeDel, F, R) {
        var FiAdd = [], FiAddNew = [], additions, deletions,
            Fe = Logics.getOnlyExplicitFacts(F), FiAddNew = [];

        // Deletion
        if(FeDel && FeDel.length) {
            Fe = Logics.minus(Fe, FeDel);
        }

        // Insertion
        if(FeAdd && FeAdd.length) {
            Fe = Utils.uniques(Fe, FeAdd);
        }

        // Recalculation
        do {
            FiAdd = Utils.uniques(FiAdd, FiAddNew);
            FiAddNew = Solver.evaluateRuleSet(R, Utils.uniques(Fe, FiAdd));
        } while (!Logics.containsFacts(FiAdd, FiAddNew));

        additions = Utils.uniques(FeAdd, FiAdd);
        deletions = Logics.minus(F, Utils.uniques(Fe, FiAdd));

        F = Utils.uniques(Fe, FiAdd);

        return {
            additions: additions,
            deletions: deletions,
            updatedF: F
        };
    }
function(FeAdd, FeDel, F, R) {
        var FiAdd = [], FiAddNew = [], additions, deletions,
            Fe = Logics.getOnlyExplicitFacts(F), FiAddNew = [];

        // Deletion
        if(FeDel && FeDel.length) {
            Fe = Logics.minus(Fe, FeDel);
        }

        // Insertion
        if(FeAdd && FeAdd.length) {
            Fe = Utils.uniques(Fe, FeAdd);
        }

        // Recalculation
        do {
            FiAdd = Utils.uniques(FiAdd, FiAddNew);
            FiAddNew = Solver.evaluateRuleSet(R, Utils.uniques(Fe, FiAdd));
        } while (!Logics.containsFacts(FiAdd, FiAddNew));

        additions = Utils.uniques(FeAdd, FiAdd);
        deletions = Logics.minus(F, Utils.uniques(Fe, FiAdd));

        F = Utils.uniques(Fe, FiAdd);

        return {
            additions: additions,
            deletions: deletions,
            updatedF: F
        };
    }
function ( FeAdd , FeDel , F , R ) { var FiAdd = [ ] , FiAddNew = [ ] , additions , deletions , Fe = Logics . getOnlyExplicitFacts ( F ) , FiAddNew = [ ] ; // Deletion if ( FeDel && FeDel . length ) { Fe = Logics . minus ( Fe , FeDel ) ; } // Insertion if ( FeAdd && FeAdd . length ) { Fe = Utils . uniques ( Fe , FeAdd ) ; } // Recalculation do { FiAdd = Utils . uniques ( FiAdd , FiAddNew ) ; FiAddNew = Solver . evaluateRuleSet ( R , Utils . uniques ( Fe , FiAdd ) ) ; } while ( ! Logics . containsFacts ( FiAdd , FiAddNew ) ) ; additions = Utils . uniques ( FeAdd , FiAdd ) ; deletions = Logics . minus ( F , Utils . uniques ( Fe , FiAdd ) ) ; F = Utils . uniques ( Fe , FiAdd ) ; return { additions : additions , deletions : deletions , updatedF : F } ; }
A naive reasoner that recalculates the entire knowledge base.
@deprecated
@param triplesIns
@param triplesDel
@param rules
@returns {{fi: *, fe: *}}
A naive reasoner that recalculates the entire knowledge base .