Exemplo n.º 1
0
        public LiftedBool IsDerivable(string t, out List <Flag> flags)
        {
            flags = new List <Flag>();
            Term grndTerm;

            if (!ParseGoalWithDontCares(t, flags, out grndTerm))
            {
                return(LiftedBool.Unknown);
            }

            return(exe.IsDerived(grndTerm));
        }
Exemplo n.º 2
0
        internal void Start()
        {
            Contract.Assert(exe == null);
            exe = new Executer(facts, stats, KeepDerivations, cancel);
            exe.Execute();
            StopTime = DateTime.Now;
            if (cancel.IsCancellationRequested)
            {
                WasCancelled = true;
            }

            UserSymbol requires;

            facts.Index.SymbolTable.ModuleSpace.TryGetSymbol(SymbolTable.RequiresName, out requires);
            Contract.Assert(requires != null);

            bool wasAdded;

            Conclusion = exe.IsDerived(facts.Index.MkApply(requires, TermIndex.EmptyArgs, out wasAdded));
        }
Exemplo n.º 3
0
        /// <summary>
        /// Determines if a matching term was derived.
        /// (Only if applied to a basic transform)
        /// </summary>
        /// <returns></returns>
        public LiftedBool IsDerivable(string t, out List <Flag> flags)
        {
            flags = new List <Flag>();
            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));
                return(LiftedBool.Unknown);
            }

            Term grndTerm;

            if (!ParseGoalWithDontCares(t, flags, out grndTerm))
            {
                return(LiftedBool.Unknown);
            }

            return(basicTransExe.IsDerived(grndTerm));
        }