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 import aima.logic.fol.parsing.ast.TermEquality; 009 010 /** 011 * @author Ciaran O'Reilly 012 * 013 */ 014 public class ProofStepClauseParamodulation extends AbstractProofStep { 015 private List<ProofStep> predecessors = new ArrayList<ProofStep>(); 016 private Clause paramodulated = null; 017 private Clause topClause = null; 018 private Clause equalityClause = null; 019 private TermEquality assertion = null; 020 021 public ProofStepClauseParamodulation(Clause paramodulated, 022 Clause topClause, Clause equalityClause, TermEquality assertion) { 023 this.paramodulated = paramodulated; 024 this.topClause = topClause; 025 this.equalityClause = equalityClause; 026 this.assertion = assertion; 027 this.predecessors.add(topClause.getProofStep()); 028 this.predecessors.add(equalityClause.getProofStep()); 029 } 030 031 // 032 // START-ProofStep 033 public List<ProofStep> getPredecessorSteps() { 034 return Collections.unmodifiableList(predecessors); 035 } 036 037 public String getProof() { 038 return paramodulated.toString(); 039 } 040 041 public String getJustification() { 042 return "Paramodulation: " + topClause.getProofStep().getStepNumber() 043 + ", " + equalityClause.getProofStep().getStepNumber() + ", [" 044 + assertion + "]"; 045 046 } 047 // END-ProofStep 048 // 049 }