astra.formula.Goal Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of astra-interpreter Show documentation
Show all versions of astra-interpreter Show documentation
Core interpreter artifact for the ASTRA Language
package astra.formula;
import astra.reasoner.util.LogicVisitor;
public class Goal implements Formula {
/**
*
*/
private static final long serialVersionUID = -4218559202716916656L;
private Predicate predicate;
public Goal(Predicate predicate) {
this.predicate = predicate;
}
public Predicate formula() {
return predicate;
}
public String toString() {
return "!" + predicate.toString();
}
public Object accept(LogicVisitor visitor) {
return visitor.visit(this);
}
public boolean matches(Formula formula) {
return (formula instanceof Goal) && ((Goal) formula).predicate.matches(predicate);
}
}