Exemple #1
0
 public ProofStep getProofStep()
 {
     if (null == proofStep)
     {
         // Assume was a premise
         proofStep = new ProofStepPremise(this);
     }
     return(proofStep);
 }
Exemple #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);
     }
 }
Exemple #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);
     }
 }
Exemple #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]);
            }
        }
Exemple #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);
            }
        }
Exemple #9
0
 public void setProofStep(ProofStep proofStep)
 {
     this.proofStep = proofStep;
 }
Exemple #10
0
 public void setProofStep(ProofStep proofStep)
 {
     this.proofStep = proofStep;
 }
 public ProofFinal(ProofStep finalStep, Dictionary <Variable, Term> answerBindings)
 {
     this.finalStep      = finalStep;
     this.answerBindings = answerBindings;
 }
 public void addProofStep(ProofStep step)
 {
     stepFinal = step;
 }
 public ProofStepRenaming(Object proof, ProofStep predecessor)
 {
     this.proof = proof;
     this.predecessors.Add(predecessor);
 }
 public void setPredecessor(ProofStep predecessor)
 {
     predecessors.Clear();
     predecessors.Add(predecessor);
 }
            // END-InferenceResult

            public void addProofStep(Clause implication, Literal fact,
                                     Dictionary <Variable, Term> bindings)
            {
                stepFinal = new ProofStepFoChAssertFact(implication, fact,
                                                        bindings, stepFinal);
            }
Exemple #16
0
 public void addProofStep(ProofStep step)
 {
     stepFinal = step;
 }
 public void setPredecessor(ProofStep predecessor)
 {
     predecessors.Clear();
     predecessors.Add(predecessor);
 }
Exemple #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]);
     }
 }
Exemple #19
0
 public ProofFinal(ProofStep finalStep, Dictionary<Variable, Term> answerBindings)
 {
     this.finalStep = finalStep;
     this.answerBindings = answerBindings;
 }
Exemple #20
0
 public ProofFinal(ProofStep finalStep, IMap <Variable, Term> answerBindings)
 {
     this.finalStep = finalStep;
     this.answerBindings.PutAll(answerBindings);
 }
 public ProofStepRenaming(Object proof, ProofStep predecessor)
 {
     this.proof = proof;
     predecessors.Add(predecessor);
 }
Exemple #22
0
            // END-InferenceResult
            //

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