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

astra.term.QueryTerm Maven / Gradle / Ivy

package astra.term;

import astra.formula.Formula;
import astra.reasoner.util.LogicVisitor;
import astra.type.Type;

public class QueryTerm implements Term {
	/**
	 * 
	 */
	private static final long serialVersionUID = -3531850681574434943L;
	Formula formula;
	
	public QueryTerm(Formula formula) {
		this.formula = formula;
	}

	public Boolean value() {
		System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>  QueryTerm.value  <<<<<<<<<<<<<<<<<<<<<<<<<<<<");
		return null;
	}

	public void reIndex() {
		formula.reIndex();
	}

	@Override
	public Type type() {
		return Type.BOOLEAN;
	}
	
	public Formula formula() {
		return formula;
	}

	@Override
	public Object accept(LogicVisitor visitor) {
		return visitor.visit(this);
	}

	@Override
	public boolean matches(Term term) {
		System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>> QueryTerm.matches <<<<<<<<<<<<<<<<<<<<<<<<<<<<");
		return (term instanceof Variable);
	}

	@Override
	public String signature() {
		return "qt";
	}
	
	public String toString() {
		return "query(" + formula.toString() + ")";
	}

	public QueryTerm clone() {
		return null;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy