Logic contains rules of inference. A very basic one is the one known as Modus Ponens. This takes the following form
p -> q |
from the formula p implies q |
p |
if proposition p is true |
[therefore] q |
conclude that q is true |
For example:
If John is drunk, then John is happy |
John is drunk |
[therefore] John is happy |
Prolog
includes conditional formulae (like p -> q, but with some syntactic
reorganisation), and an algorithm for computing inferences using Modus Ponens.