
astra.reasoner.unifier.AcreFormulaUnifier Maven / Gradle / Ivy
package astra.reasoner.unifier;
import java.util.Map;
import astra.core.Agent;
import astra.formula.AcreFormula;
import astra.formula.Formula;
import astra.reasoner.FormulaUnifier;
import astra.reasoner.Unifier;
import astra.term.Term;
public class AcreFormulaUnifier implements FormulaUnifier {
@Override
public boolean isApplicable(Formula source, Formula target) {
return (source instanceof AcreFormula) && (target instanceof AcreFormula);
}
@Override
public Map unify(Formula source, Formula target, Map bindings, Agent agent) {
AcreFormula s = (AcreFormula) source;
AcreFormula t = (AcreFormula) target;
Map b = Unifier.unify(
new Term[] { s.cid(), s.index(), s.type(), s.performative() },
new Term[] { t.cid(), t.index(), t.type(), t.performative() },
bindings, agent);
return b != null ? Unifier.unify(s.content(), t.content(), b, agent):null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy