public static HashSet<int> Estimate(IList<IElement> elements, Func<int, bool> variableIndexPredicate)
 {
     var visitor = new AssignmentEstimatingVisitor(variableIndexPredicate);
     visitor.VisitList(elements);
     return visitor.details.Where(p => p.Value.AssignmentCount == 1 && (p.Value.UseCount < 2 || p.Value.Trivial))
                           .Select(p => p.Key)
                           .ToSet();
 }
        public static HashSet <int> Estimate(IList <IElement> elements, Func <int, bool> variableIndexPredicate)
        {
            var visitor = new AssignmentEstimatingVisitor(variableIndexPredicate);

            visitor.VisitList(elements);
            return(visitor.details.Where(p => p.Value.AssignmentCount == 1 && (p.Value.UseCount < 2 || p.Value.Trivial))
                   .Select(p => p.Key)
                   .ToSet());
        }
        public void Inline(IList <IElement> elements, Func <int, bool> variableIndexPredicate)
        {
            var inlineable = AssignmentEstimatingVisitor.Estimate(elements, variableIndexPredicate);

            AssignmentInliningVisitor.Inline(elements, inlineable);
        }