예제 #1
0
 public ProofStep getProofStep()
 {
     if (null == proofStep)
     {
         // Assume was a premise
         proofStep = new ProofStepPremise(this);
     }
     return(proofStep);
 }
예제 #2
0
 public ProofStep getProofStep()
 {
     if (null == proofStep)
     {
         // Assume was a premise
         proofStep = new ProofStepPremise(this);
     }
     return proofStep;
 }
 public ProofStepFoChAssertFact(Clause implication, Literal fact,
         Dictionary<Variable, Term> bindings, ProofStep predecessor)
 {
     this.implication = implication;
     this.fact = fact;
     this.bindings = bindings;
     if (null != predecessor)
     {
         predecessors.Add(predecessor);
     }
 }
예제 #4
0
 public ProofStepFoChAssertFact(Clause implication, Literal fact,
                                Dictionary <Variable, Term> bindings, ProofStep predecessor)
 {
     this.implication = implication;
     this.fact        = fact;
     this.bindings    = bindings;
     if (null != predecessor)
     {
         predecessors.Add(predecessor);
     }
 }
예제 #5
0
        private void addToProofSteps(ProofStep step)
        {
            if (!proofSteps.Contains(step))
            {
                proofSteps.Insert(0, step);
            }
            else
            {
                proofSteps.Remove(step);
                proofSteps.Insert(0, step);
            }
            ICollection <ProofStep> predecessors = step.getPredecessorSteps();

            for (int i = predecessors.Size() - 1; i >= 0; i--)
            {
                addToProofSteps(predecessors.Get(i));
            }
        }
        private void addToProofSteps(ProofStep step)
        {
            if (!proofSteps.Contains(step))
            {
                proofSteps.Insert(0, step);
            }
            else
            {
                proofSteps.Remove(step);
                proofSteps.Insert(0, step);
            }
            List <ProofStep> predecessors = step.getPredecessorSteps();

            for (int i = predecessors.Count - 1; i >= 0; i--)
            {
                addToProofSteps(predecessors[i]);
            }
        }
예제 #7
0
        private void calcualteProofSteps()
        {
            proofSteps = CollectionFactory.CreateQueue <ProofStep>();
            addToProofSteps(finalStep);

            // Move all premises to the front of the
            // list of steps
            int to = 0;

            for (int i = 0; i < proofSteps.Size(); ++i)
            {
                if (proofSteps.Get(i) is ProofStepPremise)
                {
                    ProofStep m = proofSteps.Get(i);
                    proofSteps.Remove(m);
                    proofSteps.Insert(to, m);
                    to++;
                }
            }

            // Move the Goals after the premises
            for (int i = 0; i < proofSteps.Size(); ++i)
            {
                if (proofSteps.Get(i) is ProofStepGoal)
                {
                    ProofStep m = proofSteps.Get(i);
                    proofSteps.Remove(m);
                    proofSteps.Insert(to, m);
                    to++;
                }
            }

            // Assign the step #s now that all the proof
            // steps have been unwound
            for (int i = 0; i < proofSteps.Size(); ++i)
            {
                proofSteps.Get(i).setStepNumber(i + 1);
            }
        }
        // PRIVATE METHODS

        private void calculateProofSteps()
        {
            proofSteps = new List <ProofStep>();
            addToProofSteps(finalStep);

            // Move all premises to the front of the
            // list of steps
            int to = 0;

            for (int i = 0; i < proofSteps.Count; i++)
            {
                if (proofSteps[i] is ProofStepPremise)
                {
                    ProofStep m = proofSteps[i];
                    proofSteps.RemoveAt(i);
                    proofSteps.Insert(to, m);
                    to++;
                }
            }

            // Move the Goals after the premises
            for (int i = 0; i < proofSteps.Count; i++)
            {
                if (proofSteps[i] is ProofStepGoal)
                {
                    ProofStep m = proofSteps[i];
                    proofSteps.RemoveAt(i);
                    proofSteps.Insert(to, m);
                    to++;
                }
            }

            // Assign the step #s now that all the proof
            // steps have been unwound
            for (int i = 0; i < proofSteps.Count; i++)
            {
                proofSteps[i].setStepNumber(i + 1);
            }
        }
예제 #9
0
 public void setProofStep(ProofStep proofStep)
 {
     this.proofStep = proofStep;
 }
예제 #10
0
 public void setProofStep(ProofStep proofStep)
 {
     this.proofStep = proofStep;
 }
 public ProofFinal(ProofStep finalStep, Dictionary <Variable, Term> answerBindings)
 {
     this.finalStep      = finalStep;
     this.answerBindings = answerBindings;
 }
예제 #12
0
 public void addProofStep(ProofStep step)
 {
     stepFinal = step;
 }
예제 #13
0
 public ProofStepRenaming(Object proof, ProofStep predecessor)
 {
     this.proof = proof;
     this.predecessors.Add(predecessor);
 }
예제 #14
0
 public void setPredecessor(ProofStep predecessor)
 {
     predecessors.Clear();
     predecessors.Add(predecessor);
 }
예제 #15
0
            // END-InferenceResult

            public void addProofStep(Clause implication, Literal fact,
                                     Dictionary <Variable, Term> bindings)
            {
                stepFinal = new ProofStepFoChAssertFact(implication, fact,
                                                        bindings, stepFinal);
            }
예제 #16
0
 public void addProofStep(ProofStep step)
 {
     stepFinal = step;
 }
예제 #17
0
 public void setPredecessor(ProofStep predecessor)
 {
     predecessors.Clear();
     predecessors.Add(predecessor);
 }
예제 #18
0
 private void addToProofSteps(ProofStep step)
 {
     if (!proofSteps.Contains(step))
     {
         proofSteps.Insert(0, step);
     }
     else
     {
         proofSteps.Remove(step);
         proofSteps.Insert(0, step);
     }
     List<ProofStep> predecessors = step.getPredecessorSteps();
     for (int i = predecessors.Count - 1; i >= 0; i--)
     {
         addToProofSteps(predecessors[i]);
     }
 }
예제 #19
0
 public ProofFinal(ProofStep finalStep, Dictionary<Variable, Term> answerBindings)
 {
     this.finalStep = finalStep;
     this.answerBindings = answerBindings;
 }
예제 #20
0
 public ProofFinal(ProofStep finalStep, IMap <Variable, Term> answerBindings)
 {
     this.finalStep = finalStep;
     this.answerBindings.PutAll(answerBindings);
 }
예제 #21
0
 public ProofStepRenaming(Object proof, ProofStep predecessor)
 {
     this.proof = proof;
     predecessors.Add(predecessor);
 }
예제 #22
0
            // END-InferenceResult
            //

            public void addProofStep(Clause implication, Literal fact,
                    Dictionary<Variable, Term> bindings)
            {
                stepFinal = new ProofStepFoChAssertFact(implication, fact,
                        bindings, stepFinal);
            }