aima.core.logic.fol.inference.proof.ProofStepChainCancellation Maven / Gradle / Ivy
package aima.core.logic.fol.inference.proof;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import aima.core.logic.fol.kb.data.Chain;
import aima.core.logic.fol.parsing.ast.Term;
import aima.core.logic.fol.parsing.ast.Variable;
/**
* @author Ciaran O'Reilly
*
*/
public class ProofStepChainCancellation extends AbstractProofStep {
private List predecessors = new ArrayList();
private Chain cancellation = null;
private Chain cancellationOf = null;
private Map subst = null;
public ProofStepChainCancellation(Chain cancellation, Chain cancellationOf,
Map subst) {
this.cancellation = cancellation;
this.cancellationOf = cancellationOf;
this.subst = subst;
this.predecessors.add(cancellationOf.getProofStep());
}
//
// START-ProofStep
@Override
public List getPredecessorSteps() {
return Collections.unmodifiableList(predecessors);
}
@Override
public String getProof() {
return cancellation.toString();
}
@Override
public String getJustification() {
return "Cancellation: " + cancellationOf.getProofStep().getStepNumber()
+ " " + subst;
}
// END-ProofStep
//
}