Esempio n. 1
0
        internal Interpretation GeneralizeBy(FeatureCover cover, ComposedGraph graph)
        {
            var mapping = cover.CreateNodeMapping(graph);

            var isContractable = _rules.Any(r => r is InsertPoolRule);

            if (mapping.IsEmpty)
            {
                //there is nothing to generalize
                if (isContractable)
                {
                    //contractable interpretation without generalization is trivial
                    return(null);
                }
                else
                {
                    return(this);
                }
            }

            mapping.IsGeneralizeMapping = true;
            var newRules = mapRules(mapping);

            if (!mapping.WasUsed && isContractable)
            {
                //mapping wasnt used, so the contractable interpretation is trivial
                return(null);
            }

            return(new Interpretation(newRules));
        }
Esempio n. 2
0
        internal Interpretation InstantiateBy(FeatureCover cover, ComposedGraph graph)
        {
            var mapping = cover.CreateNodeMapping(graph);

            if (mapping.IsEmpty)
            {
                return(this);
            }

            mapping.IsGeneralizeMapping = false;
            var newRules = mapRules(mapping);

            return(new Interpretation(newRules));
        }