Exemplo n.º 1
0
        private IEnumerable <ProofTree> EnumerateProofsUsingFlags(string t, List <Flag> flags, int proofsPerTerm)
        {
            if (!basicTransExe.KeepDerivations)
            {
                flags.Add(new Flag(
                              SeverityKind.Error,
                              default(Span),
                              Constants.BadSyntax.ToString("Proofs were not stored."),
                              Constants.BadSyntax.Code));
                yield break;
            }
            else if (applyTarget.Reduced.Node.NodeKind != NodeKind.Transform)
            {
                flags.Add(new Flag(
                              SeverityKind.Error,
                              applyTarget.Reduced.Node,
                              Constants.BadSyntax.ToString("This operation cannot be performed on this type of application."),
                              Constants.BadSyntax.Code));
                yield break;
            }

            Term goalTerm;

            if (!ParseGoalWithDontCares(t, flags, out goalTerm))
            {
                yield break;
            }

            int count;

            foreach (var dt in basicTransExe.GetDerivedTerms(goalTerm))
            {
                count = 0;
                foreach (var p in basicTransExe.GetProofs(dt))
                {
                    ++count;
                    yield return(p);

                    if (proofsPerTerm > 0 && count >= proofsPerTerm)
                    {
                        break;
                    }
                }
            }
        }
Exemplo n.º 2
0
        private IEnumerable <ProofTree> EnumerateProofsUsingFlags(string t, List <Flag> flags, int proofsPerTerm)
        {
            if (!exe.KeepDerivations)
            {
                flags.Add(new Flag(
                              SeverityKind.Error,
                              default(Span),
                              Constants.BadSyntax.ToString("Proofs were not stored."),
                              Constants.BadSyntax.Code));
                yield break;
            }

            Term goalTerm;

            if (!ParseGoalWithDontCares(t, flags, out goalTerm))
            {
                yield break;
            }

            int count;

            foreach (var dt in exe.GetDerivedTerms(goalTerm))
            {
                count = 0;
                foreach (var p in exe.GetProofs(dt))
                {
                    ++count;
                    yield return(p);

                    if (proofsPerTerm > 0 && count >= proofsPerTerm)
                    {
                        break;
                    }
                }
            }
        }