All Downloads are FREE. Search and download functionalities are using the official Maven repository.

aima.core.logic.fol.inference.proof.ProofStepChainReduction Maven / Gradle / Ivy

Go to download

AIMA-Java Core Algorithms from the book Artificial Intelligence a Modern Approach 3rd Ed.

There is a newer version: 3.0.0
Show newest version
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 ProofStepChainReduction extends AbstractProofStep {
	private List predecessors = new ArrayList();
	private Chain reduction = null;
	private Chain nearParent, farParent = null;
	private Map subst = null;

	public ProofStepChainReduction(Chain reduction, Chain nearParent,
			Chain farParent, Map subst) {
		this.reduction = reduction;
		this.nearParent = nearParent;
		this.farParent = farParent;
		this.subst = subst;
		this.predecessors.add(farParent.getProofStep());
		this.predecessors.add(nearParent.getProofStep());
	}

	//
	// START-ProofStep
	@Override
	public List getPredecessorSteps() {
		return Collections.unmodifiableList(predecessors);
	}

	@Override
	public String getProof() {
		return reduction.toString();
	}

	@Override
	public String getJustification() {
		return "Reduction: " + nearParent.getProofStep().getStepNumber() + ","
				+ farParent.getProofStep().getStepNumber() + " " + subst;
	}
	// END-ProofStep
	//
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy