Solving problems using logic programming
Logic programming looks for solutions by using facts and rules. We need to specify a goal for each program. In the case where a logic program and a goal don't contain any variables, the solver comes up with a tree that constitutes the search space for solving the problem and getting to the goal.
One of the most important things about logic programming is how we treat the rules. Rules can be viewed as logical statements. Let's consider the following:
Kathy likes chocolate => Alexander loves Kathy
This can be read as an implication that says, If Kathy likes chocolate, then Alexander loves Kathy. It can also be construed as Kathy likes chocolate implies Alexander loves Kathy. Similarly, let's consider the following rule:
Crime movies, English => Martin Scorsese
It can be read as the implication If you like crime movies in English, then you would like movies made by Martin Scorsese.
This construction is used in various forms throughout logic programming...