/*
         * The method Skolemize performs best-effort skolemization of the input expression expr.
         * If polarity == Polarity.Negative, a quantifier F embedded in expr is skolemized
         * provided it can be proved that F is a forall quantifier in the NNF version of expr.
         * If polarity == Polarity.Positive, a quantifier F embedded in expr is skolemized
         * provided it can be proved that F is an exists quantifier in the NNF version of expr.
         *
         * Factorization is performed on the resulting expression.
         */
        public static VCExpr Skolemize(QuantifierInstantiationEngine qiEngine, Polarity polarity, VCExpr vcExpr)
        {
            var skolemizer     = new Skolemizer(qiEngine, polarity, vcExpr);
            var skolemizedExpr = skolemizer.Mutate(vcExpr, true);

            return(Factorizer.Factorize(qiEngine, QuantifierCollector.Flip(polarity), skolemizedExpr));
        }
        public static VCExpr Factorize(QuantifierInstantiationEngine qiEngine, Polarity polarity, VCExpr vcExpr)
        {
            var factorizer = new Factorizer(qiEngine, polarity, vcExpr);

            return(factorizer.Mutate(vcExpr, true));
        }