Ejemplo n.º 1
0
        private void workComplete(object sender, WorkFinishedEventArgs <Tree> args)
        {
            string status;

            if (args.Completed)
            {
                tree = args.Result;

                setEnabled(bShowTree, true);
                setEnabled(bSaveTree, true);

                if (tree.State == TreeState.Closed)
                {
                    proof = new Subproof(premises);
                    Subproof sproof = (Subproof)proof;
                    proof.FirstLineNumber = 1;
                    List <WFF> assumptions = new List <WFF>();
                    assumptions.Add(conclusion.GetNegation());
                    Subproof sub = new Subproof(assumptions);
                    sub.parent = proof;
                    sub.AddTree(tree);
                    sproof.steps.Add(sub);
                    sproof.steps.Add(new ProofLine(conclusion, FOL.Proofs.Rule.NotIntro, sub));
                    proof.Clean();

                    setEnabled(bShowProof, true);
                    setEnabled(bSaveProof, true);
                    setText(lConclusion, "Valid");
                }
                else if (tree.State == TreeState.Open)
                {
                    setText(lConclusion, "Invalid");
                }
                else
                {
                    setText(lConclusion, "Unknown");
                }

                setTab(2);
                status = "Done";
            }
            else if (args.Cancelled)
            {
                status = "Stopped";
            }
            else
            {
                status = "Error";
            }

            setStatus(status);
            setText(lTime, args.Time.ToString());

            setEnabled(bParse, true);
            setEnabled(bSatisfy, false);
            setEnabled(bStop, false);
        }
Ejemplo n.º 2
0
        protected virtual void raiseFinishedEvent()
        {
            WorkFinishedEventHandler handler = WorkFinished;

            if (handler == null)
            {
                return;
            }

            WorkFinishedEventArgs <T> a = new WorkFinishedEventArgs <T>(Result, Completed, Cancelled, Time);

            handler(this, a);
        }