001    package aima.logic.fol.inference.proof;
002    
003    import java.util.ArrayList;
004    import java.util.Collections;
005    import java.util.List;
006    
007    import aima.logic.fol.kb.data.Clause;
008    
009    /**
010     * @author Ciaran O'Reilly
011     * 
012     */
013    public class ProofStepClauseFactor extends AbstractProofStep {
014            private List<ProofStep> predecessors = new ArrayList<ProofStep>();
015            private Clause factor = null;
016            private Clause factorOf = null;
017    
018            public ProofStepClauseFactor(Clause factor, Clause factorOf) {
019                    this.factor = factor;
020                    this.factorOf = factorOf;
021                    this.predecessors.add(factorOf.getProofStep());
022            }
023    
024            //
025            // START-ProofStep
026            public List<ProofStep> getPredecessorSteps() {
027                    return Collections.unmodifiableList(predecessors);
028            }
029    
030            public String getProof() {
031                    return factor.toString();
032            }
033    
034            public String getJustification() {
035                    return "Factor of " + factorOf.getProofStep().getStepNumber();
036            }
037            // END-ProofStep
038            //
039    }