fr.boreal.backward_chaining.api.BackwardChainingAlgorithm Maven / Gradle / Ivy
package fr.boreal.backward_chaining.api;
import fr.boreal.model.formula.api.FOFormula;
import fr.boreal.model.kb.api.RuleBase;
import fr.boreal.model.query.api.FOQuery;
import fr.boreal.model.query.impl.UnionFOQuery;
/**
* A Backward Chaining algorithm rewrites a {@link FOQuery} according to the
* given {@link RuleBase}.
*/
public interface BackwardChainingAlgorithm {
/**
* Execute the algorithm
*
* @param query the query to rewrite
* @param rules the rules with which to rewrite the query
* @return the union of all rewritings of the query with the rules
*/
UnionFOQuery rewrite(FOQuery extends FOFormula> query, RuleBase rules);
}