What would be the best approach for implementing a chaining chain and a reverse chaining process for reasoning in java?
We are given a knowledge base in the form of a horn, which has many statements.
I tried to search the Internet, but I could not find a description of how to implement this concept of artificial intelligence in coding.
My understanding:
I still thought that I would read every sentence (Horn-Form) and create its object. Each object of the Sentence class will have relationship variables, and when I ask for the knowledge base for the Backward or Forward chain, it will check the array of these objects and build the desired chain.
public class Sentence{
private String impliedBy;
private String implementedVar;
public Sentence(String sentence){
String[] relation = sentence.split("=>");
this.impliedBy = relation[0];
this.implementedVar = relation[1];
}
...
}
Challenge the class, saying ...
Sentence s = new Sentence("a&b=>c");
, , , , . , - , ...
!