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.Chain; 008 import aima.logic.fol.kb.data.Clause; 009 010 /** 011 * @author Ciaran O'Reilly 012 * 013 */ 014 public class ProofStepChainFromClause extends AbstractProofStep { 015 private List<ProofStep> predecessors = new ArrayList<ProofStep>(); 016 private Chain chain = null; 017 private Clause fromClause = null; 018 019 public ProofStepChainFromClause(Chain chain, Clause fromClause) { 020 this.chain = chain; 021 this.fromClause = fromClause; 022 this.predecessors.add(fromClause.getProofStep()); 023 } 024 025 // 026 // START-ProofStep 027 public List<ProofStep> getPredecessorSteps() { 028 return Collections.unmodifiableList(predecessors); 029 } 030 031 public String getProof() { 032 return chain.toString(); 033 } 034 035 public String getJustification() { 036 return "Chain from Clause: " 037 + fromClause.getProofStep().getStepNumber(); 038 } 039 // END-ProofStep 040 // 041 }